Re: linux-next: build failure after merge of the pci tree

From: Ilpo Järvinen
Date: Tue Oct 24 2023 - 07:01:38 EST


On Tue, 24 Oct 2023, Stephen Rothwell wrote:

> Hi all,
>
> After merging the pci tree, today's linux-next build (arm64 defconfig)
> failed like this:
>
> In file included from <command-line>:
> drivers/pci/controller/dwc/pcie-tegra194.c: In function 'tegra_pcie_ep_irq_thread':
> include/linux/compiler_types.h:435:45: error: call to '__compiletime_assert_497' declared with attribute error: FIELD_PREP: value too large for the field
> 435 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
> | ^
> include/linux/compiler_types.h:416:25: note: in definition of macro '__compiletime_assert'
> 416 | prefix ## suffix(); \
> | ^~~~~~
> include/linux/compiler_types.h:435:9: note: in expansion of macro '_compiletime_assert'
> 435 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
> | ^~~~~~~~~~~~~~~~~~~
> include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
> 39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
> | ^~~~~~~~~~~~~~~~~~
> include/linux/bitfield.h:68:17: note: in expansion of macro 'BUILD_BUG_ON_MSG'
> 68 | BUILD_BUG_ON_MSG(__builtin_constant_p(_val) ? \
> | ^~~~~~~~~~~~~~~~
> include/linux/bitfield.h:114:17: note: in expansion of macro '__BF_FIELD_CHECK'
> 114 | __BF_FIELD_CHECK(_mask, 0ULL, _val, "FIELD_PREP: "); \
> | ^~~~~~~~~~~~~~~~
> drivers/pci/controller/dwc/pcie-tegra194.c:498:29: note: in expansion of macro 'FIELD_PREP'
> 498 | val = 110 | FIELD_PREP(PCI_LTR_SCALE_SHIFT, 2) | LTR_MSG_REQ;
> | ^~~~~~~~~~
>
> Caused by commit
>
> 18ca6c2c2d0e ("PCI: dwc: Use FIELD_GET/PREP()")
>
> I have reverted that commit for today.

Thanks for providing the full error message. I already was trying to
investigate it and reproduce the problem because LKP's report I got about
this failed to provide the full error message.

It seems that the original code was more complex than it looked and the
patch is wrong and suboptimal on multiple counts. I'll provide a fixed
v2.

--
i.