linux-phy.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* linus: arm64: error: call to '__compiletime_assert_536' declared with attribute error: FIELD_PREP: value too large for the field
@ 2025-01-30  9:52 Naresh Kamboju
  2025-01-30 20:01 ` David Laight
  0 siblings, 1 reply; 3+ messages in thread
From: Naresh Kamboju @ 2025-01-30  9:52 UTC (permalink / raw)
  To: linux-phy, open list, lkft-triage, Linux Regressions
  Cc: David Laight, Vinod Koul, Adam Ford, Arnd Bergmann, Dan Carpenter,
	Anders Roxell

The arm64 build failed with defconfig with gcc-8 toolchain failed due to
following build warnings / errors on the mainline linux master branch.
But the gcc-13 builds pass.

First seen on v6.13-9485-g72deda0abee6 on Jan. 30, 2025
Good:  v6.13-9338-g05dbaf8dd8bf on Jan. 29, 2025
Bad:  v6.13-9485-g72deda0abee6 on Jan. 30, 2025

arm64:
  build:
    * gcc-8-i386_defconfig

Reported-by: Linux Kernel Functional Testing

Build log:
---
ake --silent --keep-going --jobs=8
O=/home/tuxbuild/.cache/tuxmake/builds/1/build ARCH=arm64
CROSS_COMPILE=aarch64-linux-gnu-
CROSS_COMPILE_COMPAT=arm-linux-gnueabihf- 'CC=sccache
aarch64-linux-gnu-gcc' 'HOSTCC=sccache gcc'
In file included from <command-line>:
In function 'fsl_samsung_hdmi_phy_configure_pll_lock_det.isra.10',
    inlined from 'fsl_samsung_hdmi_phy_configure' at
drivers/phy/freescale/phy-fsl-samsung-hdmi.c:469:2:
include/linux/compiler_types.h:542:38: error: call to
'__compiletime_assert_536' declared with attribute error: FIELD_PREP:
value too large for the field
  _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
                                      ^
include/linux/compiler_types.h:523:4: note: in definition of macro
'__compiletime_assert'
    prefix ## suffix();    \
    ^~~~~~
include/linux/compiler_types.h:542:2: note: in expansion of macro
'_compiletime_assert'
  _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
  ^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:37: note: in expansion of macro
'compiletime_assert'
 #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                     ^~~~~~~~~~~~~~~~~~
include/linux/bitfield.h:68:3: note: in expansion of macro 'BUILD_BUG_ON_MSG'
   BUILD_BUG_ON_MSG(__builtin_constant_p(_val) ?  \
   ^~~~~~~~~~~~~~~~
include/linux/bitfield.h:115:3: note: in expansion of macro '__BF_FIELD_CHECK'
   __BF_FIELD_CHECK(_mask, 0ULL, _val, "FIELD_PREP: "); \
   ^~~~~~~~~~~~~~~~
drivers/phy/freescale/phy-fsl-samsung-hdmi.c:344:9: note: in expansion
of macro 'FIELD_PREP'
  writeb(FIELD_PREP(REG12_CK_DIV_MASK, div), phy->regs + PHY_REG(12));
         ^~~~~~~~~~
make[6]: *** [scripts/Makefile.build:194:
drivers/phy/freescale/phy-fsl-samsung-hdmi.o] Error 1

Links:
---
 build log: https://qa-reports.linaro.org/lkft/linux-mainline-master/build/v6.13-9485-g72deda0abee6/testrun/27067488/suite/build/test/gcc-8-defconfig/log
 details: https://qa-reports.linaro.org/lkft/linux-mainline-master/build/v6.13-9485-g72deda0abee6/testrun/27067488/suite/build/test/gcc-8-defconfig/details/
 history: https://qa-reports.linaro.org/lkft/linux-mainline-master/build/v6.13-9485-g72deda0abee6/testrun/27067488/suite/build/test/gcc-8-defconfig/history/

Steps to reproduce:
------------
# tuxmake --runtime podman --target-arch arm64 --toolchain gcc-8
--kconfig defconfig

metadata:
---
  git describe: v6.13-9485-g72deda0abee6
  git repo: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
  git sha: 72deda0abee6e705ae71a93f69f55e33be5bca5c
  kernel config:
https://storage.tuxsuite.com/public/linaro/lkft/builds/2sKEbH5NudB5wtp6BtFn2cIlatV/config
  build url: https://storage.tuxsuite.com/public/linaro/lkft/builds/2sKEbH5NudB5wtp6BtFn2cIlatV/
  toolchain: gcc-8
  config: gcc-8-defconfig
  arch: arm64


--
Linaro LKFT
https://lkft.linaro.org

-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: linus: arm64: error: call to '__compiletime_assert_536' declared with attribute error: FIELD_PREP: value too large for the field
  2025-01-30  9:52 linus: arm64: error: call to '__compiletime_assert_536' declared with attribute error: FIELD_PREP: value too large for the field Naresh Kamboju
@ 2025-01-30 20:01 ` David Laight
  2025-01-30 20:20   ` Adam Ford
  0 siblings, 1 reply; 3+ messages in thread
From: David Laight @ 2025-01-30 20:01 UTC (permalink / raw)
  To: Naresh Kamboju
  Cc: linux-phy, open list, lkft-triage, Linux Regressions,
	David Laight, Vinod Koul, Adam Ford, Arnd Bergmann, Dan Carpenter,
	Anders Roxell, Adam Ford, Frieder Schrempf, Vinod Koul

On Thu, 30 Jan 2025 15:22:06 +0530
Naresh Kamboju <naresh.kamboju@linaro.org> wrote:

> The arm64 build failed with defconfig with gcc-8 toolchain failed due to
> following build warnings / errors on the mainline linux master branch.
> But the gcc-13 builds pass.
> 
> First seen on v6.13-9485-g72deda0abee6 on Jan. 30, 2025
> Good:  v6.13-9338-g05dbaf8dd8bf on Jan. 29, 2025
> Bad:  v6.13-9485-g72deda0abee6 on Jan. 30, 2025
> 
> arm64:
>   build:
>     * gcc-8-i386_defconfig
> 
> Reported-by: Linux Kernel Functional Testing
> 
> Build log:
> ---
> ake --silent --keep-going --jobs=8
> O=/home/tuxbuild/.cache/tuxmake/builds/1/build ARCH=arm64
> CROSS_COMPILE=aarch64-linux-gnu-
> CROSS_COMPILE_COMPAT=arm-linux-gnueabihf- 'CC=sccache
> aarch64-linux-gnu-gcc' 'HOSTCC=sccache gcc'
> In file included from <command-line>:
> In function 'fsl_samsung_hdmi_phy_configure_pll_lock_det.isra.10',
>     inlined from 'fsl_samsung_hdmi_phy_configure' at
> drivers/phy/freescale/phy-fsl-samsung-hdmi.c:469:2:
> include/linux/compiler_types.h:542:38: error: call to
> '__compiletime_assert_536' declared with attribute error: FIELD_PREP:
> value too large for the field
...
> drivers/phy/freescale/phy-fsl-samsung-hdmi.c:344:9: note: in expansion
> of macro 'FIELD_PREP'
>   writeb(FIELD_PREP(REG12_CK_DIV_MASK, div), phy->regs + PHY_REG(12));
>          ^~~~~~~~~~

Yep...
Broken by d567679f2b6a8

Preceded by:
        /* Find int_pllclk speed */
        for (div = 0; div < 4; div++) {
                int_pllclk = pclk / (1 << div);
                if (int_pllclk < (50 * MHZ))
                        break;
        }
with:
#define REG12_CK_DIV_MASK       GENMASK(5, 4)

The compiler has optimised (pessimised?) the code somewhat.
If pclk is very large the loop doesn't 'break' so div == 4.
It then does FIELD_PREP(GENMASK(5, 4), 4) - which is an error.

	David




-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: linus: arm64: error: call to '__compiletime_assert_536' declared with attribute error: FIELD_PREP: value too large for the field
  2025-01-30 20:01 ` David Laight
@ 2025-01-30 20:20   ` Adam Ford
  0 siblings, 0 replies; 3+ messages in thread
From: Adam Ford @ 2025-01-30 20:20 UTC (permalink / raw)
  To: David Laight
  Cc: Naresh Kamboju, linux-phy, open list, lkft-triage,
	Linux Regressions, David Laight, Vinod Koul, Arnd Bergmann,
	Dan Carpenter, Anders Roxell, Frieder Schrempf, Pei Xiao

On Thu, Jan 30, 2025 at 2:01 PM David Laight
<david.laight.linux@gmail.com> wrote:
>
> On Thu, 30 Jan 2025 15:22:06 +0530
> Naresh Kamboju <naresh.kamboju@linaro.org> wrote:
>
> > The arm64 build failed with defconfig with gcc-8 toolchain failed due to
> > following build warnings / errors on the mainline linux master branch.
> > But the gcc-13 builds pass.
> >
> > First seen on v6.13-9485-g72deda0abee6 on Jan. 30, 2025
> > Good:  v6.13-9338-g05dbaf8dd8bf on Jan. 29, 2025
> > Bad:  v6.13-9485-g72deda0abee6 on Jan. 30, 2025
> >
> > arm64:
> >   build:
> >     * gcc-8-i386_defconfig
> >
> > Reported-by: Linux Kernel Functional Testing
> >
> > Build log:
> > ---
> > ake --silent --keep-going --jobs=8
> > O=/home/tuxbuild/.cache/tuxmake/builds/1/build ARCH=arm64
> > CROSS_COMPILE=aarch64-linux-gnu-
> > CROSS_COMPILE_COMPAT=arm-linux-gnueabihf- 'CC=sccache
> > aarch64-linux-gnu-gcc' 'HOSTCC=sccache gcc'
> > In file included from <command-line>:
> > In function 'fsl_samsung_hdmi_phy_configure_pll_lock_det.isra.10',
> >     inlined from 'fsl_samsung_hdmi_phy_configure' at
> > drivers/phy/freescale/phy-fsl-samsung-hdmi.c:469:2:
> > include/linux/compiler_types.h:542:38: error: call to
> > '__compiletime_assert_536' declared with attribute error: FIELD_PREP:
> > value too large for the field
> ...
> > drivers/phy/freescale/phy-fsl-samsung-hdmi.c:344:9: note: in expansion
> > of macro 'FIELD_PREP'
> >   writeb(FIELD_PREP(REG12_CK_DIV_MASK, div), phy->regs + PHY_REG(12));
> >          ^~~~~~~~~~
>
> Yep...
> Broken by d567679f2b6a8
>
> Preceded by:
>         /* Find int_pllclk speed */
>         for (div = 0; div < 4; div++) {
>                 int_pllclk = pclk / (1 << div);
>                 if (int_pllclk < (50 * MHZ))
>                         break;
>         }
> with:
> #define REG12_CK_DIV_MASK       GENMASK(5, 4)
>
> The compiler has optimised (pessimised?) the code somewhat.
> If pclk is very large the loop doesn't 'break' so div == 4.

I believe a fix was submitted:
https://patchwork.kernel.org/project/linux-phy/patch/5b9a5f765f075263498f9a7b62b0b1030d87b6ba.1736476210.git.xiaopei01@kylinos.cn/

It appears to be waiting for approval and/or merge.  If someone wants
to test it.  I added Pei,the author of the fix, to the CC in this
thread.

adam


adam

> It then does FIELD_PREP(GENMASK(5, 4), 4) - which is an error.
>
>         David
>
>
>

-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-01-30 20:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-30  9:52 linus: arm64: error: call to '__compiletime_assert_536' declared with attribute error: FIELD_PREP: value too large for the field Naresh Kamboju
2025-01-30 20:01 ` David Laight
2025-01-30 20:20   ` Adam Ford

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 NNTP newsgroup(s).