Linux-m68k Archive mirror
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: "Ding, Shenghao" <shenghao-ding@ti.com>
Cc: "broonie@kernel.org" <broonie@kernel.org>,
	"robh+dt@kernel.org" <robh+dt@kernel.org>,
	"andriy.shevchenko@linux.intel.com" 
	<andriy.shevchenko@linux.intel.com>,
	"lgirdwood@gmail.com" <lgirdwood@gmail.com>,
	"perex@perex.cz" <perex@perex.cz>,
	"pierre-louis.bossart@linux.intel.com" 
	<pierre-louis.bossart@linux.intel.com>,
	"Lu, Kevin" <kevin-lu@ti.com>,
	"13916275206@139.com" <13916275206@139.com>,
	"alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"liam.r.girdwood@intel.com" <liam.r.girdwood@intel.com>,
	"mengdong.lin@intel.com" <mengdong.lin@intel.com>,
	"Xu, Baojun" <baojun.xu@ti.com>,
	"thomas.gfeller@q-drop.com" <thomas.gfeller@q-drop.com>,
	"Gupta, Peeyush" <peeyush@ti.com>,
	"Navada Kanyana, Mukund" <navada@ti.com>,
	"tiwai@suse.de" <tiwai@suse.de>, Arnd Bergmann <arnd@arndb.de>,
	linux-m68k <linux-m68k@lists.linux-m68k.org>
Subject: Re: [EXTERNAL] Re: [PATCH v1] ASoC: tas2781: fixed compiling issue in m68k
Date: Tue, 3 Oct 2023 14:15:36 +0200	[thread overview]
Message-ID: <CAMuHMdXRGxnGpVHiB+Zvxq+G4K-BL8JsJGbG+7CNtJiqGwHOsQ@mail.gmail.com> (raw)
In-Reply-To: <79c4d534ad20452c992d8ace138e4384@ti.com>

Hi Shenghao,

On Tue, Oct 3, 2023 at 12:47 PM Ding, Shenghao <shenghao-ding@ti.com> wrote:
> > -----Original Message-----
> > From: Geert Uytterhoeven <geert@linux-m68k.org>
> > Sent: Tuesday, October 3, 2023 3:24 AM
> > To: Ding, Shenghao <shenghao-ding@ti.com>
> > Cc: broonie@kernel.org; robh+dt@kernel.org;
> > andriy.shevchenko@linux.intel.com; lgirdwood@gmail.com; perex@perex.cz;
> > pierre-louis.bossart@linux.intel.com; Lu, Kevin <kevin-lu@ti.com>;
> > 13916275206@139.com; alsa-devel@alsa-project.org; linux-
> > kernel@vger.kernel.org; liam.r.girdwood@intel.com; mengdong.lin@intel.com;
> > Xu, Baojun <baojun.xu@ti.com>; thomas.gfeller@q-drop.com; Gupta, Peeyush
> > <peeyush@ti.com>; Navada Kanyana, Mukund <navada@ti.com>;
> > tiwai@suse.de
> > Subject: [EXTERNAL] Re: [PATCH v1] ASoC: tas2781: fixed compiling issue in
> > m68k
> >
> > Hi Shenghao,
> >
> > Thanks for your patch!
> >
> > On Mon, Oct 2, 2023 at 4:38 PM Shenghao Ding <shenghao-ding@ti.com>
> > wrote:
> > > fixed m68k compiling issue: mapping table can save code field; storing
> > > the
> >
> > Please replicate the actual error message from the compiler, so it is recorded in
> > the commit description, and easy to find when someone searches for the actual
> > error message
> >
> > From the Reported-by (which is not included in the actual description, as it is
> > below the "---"):
> >
> >        {standard input}: Assembler messages:
> >     >> {standard input}:992: Error: value -148 out of range
> >        {standard input}:992: Error: value of ffffff6c too large for field of 1 byte at
> > 0000045f
> >
> > > dev_idx as a member of block can reduce unnecessary  time and system
> > > resource comsumption of dev_idx mapping every time the block data
> > > writing to the dsp.
> >
> > I am sorry, but I don't understand what this means.
> > Can you please elaborate?
> >
> > Also, can you please explain what the real issue is?
> > (My first guess when seeing the error message before was that a  signed
> > integer is truncated to an unsigned char or so, but I couldn't see  immediately
> > where that is happening)
> Sorry to late feedback. I had been troubled by this issue for several weeks. At first, I also think it would one of variables overflow, according to the compiling error message. However, after investigation, no result came out. In fact, compiler will report the line number where the variable overflow is, if there was risk on the variable overflow. Yet, this compiling error did not report any line number. Finally, I didn’t realize that it would be the code section overflow until that compiling error message magically disappeared, one day I removed some functions in the tas2781-fwlib.c. So, I began to simplify some functions in the code.

I managed to reproduce the issue with the m68k cross-compiler from
https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_64/13.2.0/

    | sound/soc/codecs/tas2781-fmwlib.c:779:            switch (block->type) {
            subq.l #1,%a0       |, tmp56
            moveq #36,%d0       |,
            cmp.l %a0,%d0       | tmp56,
            jcs .L122           |
            move.l %a0,%d0      | tmp56, tmp59
            add.l %d0,%d0       | tmp59
            move.w .L95(%pc,%d0.l),%d0  |, tmp60
    .L125:
    | sound/soc/codecs/tas2781-fmwlib.c:827:            switch (block->type) {
            jmp %pc@(2,%d0:w)   | tmp66
            .balignw 2,0x284c
    .L95:
            .word .L109-.L95
            .word .L113-.L95

            [...]

    | sound/soc/codecs/tas2781-fmwlib.c:827:            switch (block->type) {
            moveq #36,%d0       |,
            cmp.l %a0,%d0       | tmp77,
            jcs .L122           |
            move.l %a0,%d0      | tmp77,
            add.l %d0,%d0       |
            move.l %d0,%a0      |, tmp65
--->        move.w .L95(%pc,%a0.l),%d0  |, tmp66
            jra .L125           |

Looks like the compiler is sharing the jump table at L95 for two
different switch() statements, but the PC-relative offset to refer to
the table is too large when using -m68000.  It works fine with -m68020.

Probably a compiler bug?

> > > Signed-off-by: Shenghao Ding <shenghao-ding@ti.com>
> > >
> > > ---
> > > Changes in v1:
> > >  - | Reported-by: kernel test robot <lkp@intel.com>
> > >    | Closes:
> > >    | https://lore.kernel.org/oe-kbuild-all/202309222048.RnSqEIK5-lkp@intel.com/

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

       reply	other threads:[~2023-10-03 12:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20231002090434.1896-1-shenghao-ding@ti.com>
     [not found] ` <CAMuHMdXr5oRgkFqYZnPe3Xdyq_QjtzhfL8Wa_e9JA0S1XhEhWw@mail.gmail.com>
     [not found]   ` <79c4d534ad20452c992d8ace138e4384@ti.com>
2023-10-03 12:15     ` Geert Uytterhoeven [this message]
2023-10-03 16:23       ` [EXTERNAL] Re: [PATCH v1] ASoC: tas2781: fixed compiling issue in m68k Andreas Schwab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAMuHMdXRGxnGpVHiB+Zvxq+G4K-BL8JsJGbG+7CNtJiqGwHOsQ@mail.gmail.com \
    --to=geert@linux-m68k.org \
    --cc=13916275206@139.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=arnd@arndb.de \
    --cc=baojun.xu@ti.com \
    --cc=broonie@kernel.org \
    --cc=kevin-lu@ti.com \
    --cc=lgirdwood@gmail.com \
    --cc=liam.r.girdwood@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-m68k@lists.linux-m68k.org \
    --cc=mengdong.lin@intel.com \
    --cc=navada@ti.com \
    --cc=peeyush@ti.com \
    --cc=perex@perex.cz \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=robh+dt@kernel.org \
    --cc=shenghao-ding@ti.com \
    --cc=thomas.gfeller@q-drop.com \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).