* [spacemit:for-next 4/6] drivers/clk/spacemit/ccu-k1.c:241:1: error: initializer element is not a compile-time constant
@ 2025-04-15 13:44 kernel test robot
2025-04-15 14:16 ` Alex Elder
0 siblings, 1 reply; 8+ messages in thread
From: kernel test robot @ 2025-04-15 13:44 UTC (permalink / raw)
To: Haylen Chu; +Cc: llvm, oe-kbuild-all, Yixun Lan, Alex Elder, Inochi Amaoto
tree: https://github.com/spacemit-com/linux for-next
head: 9ead3efbc88a21e9a1f38948cc0902518022a2e5
commit: e2d238ba301f25a5c8a7d490a36f9cd014d7aecc [4/6] clk: spacemit: Add clock support for SpacemiT K1 SoC
config: s390-allmodconfig (https://download.01.org/0day-ci/archive/20250415/202504152107.7ekGPIrF-lkp@intel.com/config)
compiler: clang version 18.1.8 (https://github.com/llvm/llvm-project 3b5b5c1ec4a3095ab096dd780e84d7ab81f3d7ff)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250415/202504152107.7ekGPIrF-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202504152107.7ekGPIrF-lkp@intel.com/
All errors (new ones prefixed by >>):
>> drivers/clk/spacemit/ccu-k1.c:241:1: error: initializer element is not a compile-time constant
241 | CCU_DDN_DEFINE(slow_uart1_14p74, pll1_d16_153p6, MPMU_SUCCR, GENMASK(28, 16), GENMASK(12, 0), 0);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/clk/spacemit/ccu_ddn.h:33:15: note: expanded from macro 'CCU_DDN_DEFINE'
33 | .num_shift = __ffs(_num_mask), \
| ^~~~~~~~~~~~~~~~
drivers/clk/spacemit/ccu-k1.c:242:1: error: initializer element is not a compile-time constant
242 | CCU_DDN_DEFINE(slow_uart2_48, pll1_d4_614p4, MPMU_SUCCR_1, GENMASK(28, 16), GENMASK(12, 0), 0);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/clk/spacemit/ccu_ddn.h:33:15: note: expanded from macro 'CCU_DDN_DEFINE'
33 | .num_shift = __ffs(_num_mask), \
| ^~~~~~~~~~~~~~~~
2 errors generated.
vim +241 drivers/clk/spacemit/ccu-k1.c
239
240 CCU_GATE_DEFINE(slow_uart, CCU_PARENT_NAME(osc), MPMU_ACGR, BIT(1), CLK_IGNORE_UNUSED);
> 241 CCU_DDN_DEFINE(slow_uart1_14p74, pll1_d16_153p6, MPMU_SUCCR, GENMASK(28, 16), GENMASK(12, 0), 0);
242 CCU_DDN_DEFINE(slow_uart2_48, pll1_d4_614p4, MPMU_SUCCR_1, GENMASK(28, 16), GENMASK(12, 0), 0);
243
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [spacemit:for-next 4/6] drivers/clk/spacemit/ccu-k1.c:241:1: error: initializer element is not a compile-time constant
2025-04-15 13:44 [spacemit:for-next 4/6] drivers/clk/spacemit/ccu-k1.c:241:1: error: initializer element is not a compile-time constant kernel test robot
@ 2025-04-15 14:16 ` Alex Elder
2025-04-15 14:31 ` Yixun Lan
0 siblings, 1 reply; 8+ messages in thread
From: Alex Elder @ 2025-04-15 14:16 UTC (permalink / raw)
To: kernel test robot, Haylen Chu
Cc: llvm, oe-kbuild-all, Yixun Lan, Inochi Amaoto
On 4/15/25 8:44 AM, kernel test robot wrote:
> tree: https://github.com/spacemit-com/linux for-next
> head: 9ead3efbc88a21e9a1f38948cc0902518022a2e5
> commit: e2d238ba301f25a5c8a7d490a36f9cd014d7aecc [4/6] clk: spacemit: Add clock support for SpacemiT K1 SoC
> config: s390-allmodconfig (https://download.01.org/0day-ci/archive/20250415/202504152107.7ekGPIrF-lkp@intel.com/config)
> compiler: clang version 18.1.8 (https://github.com/llvm/llvm-project 3b5b5c1ec4a3095ab096dd780e84d7ab81f3d7ff)
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250415/202504152107.7ekGPIrF-lkp@intel.com/reproduce)
>
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@intel.com>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202504152107.7ekGPIrF-lkp@intel.com/
>
> All errors (new ones prefixed by >>):
If I'm interpreting this right, this seems to be a problem on
a S390 build (under COMPILE_TEST), because there is no constant
version of the __ffs() for that architecture. This might be the
case on other architectures as well.
On RISC-V, this is fine.
Any recommendations on how to address this?
-Alex
>
>>> drivers/clk/spacemit/ccu-k1.c:241:1: error: initializer element is not a compile-time constant
> 241 | CCU_DDN_DEFINE(slow_uart1_14p74, pll1_d16_153p6, MPMU_SUCCR, GENMASK(28, 16), GENMASK(12, 0), 0);
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> drivers/clk/spacemit/ccu_ddn.h:33:15: note: expanded from macro 'CCU_DDN_DEFINE'
> 33 | .num_shift = __ffs(_num_mask), \
> | ^~~~~~~~~~~~~~~~
> drivers/clk/spacemit/ccu-k1.c:242:1: error: initializer element is not a compile-time constant
> 242 | CCU_DDN_DEFINE(slow_uart2_48, pll1_d4_614p4, MPMU_SUCCR_1, GENMASK(28, 16), GENMASK(12, 0), 0);
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> drivers/clk/spacemit/ccu_ddn.h:33:15: note: expanded from macro 'CCU_DDN_DEFINE'
> 33 | .num_shift = __ffs(_num_mask), \
> | ^~~~~~~~~~~~~~~~
> 2 errors generated.
>
>
> vim +241 drivers/clk/spacemit/ccu-k1.c
>
> 239
> 240 CCU_GATE_DEFINE(slow_uart, CCU_PARENT_NAME(osc), MPMU_ACGR, BIT(1), CLK_IGNORE_UNUSED);
> > 241 CCU_DDN_DEFINE(slow_uart1_14p74, pll1_d16_153p6, MPMU_SUCCR, GENMASK(28, 16), GENMASK(12, 0), 0);
> 242 CCU_DDN_DEFINE(slow_uart2_48, pll1_d4_614p4, MPMU_SUCCR_1, GENMASK(28, 16), GENMASK(12, 0), 0);
> 243
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [spacemit:for-next 4/6] drivers/clk/spacemit/ccu-k1.c:241:1: error: initializer element is not a compile-time constant
2025-04-15 14:16 ` Alex Elder
@ 2025-04-15 14:31 ` Yixun Lan
2025-04-15 14:56 ` Haylen Chu
2025-04-15 16:03 ` Alex Elder
0 siblings, 2 replies; 8+ messages in thread
From: Yixun Lan @ 2025-04-15 14:31 UTC (permalink / raw)
To: Alex Elder; +Cc: Haylen Chu, llvm, oe-kbuild-all, Inochi Amaoto
Hi Alex,
On 09:16 Tue 15 Apr , Alex Elder wrote:
> On 4/15/25 8:44 AM, kernel test robot wrote:
> > tree: https://github.com/spacemit-com/linux for-next
> > head: 9ead3efbc88a21e9a1f38948cc0902518022a2e5
> > commit: e2d238ba301f25a5c8a7d490a36f9cd014d7aecc [4/6] clk: spacemit: Add clock support for SpacemiT K1 SoC
> > config: s390-allmodconfig (https://download.01.org/0day-ci/archive/20250415/202504152107.7ekGPIrF-lkp@intel.com/config)
> > compiler: clang version 18.1.8 (https://github.com/llvm/llvm-project 3b5b5c1ec4a3095ab096dd780e84d7ab81f3d7ff)
> > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250415/202504152107.7ekGPIrF-lkp@intel.com/reproduce)
> >
> > If you fix the issue in a separate patch/commit (i.e. not just a new version of
> > the same patch/commit), kindly add following tags
> > | Reported-by: kernel test robot <lkp@intel.com>
> > | Closes: https://lore.kernel.org/oe-kbuild-all/202504152107.7ekGPIrF-lkp@intel.com/
> >
> > All errors (new ones prefixed by >>):
>
> If I'm interpreting this right, this seems to be a problem on
> a S390 build (under COMPILE_TEST), because there is no constant
> version of the __ffs() for that architecture. This might be the
> case on other architectures as well.
>
> On RISC-V, this is fine.
>
> Any recommendations on how to address this?
>
it occur to me the __ffs() isn't really necessary, since all input
is constant value (GENMASK here), we then should know the shift..
>
>
> >
> >>> drivers/clk/spacemit/ccu-k1.c:241:1: error: initializer element is not a compile-time constant
> > 241 | CCU_DDN_DEFINE(slow_uart1_14p74, pll1_d16_153p6, MPMU_SUCCR, GENMASK(28, 16), GENMASK(12, 0), 0);
> > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > drivers/clk/spacemit/ccu_ddn.h:33:15: note: expanded from macro 'CCU_DDN_DEFINE'
> > 33 | .num_shift = __ffs(_num_mask), \
> > | ^~~~~~~~~~~~~~~~
> > drivers/clk/spacemit/ccu-k1.c:242:1: error: initializer element is not a compile-time constant
> > 242 | CCU_DDN_DEFINE(slow_uart2_48, pll1_d4_614p4, MPMU_SUCCR_1, GENMASK(28, 16), GENMASK(12, 0), 0);
> > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > drivers/clk/spacemit/ccu_ddn.h:33:15: note: expanded from macro 'CCU_DDN_DEFINE'
> > 33 | .num_shift = __ffs(_num_mask), \
> > | ^~~~~~~~~~~~~~~~
> > 2 errors generated.
> >
> >
> > vim +241 drivers/clk/spacemit/ccu-k1.c
> >
> > 239
> > 240 CCU_GATE_DEFINE(slow_uart, CCU_PARENT_NAME(osc), MPMU_ACGR, BIT(1), CLK_IGNORE_UNUSED);
> > > 241 CCU_DDN_DEFINE(slow_uart1_14p74, pll1_d16_153p6, MPMU_SUCCR, GENMASK(28, 16), GENMASK(12, 0), 0);
> > 242 CCU_DDN_DEFINE(slow_uart2_48, pll1_d4_614p4, MPMU_SUCCR_1, GENMASK(28, 16), GENMASK(12, 0), 0);
> > 243
> >
>
--
Yixun Lan (dlan)
Gentoo Linux Developer
GPG Key ID AABEFD55
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [spacemit:for-next 4/6] drivers/clk/spacemit/ccu-k1.c:241:1: error: initializer element is not a compile-time constant
2025-04-15 14:31 ` Yixun Lan
@ 2025-04-15 14:56 ` Haylen Chu
2025-04-15 15:16 ` Yixun Lan
2025-04-15 16:03 ` Alex Elder
1 sibling, 1 reply; 8+ messages in thread
From: Haylen Chu @ 2025-04-15 14:56 UTC (permalink / raw)
To: Yixun Lan, Alex Elder; +Cc: llvm, oe-kbuild-all, Inochi Amaoto
On Tue, Apr 15, 2025 at 02:31:37PM +0000, Yixun Lan wrote:
> Hi Alex,
>
> On 09:16 Tue 15 Apr , Alex Elder wrote:
> > On 4/15/25 8:44 AM, kernel test robot wrote:
> > > tree: https://github.com/spacemit-com/linux for-next
> > > head: 9ead3efbc88a21e9a1f38948cc0902518022a2e5
> > > commit: e2d238ba301f25a5c8a7d490a36f9cd014d7aecc [4/6] clk: spacemit: Add clock support for SpacemiT K1 SoC
> > > config: s390-allmodconfig (https://download.01.org/0day-ci/archive/20250415/202504152107.7ekGPIrF-lkp@intel.com/config)
> > > compiler: clang version 18.1.8 (https://github.com/llvm/llvm-project 3b5b5c1ec4a3095ab096dd780e84d7ab81f3d7ff)
> > > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250415/202504152107.7ekGPIrF-lkp@intel.com/reproduce)
> > >
> > > If you fix the issue in a separate patch/commit (i.e. not just a new version of
> > > the same patch/commit), kindly add following tags
> > > | Reported-by: kernel test robot <lkp@intel.com>
> > > | Closes: https://lore.kernel.org/oe-kbuild-all/202504152107.7ekGPIrF-lkp@intel.com/
> > >
> > > All errors (new ones prefixed by >>):
> >
> > If I'm interpreting this right, this seems to be a problem on
> > a S390 build (under COMPILE_TEST), because there is no constant
> > version of the __ffs() for that architecture. This might be the
> > case on other architectures as well.
> >
> > On RISC-V, this is fine.
> >
> > Any recommendations on how to address this?
> >
> it occur to me the __ffs() isn't really necessary, since all input
> is constant value (GENMASK here), we then should know the shift..
I'll second this: instead of calculating the LSB from bitmask in
compilation time, we could derive bitmask from LSB/MSB of the field:
taking slow_uart2_48 as example, this means changing current definition
to
CCU_DDN_DEFINE(slow_uart2_48, pll1_d4_614p4, MPMU_SUCCR_1,
28, 16, 12, 0, 0);
> >
> >
> > >
> > >>> drivers/clk/spacemit/ccu-k1.c:241:1: error: initializer element is not a compile-time constant
> > > 241 | CCU_DDN_DEFINE(slow_uart1_14p74, pll1_d16_153p6, MPMU_SUCCR, GENMASK(28, 16), GENMASK(12, 0), 0);
> > > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > > drivers/clk/spacemit/ccu_ddn.h:33:15: note: expanded from macro 'CCU_DDN_DEFINE'
> > > 33 | .num_shift = __ffs(_num_mask), \
> > > | ^~~~~~~~~~~~~~~~
> > > drivers/clk/spacemit/ccu-k1.c:242:1: error: initializer element is not a compile-time constant
> > > 242 | CCU_DDN_DEFINE(slow_uart2_48, pll1_d4_614p4, MPMU_SUCCR_1, GENMASK(28, 16), GENMASK(12, 0), 0);
> > > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > > drivers/clk/spacemit/ccu_ddn.h:33:15: note: expanded from macro 'CCU_DDN_DEFINE'
> > > 33 | .num_shift = __ffs(_num_mask), \
> > > | ^~~~~~~~~~~~~~~~
> > > 2 errors generated.
> > >
> > >
> > > vim +241 drivers/clk/spacemit/ccu-k1.c
> > >
> > > 239
> > > 240 CCU_GATE_DEFINE(slow_uart, CCU_PARENT_NAME(osc), MPMU_ACGR, BIT(1), CLK_IGNORE_UNUSED);
> > > > 241 CCU_DDN_DEFINE(slow_uart1_14p74, pll1_d16_153p6, MPMU_SUCCR, GENMASK(28, 16), GENMASK(12, 0), 0);
> > > 242 CCU_DDN_DEFINE(slow_uart2_48, pll1_d4_614p4, MPMU_SUCCR_1, GENMASK(28, 16), GENMASK(12, 0), 0);
> > > 243
> > >
> >
>
> --
> Yixun Lan (dlan)
> Gentoo Linux Developer
> GPG Key ID AABEFD55
Regards,
Haylen Chu
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [spacemit:for-next 4/6] drivers/clk/spacemit/ccu-k1.c:241:1: error: initializer element is not a compile-time constant
2025-04-15 14:56 ` Haylen Chu
@ 2025-04-15 15:16 ` Yixun Lan
0 siblings, 0 replies; 8+ messages in thread
From: Yixun Lan @ 2025-04-15 15:16 UTC (permalink / raw)
To: Haylen Chu; +Cc: Alex Elder, llvm, oe-kbuild-all, Inochi Amaoto
Hi Haylen,
On 14:56 Tue 15 Apr , Haylen Chu wrote:
> On Tue, Apr 15, 2025 at 02:31:37PM +0000, Yixun Lan wrote:
> > Hi Alex,
> >
> > On 09:16 Tue 15 Apr , Alex Elder wrote:
> > > On 4/15/25 8:44 AM, kernel test robot wrote:
> > > > tree: https://github.com/spacemit-com/linux for-next
> > > > head: 9ead3efbc88a21e9a1f38948cc0902518022a2e5
> > > > commit: e2d238ba301f25a5c8a7d490a36f9cd014d7aecc [4/6] clk: spacemit: Add clock support for SpacemiT K1 SoC
> > > > config: s390-allmodconfig (https://download.01.org/0day-ci/archive/20250415/202504152107.7ekGPIrF-lkp@intel.com/config)
> > > > compiler: clang version 18.1.8 (https://github.com/llvm/llvm-project 3b5b5c1ec4a3095ab096dd780e84d7ab81f3d7ff)
> > > > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250415/202504152107.7ekGPIrF-lkp@intel.com/reproduce)
> > > >
> > > > If you fix the issue in a separate patch/commit (i.e. not just a new version of
> > > > the same patch/commit), kindly add following tags
> > > > | Reported-by: kernel test robot <lkp@intel.com>
> > > > | Closes: https://lore.kernel.org/oe-kbuild-all/202504152107.7ekGPIrF-lkp@intel.com/
> > > >
> > > > All errors (new ones prefixed by >>):
> > >
> > > If I'm interpreting this right, this seems to be a problem on
> > > a S390 build (under COMPILE_TEST), because there is no constant
> > > version of the __ffs() for that architecture. This might be the
> > > case on other architectures as well.
> > >
> > > On RISC-V, this is fine.
> > >
> > > Any recommendations on how to address this?
> > >
> > it occur to me the __ffs() isn't really necessary, since all input
> > is constant value (GENMASK here), we then should know the shift..
>
> I'll second this: instead of calculating the LSB from bitmask in
> compilation time, we could derive bitmask from LSB/MSB of the field:
> taking slow_uart2_48 as example, this means changing current definition
> to
>
> CCU_DDN_DEFINE(slow_uart2_48, pll1_d4_614p4, MPMU_SUCCR_1,
> 28, 16, 12, 0, 0);
>
Looks good, can you re-spin a new v8 version (plus collecting all review tags),
As I'd like to have a clean patch set (normally we should only send a new incremental fix),
but this time I'd like to put few more efforts to re-do this series, thanks
> > >
> > >
> > > >
> > > >>> drivers/clk/spacemit/ccu-k1.c:241:1: error: initializer element is not a compile-time constant
> > > > 241 | CCU_DDN_DEFINE(slow_uart1_14p74, pll1_d16_153p6, MPMU_SUCCR, GENMASK(28, 16), GENMASK(12, 0), 0);
> > > > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > > > drivers/clk/spacemit/ccu_ddn.h:33:15: note: expanded from macro 'CCU_DDN_DEFINE'
> > > > 33 | .num_shift = __ffs(_num_mask), \
> > > > | ^~~~~~~~~~~~~~~~
> > > > drivers/clk/spacemit/ccu-k1.c:242:1: error: initializer element is not a compile-time constant
> > > > 242 | CCU_DDN_DEFINE(slow_uart2_48, pll1_d4_614p4, MPMU_SUCCR_1, GENMASK(28, 16), GENMASK(12, 0), 0);
> > > > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > > > drivers/clk/spacemit/ccu_ddn.h:33:15: note: expanded from macro 'CCU_DDN_DEFINE'
> > > > 33 | .num_shift = __ffs(_num_mask), \
> > > > | ^~~~~~~~~~~~~~~~
> > > > 2 errors generated.
> > > >
> > > >
> > > > vim +241 drivers/clk/spacemit/ccu-k1.c
> > > >
> > > > 239
> > > > 240 CCU_GATE_DEFINE(slow_uart, CCU_PARENT_NAME(osc), MPMU_ACGR, BIT(1), CLK_IGNORE_UNUSED);
> > > > > 241 CCU_DDN_DEFINE(slow_uart1_14p74, pll1_d16_153p6, MPMU_SUCCR, GENMASK(28, 16), GENMASK(12, 0), 0);
> > > > 242 CCU_DDN_DEFINE(slow_uart2_48, pll1_d4_614p4, MPMU_SUCCR_1, GENMASK(28, 16), GENMASK(12, 0), 0);
> > > > 243
> > > >
> > >
> >
> > --
> > Yixun Lan (dlan)
> > Gentoo Linux Developer
> > GPG Key ID AABEFD55
>
> Regards,
> Haylen Chu
--
Yixun Lan (dlan)
Gentoo Linux Developer
GPG Key ID AABEFD55
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [spacemit:for-next 4/6] drivers/clk/spacemit/ccu-k1.c:241:1: error: initializer element is not a compile-time constant
2025-04-15 14:31 ` Yixun Lan
2025-04-15 14:56 ` Haylen Chu
@ 2025-04-15 16:03 ` Alex Elder
2025-04-16 12:11 ` Haylen Chu
1 sibling, 1 reply; 8+ messages in thread
From: Alex Elder @ 2025-04-15 16:03 UTC (permalink / raw)
To: Yixun Lan; +Cc: Haylen Chu, llvm, oe-kbuild-all, Inochi Amaoto
On 4/15/25 9:31 AM, Yixun Lan wrote:
> Hi Alex,
>
> On 09:16 Tue 15 Apr , Alex Elder wrote:
>> On 4/15/25 8:44 AM, kernel test robot wrote:
>>> tree: https://github.com/spacemit-com/linux for-next
>>> head: 9ead3efbc88a21e9a1f38948cc0902518022a2e5
>>> commit: e2d238ba301f25a5c8a7d490a36f9cd014d7aecc [4/6] clk: spacemit: Add clock support for SpacemiT K1 SoC
>>> config: s390-allmodconfig (https://download.01.org/0day-ci/archive/20250415/202504152107.7ekGPIrF-lkp@intel.com/config)
>>> compiler: clang version 18.1.8 (https://github.com/llvm/llvm-project 3b5b5c1ec4a3095ab096dd780e84d7ab81f3d7ff)
>>> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250415/202504152107.7ekGPIrF-lkp@intel.com/reproduce)
>>>
>>> If you fix the issue in a separate patch/commit (i.e. not just a new version of
>>> the same patch/commit), kindly add following tags
>>> | Reported-by: kernel test robot <lkp@intel.com>
>>> | Closes: https://lore.kernel.org/oe-kbuild-all/202504152107.7ekGPIrF-lkp@intel.com/
>>>
>>> All errors (new ones prefixed by >>):
>>
>> If I'm interpreting this right, this seems to be a problem on
>> a S390 build (under COMPILE_TEST), because there is no constant
>> version of the __ffs() for that architecture. This might be the
>> case on other architectures as well.
>>
>> On RISC-V, this is fine.
>>
>> Any recommendations on how to address this?
>>
> it occur to me the __ffs() isn't really necessary, since all input
> is constant value (GENMASK here), we then should know the shift..
I asked Haylen to make this change. Yes, we know the
shift, but I much prefer specifying only a constant mask
(which implies both the shift and the width) rather than
a constant mask and shift (or width and shift).
If there's no way to avoid this S390 compile error, then
adding the separate (and redundant) shift value back
into all these definitions is a solution.
-Alex
>
>>
>>
>>>
>>>>> drivers/clk/spacemit/ccu-k1.c:241:1: error: initializer element is not a compile-time constant
>>> 241 | CCU_DDN_DEFINE(slow_uart1_14p74, pll1_d16_153p6, MPMU_SUCCR, GENMASK(28, 16), GENMASK(12, 0), 0);
>>> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>> drivers/clk/spacemit/ccu_ddn.h:33:15: note: expanded from macro 'CCU_DDN_DEFINE'
>>> 33 | .num_shift = __ffs(_num_mask), \
>>> | ^~~~~~~~~~~~~~~~
>>> drivers/clk/spacemit/ccu-k1.c:242:1: error: initializer element is not a compile-time constant
>>> 242 | CCU_DDN_DEFINE(slow_uart2_48, pll1_d4_614p4, MPMU_SUCCR_1, GENMASK(28, 16), GENMASK(12, 0), 0);
>>> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>> drivers/clk/spacemit/ccu_ddn.h:33:15: note: expanded from macro 'CCU_DDN_DEFINE'
>>> 33 | .num_shift = __ffs(_num_mask), \
>>> | ^~~~~~~~~~~~~~~~
>>> 2 errors generated.
>>>
>>>
>>> vim +241 drivers/clk/spacemit/ccu-k1.c
>>>
>>> 239
>>> 240 CCU_GATE_DEFINE(slow_uart, CCU_PARENT_NAME(osc), MPMU_ACGR, BIT(1), CLK_IGNORE_UNUSED);
>>> > 241 CCU_DDN_DEFINE(slow_uart1_14p74, pll1_d16_153p6, MPMU_SUCCR, GENMASK(28, 16), GENMASK(12, 0), 0);
>>> 242 CCU_DDN_DEFINE(slow_uart2_48, pll1_d4_614p4, MPMU_SUCCR_1, GENMASK(28, 16), GENMASK(12, 0), 0);
>>> 243
>>>
>>
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [spacemit:for-next 4/6] drivers/clk/spacemit/ccu-k1.c:241:1: error: initializer element is not a compile-time constant
2025-04-15 16:03 ` Alex Elder
@ 2025-04-16 12:11 ` Haylen Chu
2025-04-16 12:20 ` Alex Elder
0 siblings, 1 reply; 8+ messages in thread
From: Haylen Chu @ 2025-04-16 12:11 UTC (permalink / raw)
To: Alex Elder, Yixun Lan; +Cc: llvm, oe-kbuild-all, Inochi Amaoto
On Tue, Apr 15, 2025 at 11:03:12AM -0500, Alex Elder wrote:
> On 4/15/25 9:31 AM, Yixun Lan wrote:
> > Hi Alex,
> >
> > On 09:16 Tue 15 Apr , Alex Elder wrote:
> > > On 4/15/25 8:44 AM, kernel test robot wrote:
> > > > tree: https://github.com/spacemit-com/linux for-next
> > > > head: 9ead3efbc88a21e9a1f38948cc0902518022a2e5
> > > > commit: e2d238ba301f25a5c8a7d490a36f9cd014d7aecc [4/6] clk: spacemit: Add clock support for SpacemiT K1 SoC
> > > > config: s390-allmodconfig (https://download.01.org/0day-ci/archive/20250415/202504152107.7ekGPIrF-lkp@intel.com/config)
> > > > compiler: clang version 18.1.8 (https://github.com/llvm/llvm-project 3b5b5c1ec4a3095ab096dd780e84d7ab81f3d7ff)
> > > > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250415/202504152107.7ekGPIrF-lkp@intel.com/reproduce)
> > > >
> > > > If you fix the issue in a separate patch/commit (i.e. not just a new version of
> > > > the same patch/commit), kindly add following tags
> > > > | Reported-by: kernel test robot <lkp@intel.com>
> > > > | Closes: https://lore.kernel.org/oe-kbuild-all/202504152107.7ekGPIrF-lkp@intel.com/
> > > >
> > > > All errors (new ones prefixed by >>):
> > >
> > > If I'm interpreting this right, this seems to be a problem on
> > > a S390 build (under COMPILE_TEST), because there is no constant
> > > version of the __ffs() for that architecture. This might be the
> > > case on other architectures as well.
> > >
> > > On RISC-V, this is fine.
> > >
> > > Any recommendations on how to address this?
> > >
> > it occur to me the __ffs() isn't really necessary, since all input
> > is constant value (GENMASK here), we then should know the shift..
>
> I asked Haylen to make this change. Yes, we know the
> shift, but I much prefer specifying only a constant mask
> (which implies both the shift and the width) rather than
> a constant mask and shift (or width and shift).
>
> If there's no way to avoid this S390 compile error, then
> adding the separate (and redundant) shift value back
> into all these definitions is a solution.
We could avoid the redundancy by specifying only width and shift and
move the call to GENMASK() into the macro, see my previous reply. To me
it doesn't look very different, it's just about where to invoke
GENMASK().
> -Alex
Thanks,
Haylen Chu
>
> >
> > >
> > >
> > > >
> > > > > > drivers/clk/spacemit/ccu-k1.c:241:1: error: initializer element is not a compile-time constant
> > > > 241 | CCU_DDN_DEFINE(slow_uart1_14p74, pll1_d16_153p6, MPMU_SUCCR, GENMASK(28, 16), GENMASK(12, 0), 0);
> > > > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > > > drivers/clk/spacemit/ccu_ddn.h:33:15: note: expanded from macro 'CCU_DDN_DEFINE'
> > > > 33 | .num_shift = __ffs(_num_mask), \
> > > > | ^~~~~~~~~~~~~~~~
> > > > drivers/clk/spacemit/ccu-k1.c:242:1: error: initializer element is not a compile-time constant
> > > > 242 | CCU_DDN_DEFINE(slow_uart2_48, pll1_d4_614p4, MPMU_SUCCR_1, GENMASK(28, 16), GENMASK(12, 0), 0);
> > > > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > > > drivers/clk/spacemit/ccu_ddn.h:33:15: note: expanded from macro 'CCU_DDN_DEFINE'
> > > > 33 | .num_shift = __ffs(_num_mask), \
> > > > | ^~~~~~~~~~~~~~~~
> > > > 2 errors generated.
> > > >
> > > >
> > > > vim +241 drivers/clk/spacemit/ccu-k1.c
> > > >
> > > > 239
> > > > 240 CCU_GATE_DEFINE(slow_uart, CCU_PARENT_NAME(osc), MPMU_ACGR, BIT(1), CLK_IGNORE_UNUSED);
> > > > > 241 CCU_DDN_DEFINE(slow_uart1_14p74, pll1_d16_153p6, MPMU_SUCCR, GENMASK(28, 16), GENMASK(12, 0), 0);
> > > > 242 CCU_DDN_DEFINE(slow_uart2_48, pll1_d4_614p4, MPMU_SUCCR_1, GENMASK(28, 16), GENMASK(12, 0), 0);
> > > > 243
> > > >
> > >
> >
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [spacemit:for-next 4/6] drivers/clk/spacemit/ccu-k1.c:241:1: error: initializer element is not a compile-time constant
2025-04-16 12:11 ` Haylen Chu
@ 2025-04-16 12:20 ` Alex Elder
0 siblings, 0 replies; 8+ messages in thread
From: Alex Elder @ 2025-04-16 12:20 UTC (permalink / raw)
To: Haylen Chu, Yixun Lan; +Cc: llvm, oe-kbuild-all, Inochi Amaoto
On 4/16/25 7:11 AM, Haylen Chu wrote:
> On Tue, Apr 15, 2025 at 11:03:12AM -0500, Alex Elder wrote:
>> On 4/15/25 9:31 AM, Yixun Lan wrote:
>>> Hi Alex,
>>>
>>> On 09:16 Tue 15 Apr , Alex Elder wrote:
>>>> On 4/15/25 8:44 AM, kernel test robot wrote:
>>>>> tree: https://github.com/spacemit-com/linux for-next
>>>>> head: 9ead3efbc88a21e9a1f38948cc0902518022a2e5
>>>>> commit: e2d238ba301f25a5c8a7d490a36f9cd014d7aecc [4/6] clk: spacemit: Add clock support for SpacemiT K1 SoC
>>>>> config: s390-allmodconfig (https://download.01.org/0day-ci/archive/20250415/202504152107.7ekGPIrF-lkp@intel.com/config)
>>>>> compiler: clang version 18.1.8 (https://github.com/llvm/llvm-project 3b5b5c1ec4a3095ab096dd780e84d7ab81f3d7ff)
>>>>> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250415/202504152107.7ekGPIrF-lkp@intel.com/reproduce)
>>>>>
>>>>> If you fix the issue in a separate patch/commit (i.e. not just a new version of
>>>>> the same patch/commit), kindly add following tags
>>>>> | Reported-by: kernel test robot <lkp@intel.com>
>>>>> | Closes: https://lore.kernel.org/oe-kbuild-all/202504152107.7ekGPIrF-lkp@intel.com/
>>>>>
>>>>> All errors (new ones prefixed by >>):
>>>>
>>>> If I'm interpreting this right, this seems to be a problem on
>>>> a S390 build (under COMPILE_TEST), because there is no constant
>>>> version of the __ffs() for that architecture. This might be the
>>>> case on other architectures as well.
>>>>
>>>> On RISC-V, this is fine.
>>>>
>>>> Any recommendations on how to address this?
>>>>
>>> it occur to me the __ffs() isn't really necessary, since all input
>>> is constant value (GENMASK here), we then should know the shift..
>>
>> I asked Haylen to make this change. Yes, we know the
>> shift, but I much prefer specifying only a constant mask
>> (which implies both the shift and the width) rather than
>> a constant mask and shift (or width and shift).
>>
>> If there's no way to avoid this S390 compile error, then
>> adding the separate (and redundant) shift value back
>> into all these definitions is a solution.
>
> We could avoid the redundancy by specifying only width and shift and
> move the call to GENMASK() into the macro, see my previous reply. To me
> it doesn't look very different, it's just about where to invoke
> GENMASK().
Do what you like to fix it. What you suggest is fine with me.
-Alex
>> -Alex
>
> Thanks,
> Haylen Chu
>
>>
>>>
>>>>
>>>>
>>>>>
>>>>>>> drivers/clk/spacemit/ccu-k1.c:241:1: error: initializer element is not a compile-time constant
>>>>> 241 | CCU_DDN_DEFINE(slow_uart1_14p74, pll1_d16_153p6, MPMU_SUCCR, GENMASK(28, 16), GENMASK(12, 0), 0);
>>>>> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>>>> drivers/clk/spacemit/ccu_ddn.h:33:15: note: expanded from macro 'CCU_DDN_DEFINE'
>>>>> 33 | .num_shift = __ffs(_num_mask), \
>>>>> | ^~~~~~~~~~~~~~~~
>>>>> drivers/clk/spacemit/ccu-k1.c:242:1: error: initializer element is not a compile-time constant
>>>>> 242 | CCU_DDN_DEFINE(slow_uart2_48, pll1_d4_614p4, MPMU_SUCCR_1, GENMASK(28, 16), GENMASK(12, 0), 0);
>>>>> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>>>> drivers/clk/spacemit/ccu_ddn.h:33:15: note: expanded from macro 'CCU_DDN_DEFINE'
>>>>> 33 | .num_shift = __ffs(_num_mask), \
>>>>> | ^~~~~~~~~~~~~~~~
>>>>> 2 errors generated.
>>>>>
>>>>>
>>>>> vim +241 drivers/clk/spacemit/ccu-k1.c
>>>>>
>>>>> 239
>>>>> 240 CCU_GATE_DEFINE(slow_uart, CCU_PARENT_NAME(osc), MPMU_ACGR, BIT(1), CLK_IGNORE_UNUSED);
>>>>> > 241 CCU_DDN_DEFINE(slow_uart1_14p74, pll1_d16_153p6, MPMU_SUCCR, GENMASK(28, 16), GENMASK(12, 0), 0);
>>>>> 242 CCU_DDN_DEFINE(slow_uart2_48, pll1_d4_614p4, MPMU_SUCCR_1, GENMASK(28, 16), GENMASK(12, 0), 0);
>>>>> 243
>>>>>
>>>>
>>>
>>
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2025-04-16 12:20 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-15 13:44 [spacemit:for-next 4/6] drivers/clk/spacemit/ccu-k1.c:241:1: error: initializer element is not a compile-time constant kernel test robot
2025-04-15 14:16 ` Alex Elder
2025-04-15 14:31 ` Yixun Lan
2025-04-15 14:56 ` Haylen Chu
2025-04-15 15:16 ` Yixun Lan
2025-04-15 16:03 ` Alex Elder
2025-04-16 12:11 ` Haylen Chu
2025-04-16 12:20 ` Alex Elder
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox