Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
* [linux-next:master 9185/10024] drivers/pmdomain/mediatek/airoha-cpu-pmdomain.c:59:2: error: write to reserved register 'R7'
@ 2025-01-20 10:32 kernel test robot
  2025-01-20 10:36 ` Christian Marangi (Ansuel)
  0 siblings, 1 reply; 17+ messages in thread
From: kernel test robot @ 2025-01-20 10:32 UTC (permalink / raw)
  To: Christian Marangi; +Cc: llvm, oe-kbuild-all, Ulf Hansson

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   1573c8d4cb206a2d1454ff711e79f8df2353290b
commit: 82e703dd438b71432cc0ccbb90925d1e32dd014a [9185/10024] pmdomain: airoha: Add Airoha CPU PM Domain support
config: arm-randconfig-001-20250120 (https://download.01.org/0day-ci/archive/20250120/202501201840.XmpHXpQ4-lkp@intel.com/config)
compiler: clang version 20.0.0git (https://github.com/llvm/llvm-project c23f2417dc5f6dc371afb07af5627ec2a9d373a0)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250120/202501201840.XmpHXpQ4-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/202501201840.XmpHXpQ4-lkp@intel.com/

All errors (new ones prefixed by >>):

>> drivers/pmdomain/mediatek/airoha-cpu-pmdomain.c:59:2: error: write to reserved register 'R7'
      59 |         arm_smccc_1_1_invoke(AIROHA_SIP_AVS_HANDLE, AIROHA_AVS_OP_FREQ_DYN_ADJ,
         |         ^
   include/linux/arm-smccc.h:632:4: note: expanded from macro 'arm_smccc_1_1_invoke'
     632 |                         arm_smccc_1_1_smc(__VA_ARGS__);                 \
         |                         ^
   include/linux/arm-smccc.h:575:48: note: expanded from macro 'arm_smccc_1_1_smc'
     575 | #define arm_smccc_1_1_smc(...)  __arm_smccc_1_1(SMCCC_SMC_INST, __VA_ARGS__)
         |                                                 ^
   include/linux/arm-smccc.h:477:24: note: expanded from macro 'SMCCC_SMC_INST'
     477 | #define SMCCC_SMC_INST  __SMC(0)
         |                         ^
   note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
   arch/arm/include/asm/opcodes.h:215:2: note: expanded from macro '__inst_arm_thumb32'
     215 |         __inst_thumb32(thumb_opcode)
         |         ^
   arch/arm/include/asm/opcodes.h:205:27: note: expanded from macro '__inst_thumb32'
     205 | #define __inst_thumb32(x) ___inst_thumb32(                              \
         |                           ^
   arch/arm/include/asm/opcodes.h:230:2: note: expanded from macro '___inst_thumb32'
     230 |         ".short " __stringify(first) ", " __stringify(second) "\n\t"
         |         ^
>> drivers/pmdomain/mediatek/airoha-cpu-pmdomain.c:59:2: error: write to reserved register 'R7'
   include/linux/arm-smccc.h:629:4: note: expanded from macro 'arm_smccc_1_1_invoke'
     629 |                         arm_smccc_1_1_hvc(__VA_ARGS__);                 \
         |                         ^
   include/linux/arm-smccc.h:591:48: note: expanded from macro 'arm_smccc_1_1_hvc'
     591 | #define arm_smccc_1_1_hvc(...)  __arm_smccc_1_1(SMCCC_HVC_INST, __VA_ARGS__)
         |                                                 ^
   include/linux/arm-smccc.h:478:24: note: expanded from macro 'SMCCC_HVC_INST'
     478 | #define SMCCC_HVC_INST  __HVC(0)
         |                         ^
   note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
   arch/arm/include/asm/opcodes.h:215:2: note: expanded from macro '__inst_arm_thumb32'
     215 |         __inst_thumb32(thumb_opcode)
         |         ^
   arch/arm/include/asm/opcodes.h:205:27: note: expanded from macro '__inst_thumb32'
     205 | #define __inst_thumb32(x) ___inst_thumb32(                              \
         |                           ^
   arch/arm/include/asm/opcodes.h:230:2: note: expanded from macro '___inst_thumb32'
     230 |         ".short " __stringify(first) ", " __stringify(second) "\n\t"
         |         ^
>> drivers/pmdomain/mediatek/airoha-cpu-pmdomain.c:59:2: error: write to reserved register 'R7'
   include/linux/arm-smccc.h:635:4: note: expanded from macro 'arm_smccc_1_1_invoke'
     635 |                         __fail_smccc_1_1(__VA_ARGS__);                  \
         |                         ^
   include/linux/arm-smccc.h:602:8: note: expanded from macro '__fail_smccc_1_1'
     602 |                 asm ("" :                                               \
         |                      ^
   drivers/pmdomain/mediatek/airoha-cpu-pmdomain.c:35:2: error: write to reserved register 'R7'
      35 |         arm_smccc_1_1_invoke(AIROHA_SIP_AVS_HANDLE, AIROHA_AVS_OP_GET_FREQ,
         |         ^
   include/linux/arm-smccc.h:632:4: note: expanded from macro 'arm_smccc_1_1_invoke'
     632 |                         arm_smccc_1_1_smc(__VA_ARGS__);                 \
         |                         ^
   include/linux/arm-smccc.h:575:48: note: expanded from macro 'arm_smccc_1_1_smc'
     575 | #define arm_smccc_1_1_smc(...)  __arm_smccc_1_1(SMCCC_SMC_INST, __VA_ARGS__)
         |                                                 ^
   include/linux/arm-smccc.h:477:24: note: expanded from macro 'SMCCC_SMC_INST'
     477 | #define SMCCC_SMC_INST  __SMC(0)
         |                         ^
   note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
   arch/arm/include/asm/opcodes.h:215:2: note: expanded from macro '__inst_arm_thumb32'
     215 |         __inst_thumb32(thumb_opcode)
         |         ^
   arch/arm/include/asm/opcodes.h:205:27: note: expanded from macro '__inst_thumb32'
     205 | #define __inst_thumb32(x) ___inst_thumb32(                              \
         |                           ^
   arch/arm/include/asm/opcodes.h:230:2: note: expanded from macro '___inst_thumb32'
     230 |         ".short " __stringify(first) ", " __stringify(second) "\n\t"
         |         ^
   drivers/pmdomain/mediatek/airoha-cpu-pmdomain.c:35:2: error: write to reserved register 'R7'
   include/linux/arm-smccc.h:629:4: note: expanded from macro 'arm_smccc_1_1_invoke'
     629 |                         arm_smccc_1_1_hvc(__VA_ARGS__);                 \
         |                         ^
   include/linux/arm-smccc.h:591:48: note: expanded from macro 'arm_smccc_1_1_hvc'
     591 | #define arm_smccc_1_1_hvc(...)  __arm_smccc_1_1(SMCCC_HVC_INST, __VA_ARGS__)
         |                                                 ^
   include/linux/arm-smccc.h:478:24: note: expanded from macro 'SMCCC_HVC_INST'
     478 | #define SMCCC_HVC_INST  __HVC(0)
         |                         ^
   note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
   arch/arm/include/asm/opcodes.h:215:2: note: expanded from macro '__inst_arm_thumb32'
     215 |         __inst_thumb32(thumb_opcode)
         |         ^
   arch/arm/include/asm/opcodes.h:205:27: note: expanded from macro '__inst_thumb32'
     205 | #define __inst_thumb32(x) ___inst_thumb32(                              \
         |                           ^
   arch/arm/include/asm/opcodes.h:230:2: note: expanded from macro '___inst_thumb32'
     230 |         ".short " __stringify(first) ", " __stringify(second) "\n\t"
         |         ^
   drivers/pmdomain/mediatek/airoha-cpu-pmdomain.c:35:2: error: write to reserved register 'R7'
   include/linux/arm-smccc.h:635:4: note: expanded from macro 'arm_smccc_1_1_invoke'
     635 |                         __fail_smccc_1_1(__VA_ARGS__);                  \
         |                         ^
   include/linux/arm-smccc.h:602:8: note: expanded from macro '__fail_smccc_1_1'
     602 |                 asm ("" :                                               \
         |                      ^
   6 errors generated.


vim +/R7 +59 drivers/pmdomain/mediatek/airoha-cpu-pmdomain.c

    53	
    54	static int airoha_cpu_pmdomain_set_performance_state(struct generic_pm_domain *domain,
    55							     unsigned int state)
    56	{
    57		struct arm_smccc_res res;
    58	
  > 59		arm_smccc_1_1_invoke(AIROHA_SIP_AVS_HANDLE, AIROHA_AVS_OP_FREQ_DYN_ADJ,
    60				     0, state, 0, 0, 0, 0, &res);
    61	
    62		/* SMC signal correct apply by unsetting BIT 0 */
    63		return res.a0 & BIT(0) ? -EINVAL : 0;
    64	}
    65	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

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

* Re: [linux-next:master 9185/10024] drivers/pmdomain/mediatek/airoha-cpu-pmdomain.c:59:2: error: write to reserved register 'R7'
  2025-01-20 10:32 [linux-next:master 9185/10024] drivers/pmdomain/mediatek/airoha-cpu-pmdomain.c:59:2: error: write to reserved register 'R7' kernel test robot
@ 2025-01-20 10:36 ` Christian Marangi (Ansuel)
  2025-01-20 13:01   ` Ulf Hansson
  0 siblings, 1 reply; 17+ messages in thread
From: Christian Marangi (Ansuel) @ 2025-01-20 10:36 UTC (permalink / raw)
  To: kernel test robot; +Cc: llvm, oe-kbuild-all, Ulf Hansson

Il giorno lun 20 gen 2025 alle ore 11:32 kernel test robot
<lkp@intel.com> ha scritto:
>
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> head:   1573c8d4cb206a2d1454ff711e79f8df2353290b
> commit: 82e703dd438b71432cc0ccbb90925d1e32dd014a [9185/10024] pmdomain: airoha: Add Airoha CPU PM Domain support
> config: arm-randconfig-001-20250120 (https://download.01.org/0day-ci/archive/20250120/202501201840.XmpHXpQ4-lkp@intel.com/config)
> compiler: clang version 20.0.0git (https://github.com/llvm/llvm-project c23f2417dc5f6dc371afb07af5627ec2a9d373a0)
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250120/202501201840.XmpHXpQ4-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/202501201840.XmpHXpQ4-lkp@intel.com/
>
> All errors (new ones prefixed by >>):
>
> >> drivers/pmdomain/mediatek/airoha-cpu-pmdomain.c:59:2: error: write to reserved register 'R7'
>       59 |         arm_smccc_1_1_invoke(AIROHA_SIP_AVS_HANDLE, AIROHA_AVS_OP_FREQ_DYN_ADJ,
>          |         ^
>    include/linux/arm-smccc.h:632:4: note: expanded from macro 'arm_smccc_1_1_invoke'
>      632 |                         arm_smccc_1_1_smc(__VA_ARGS__);                 \
>          |                         ^
>    include/linux/arm-smccc.h:575:48: note: expanded from macro 'arm_smccc_1_1_smc'
>      575 | #define arm_smccc_1_1_smc(...)  __arm_smccc_1_1(SMCCC_SMC_INST, __VA_ARGS__)
>          |                                                 ^
>    include/linux/arm-smccc.h:477:24: note: expanded from macro 'SMCCC_SMC_INST'
>      477 | #define SMCCC_SMC_INST  __SMC(0)
>          |                         ^
>    note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
>    arch/arm/include/asm/opcodes.h:215:2: note: expanded from macro '__inst_arm_thumb32'
>      215 |         __inst_thumb32(thumb_opcode)
>          |         ^
>    arch/arm/include/asm/opcodes.h:205:27: note: expanded from macro '__inst_thumb32'
>      205 | #define __inst_thumb32(x) ___inst_thumb32(                              \
>          |                           ^
>    arch/arm/include/asm/opcodes.h:230:2: note: expanded from macro '___inst_thumb32'
>      230 |         ".short " __stringify(first) ", " __stringify(second) "\n\t"
>          |         ^
> >> drivers/pmdomain/mediatek/airoha-cpu-pmdomain.c:59:2: error: write to reserved register 'R7'
>    include/linux/arm-smccc.h:629:4: note: expanded from macro 'arm_smccc_1_1_invoke'
>      629 |                         arm_smccc_1_1_hvc(__VA_ARGS__);                 \
>          |                         ^
>    include/linux/arm-smccc.h:591:48: note: expanded from macro 'arm_smccc_1_1_hvc'
>      591 | #define arm_smccc_1_1_hvc(...)  __arm_smccc_1_1(SMCCC_HVC_INST, __VA_ARGS__)
>          |                                                 ^
>    include/linux/arm-smccc.h:478:24: note: expanded from macro 'SMCCC_HVC_INST'
>      478 | #define SMCCC_HVC_INST  __HVC(0)
>          |                         ^
>    note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
>    arch/arm/include/asm/opcodes.h:215:2: note: expanded from macro '__inst_arm_thumb32'
>      215 |         __inst_thumb32(thumb_opcode)
>          |         ^
>    arch/arm/include/asm/opcodes.h:205:27: note: expanded from macro '__inst_thumb32'
>      205 | #define __inst_thumb32(x) ___inst_thumb32(                              \
>          |                           ^
>    arch/arm/include/asm/opcodes.h:230:2: note: expanded from macro '___inst_thumb32'
>      230 |         ".short " __stringify(first) ", " __stringify(second) "\n\t"
>          |         ^
> >> drivers/pmdomain/mediatek/airoha-cpu-pmdomain.c:59:2: error: write to reserved register 'R7'
>    include/linux/arm-smccc.h:635:4: note: expanded from macro 'arm_smccc_1_1_invoke'
>      635 |                         __fail_smccc_1_1(__VA_ARGS__);                  \
>          |                         ^
>    include/linux/arm-smccc.h:602:8: note: expanded from macro '__fail_smccc_1_1'
>      602 |                 asm ("" :                                               \
>          |                      ^
>    drivers/pmdomain/mediatek/airoha-cpu-pmdomain.c:35:2: error: write to reserved register 'R7'
>       35 |         arm_smccc_1_1_invoke(AIROHA_SIP_AVS_HANDLE, AIROHA_AVS_OP_GET_FREQ,
>          |         ^
>    include/linux/arm-smccc.h:632:4: note: expanded from macro 'arm_smccc_1_1_invoke'
>      632 |                         arm_smccc_1_1_smc(__VA_ARGS__);                 \
>          |                         ^
>    include/linux/arm-smccc.h:575:48: note: expanded from macro 'arm_smccc_1_1_smc'
>      575 | #define arm_smccc_1_1_smc(...)  __arm_smccc_1_1(SMCCC_SMC_INST, __VA_ARGS__)
>          |                                                 ^
>    include/linux/arm-smccc.h:477:24: note: expanded from macro 'SMCCC_SMC_INST'
>      477 | #define SMCCC_SMC_INST  __SMC(0)
>          |                         ^
>    note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
>    arch/arm/include/asm/opcodes.h:215:2: note: expanded from macro '__inst_arm_thumb32'
>      215 |         __inst_thumb32(thumb_opcode)
>          |         ^
>    arch/arm/include/asm/opcodes.h:205:27: note: expanded from macro '__inst_thumb32'
>      205 | #define __inst_thumb32(x) ___inst_thumb32(                              \
>          |                           ^
>    arch/arm/include/asm/opcodes.h:230:2: note: expanded from macro '___inst_thumb32'
>      230 |         ".short " __stringify(first) ", " __stringify(second) "\n\t"
>          |         ^
>    drivers/pmdomain/mediatek/airoha-cpu-pmdomain.c:35:2: error: write to reserved register 'R7'
>    include/linux/arm-smccc.h:629:4: note: expanded from macro 'arm_smccc_1_1_invoke'
>      629 |                         arm_smccc_1_1_hvc(__VA_ARGS__);                 \
>          |                         ^
>    include/linux/arm-smccc.h:591:48: note: expanded from macro 'arm_smccc_1_1_hvc'
>      591 | #define arm_smccc_1_1_hvc(...)  __arm_smccc_1_1(SMCCC_HVC_INST, __VA_ARGS__)
>          |                                                 ^
>    include/linux/arm-smccc.h:478:24: note: expanded from macro 'SMCCC_HVC_INST'
>      478 | #define SMCCC_HVC_INST  __HVC(0)
>          |                         ^
>    note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
>    arch/arm/include/asm/opcodes.h:215:2: note: expanded from macro '__inst_arm_thumb32'
>      215 |         __inst_thumb32(thumb_opcode)
>          |         ^
>    arch/arm/include/asm/opcodes.h:205:27: note: expanded from macro '__inst_thumb32'
>      205 | #define __inst_thumb32(x) ___inst_thumb32(                              \
>          |                           ^
>    arch/arm/include/asm/opcodes.h:230:2: note: expanded from macro '___inst_thumb32'
>      230 |         ".short " __stringify(first) ", " __stringify(second) "\n\t"
>          |         ^
>    drivers/pmdomain/mediatek/airoha-cpu-pmdomain.c:35:2: error: write to reserved register 'R7'
>    include/linux/arm-smccc.h:635:4: note: expanded from macro 'arm_smccc_1_1_invoke'
>      635 |                         __fail_smccc_1_1(__VA_ARGS__);                  \
>          |                         ^
>    include/linux/arm-smccc.h:602:8: note: expanded from macro '__fail_smccc_1_1'
>      602 |                 asm ("" :                                               \
>          |                      ^
>    6 errors generated.
>
>
> vim +/R7 +59 drivers/pmdomain/mediatek/airoha-cpu-pmdomain.c
>
>     53
>     54  static int airoha_cpu_pmdomain_set_performance_state(struct generic_pm_domain *domain,
>     55                                                       unsigned int state)
>     56  {
>     57          struct arm_smccc_res res;
>     58
>   > 59          arm_smccc_1_1_invoke(AIROHA_SIP_AVS_HANDLE, AIROHA_AVS_OP_FREQ_DYN_ADJ,
>     60                               0, state, 0, 0, 0, 0, &res);
>     61
>     62          /* SMC signal correct apply by unsetting BIT 0 */
>     63          return res.a0 & BIT(0) ? -EINVAL : 0;
>     64  }
>     65
>
> --
> 0-DAY CI Kernel Test Service
> https://github.com/intel/lkp-tests/wiki

Mhhhh.... Any idea how to fix this? Maybe we have to exclude some flags?
Error is "error: write to reserved register 'R7'" and I guess it's very specific
to some kind of ARM ERRATA.

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

* Re: [linux-next:master 9185/10024] drivers/pmdomain/mediatek/airoha-cpu-pmdomain.c:59:2: error: write to reserved register 'R7'
  2025-01-20 10:36 ` Christian Marangi (Ansuel)
@ 2025-01-20 13:01   ` Ulf Hansson
  2025-01-20 13:34     ` Sudeep Holla
  0 siblings, 1 reply; 17+ messages in thread
From: Ulf Hansson @ 2025-01-20 13:01 UTC (permalink / raw)
  To: Christian Marangi (Ansuel), Sudeep Holla
  Cc: kernel test robot, llvm, oe-kbuild-all

+ Sudeep,

On Mon, 20 Jan 2025 at 11:37, Christian Marangi (Ansuel)
<ansuelsmth@gmail.com> wrote:
>
> Il giorno lun 20 gen 2025 alle ore 11:32 kernel test robot
> <lkp@intel.com> ha scritto:
> >
> > tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> > head:   1573c8d4cb206a2d1454ff711e79f8df2353290b
> > commit: 82e703dd438b71432cc0ccbb90925d1e32dd014a [9185/10024] pmdomain: airoha: Add Airoha CPU PM Domain support
> > config: arm-randconfig-001-20250120 (https://download.01.org/0day-ci/archive/20250120/202501201840.XmpHXpQ4-lkp@intel.com/config)
> > compiler: clang version 20.0.0git (https://github.com/llvm/llvm-project c23f2417dc5f6dc371afb07af5627ec2a9d373a0)
> > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250120/202501201840.XmpHXpQ4-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/202501201840.XmpHXpQ4-lkp@intel.com/
> >
> > All errors (new ones prefixed by >>):
> >
> > >> drivers/pmdomain/mediatek/airoha-cpu-pmdomain.c:59:2: error: write to reserved register 'R7'
> >       59 |         arm_smccc_1_1_invoke(AIROHA_SIP_AVS_HANDLE, AIROHA_AVS_OP_FREQ_DYN_ADJ,
> >          |         ^
> >    include/linux/arm-smccc.h:632:4: note: expanded from macro 'arm_smccc_1_1_invoke'
> >      632 |                         arm_smccc_1_1_smc(__VA_ARGS__);                 \
> >          |                         ^
> >    include/linux/arm-smccc.h:575:48: note: expanded from macro 'arm_smccc_1_1_smc'
> >      575 | #define arm_smccc_1_1_smc(...)  __arm_smccc_1_1(SMCCC_SMC_INST, __VA_ARGS__)
> >          |                                                 ^
> >    include/linux/arm-smccc.h:477:24: note: expanded from macro 'SMCCC_SMC_INST'
> >      477 | #define SMCCC_SMC_INST  __SMC(0)
> >          |                         ^
> >    note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
> >    arch/arm/include/asm/opcodes.h:215:2: note: expanded from macro '__inst_arm_thumb32'
> >      215 |         __inst_thumb32(thumb_opcode)
> >          |         ^
> >    arch/arm/include/asm/opcodes.h:205:27: note: expanded from macro '__inst_thumb32'
> >      205 | #define __inst_thumb32(x) ___inst_thumb32(                              \
> >          |                           ^
> >    arch/arm/include/asm/opcodes.h:230:2: note: expanded from macro '___inst_thumb32'
> >      230 |         ".short " __stringify(first) ", " __stringify(second) "\n\t"
> >          |         ^
> > >> drivers/pmdomain/mediatek/airoha-cpu-pmdomain.c:59:2: error: write to reserved register 'R7'
> >    include/linux/arm-smccc.h:629:4: note: expanded from macro 'arm_smccc_1_1_invoke'
> >      629 |                         arm_smccc_1_1_hvc(__VA_ARGS__);                 \
> >          |                         ^
> >    include/linux/arm-smccc.h:591:48: note: expanded from macro 'arm_smccc_1_1_hvc'
> >      591 | #define arm_smccc_1_1_hvc(...)  __arm_smccc_1_1(SMCCC_HVC_INST, __VA_ARGS__)
> >          |                                                 ^
> >    include/linux/arm-smccc.h:478:24: note: expanded from macro 'SMCCC_HVC_INST'
> >      478 | #define SMCCC_HVC_INST  __HVC(0)
> >          |                         ^
> >    note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
> >    arch/arm/include/asm/opcodes.h:215:2: note: expanded from macro '__inst_arm_thumb32'
> >      215 |         __inst_thumb32(thumb_opcode)
> >          |         ^
> >    arch/arm/include/asm/opcodes.h:205:27: note: expanded from macro '__inst_thumb32'
> >      205 | #define __inst_thumb32(x) ___inst_thumb32(                              \
> >          |                           ^
> >    arch/arm/include/asm/opcodes.h:230:2: note: expanded from macro '___inst_thumb32'
> >      230 |         ".short " __stringify(first) ", " __stringify(second) "\n\t"
> >          |         ^
> > >> drivers/pmdomain/mediatek/airoha-cpu-pmdomain.c:59:2: error: write to reserved register 'R7'
> >    include/linux/arm-smccc.h:635:4: note: expanded from macro 'arm_smccc_1_1_invoke'
> >      635 |                         __fail_smccc_1_1(__VA_ARGS__);                  \
> >          |                         ^
> >    include/linux/arm-smccc.h:602:8: note: expanded from macro '__fail_smccc_1_1'
> >      602 |                 asm ("" :                                               \
> >          |                      ^
> >    drivers/pmdomain/mediatek/airoha-cpu-pmdomain.c:35:2: error: write to reserved register 'R7'
> >       35 |         arm_smccc_1_1_invoke(AIROHA_SIP_AVS_HANDLE, AIROHA_AVS_OP_GET_FREQ,
> >          |         ^
> >    include/linux/arm-smccc.h:632:4: note: expanded from macro 'arm_smccc_1_1_invoke'
> >      632 |                         arm_smccc_1_1_smc(__VA_ARGS__);                 \
> >          |                         ^
> >    include/linux/arm-smccc.h:575:48: note: expanded from macro 'arm_smccc_1_1_smc'
> >      575 | #define arm_smccc_1_1_smc(...)  __arm_smccc_1_1(SMCCC_SMC_INST, __VA_ARGS__)
> >          |                                                 ^
> >    include/linux/arm-smccc.h:477:24: note: expanded from macro 'SMCCC_SMC_INST'
> >      477 | #define SMCCC_SMC_INST  __SMC(0)
> >          |                         ^
> >    note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
> >    arch/arm/include/asm/opcodes.h:215:2: note: expanded from macro '__inst_arm_thumb32'
> >      215 |         __inst_thumb32(thumb_opcode)
> >          |         ^
> >    arch/arm/include/asm/opcodes.h:205:27: note: expanded from macro '__inst_thumb32'
> >      205 | #define __inst_thumb32(x) ___inst_thumb32(                              \
> >          |                           ^
> >    arch/arm/include/asm/opcodes.h:230:2: note: expanded from macro '___inst_thumb32'
> >      230 |         ".short " __stringify(first) ", " __stringify(second) "\n\t"
> >          |         ^
> >    drivers/pmdomain/mediatek/airoha-cpu-pmdomain.c:35:2: error: write to reserved register 'R7'
> >    include/linux/arm-smccc.h:629:4: note: expanded from macro 'arm_smccc_1_1_invoke'
> >      629 |                         arm_smccc_1_1_hvc(__VA_ARGS__);                 \
> >          |                         ^
> >    include/linux/arm-smccc.h:591:48: note: expanded from macro 'arm_smccc_1_1_hvc'
> >      591 | #define arm_smccc_1_1_hvc(...)  __arm_smccc_1_1(SMCCC_HVC_INST, __VA_ARGS__)
> >          |                                                 ^
> >    include/linux/arm-smccc.h:478:24: note: expanded from macro 'SMCCC_HVC_INST'
> >      478 | #define SMCCC_HVC_INST  __HVC(0)
> >          |                         ^
> >    note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
> >    arch/arm/include/asm/opcodes.h:215:2: note: expanded from macro '__inst_arm_thumb32'
> >      215 |         __inst_thumb32(thumb_opcode)
> >          |         ^
> >    arch/arm/include/asm/opcodes.h:205:27: note: expanded from macro '__inst_thumb32'
> >      205 | #define __inst_thumb32(x) ___inst_thumb32(                              \
> >          |                           ^
> >    arch/arm/include/asm/opcodes.h:230:2: note: expanded from macro '___inst_thumb32'
> >      230 |         ".short " __stringify(first) ", " __stringify(second) "\n\t"
> >          |         ^
> >    drivers/pmdomain/mediatek/airoha-cpu-pmdomain.c:35:2: error: write to reserved register 'R7'
> >    include/linux/arm-smccc.h:635:4: note: expanded from macro 'arm_smccc_1_1_invoke'
> >      635 |                         __fail_smccc_1_1(__VA_ARGS__);                  \
> >          |                         ^
> >    include/linux/arm-smccc.h:602:8: note: expanded from macro '__fail_smccc_1_1'
> >      602 |                 asm ("" :                                               \
> >          |                      ^
> >    6 errors generated.
> >
> >
> > vim +/R7 +59 drivers/pmdomain/mediatek/airoha-cpu-pmdomain.c
> >
> >     53
> >     54  static int airoha_cpu_pmdomain_set_performance_state(struct generic_pm_domain *domain,
> >     55                                                       unsigned int state)
> >     56  {
> >     57          struct arm_smccc_res res;
> >     58
> >   > 59          arm_smccc_1_1_invoke(AIROHA_SIP_AVS_HANDLE, AIROHA_AVS_OP_FREQ_DYN_ADJ,
> >     60                               0, state, 0, 0, 0, 0, &res);
> >     61
> >     62          /* SMC signal correct apply by unsetting BIT 0 */
> >     63          return res.a0 & BIT(0) ? -EINVAL : 0;
> >     64  }
> >     65
> >
> > --
> > 0-DAY CI Kernel Test Service
> > https://github.com/intel/lkp-tests/wiki
>
> Mhhhh.... Any idea how to fix this? Maybe we have to exclude some flags?
> Error is "error: write to reserved register 'R7'" and I guess it's very specific
> to some kind of ARM ERRATA.

I don't know to be honest. The arm-scmi transport driver
(drivers/firmware/arm_scmi/transports/smc.c) is having similar calls
with 9 parameters to arm_smccc_1_1_invoke(). Not sure why it's a
problem here and not there?

Anyway, do you need all the parameters? Perhaps try to drop some?

That said, I am keeping the offending patch as is and expecting to get
a fix as soon as possible.

Kind regards
Uffe

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

* Re: [linux-next:master 9185/10024] drivers/pmdomain/mediatek/airoha-cpu-pmdomain.c:59:2: error: write to reserved register 'R7'
  2025-01-20 13:01   ` Ulf Hansson
@ 2025-01-20 13:34     ` Sudeep Holla
  2025-01-20 13:37       ` Christian Marangi (Ansuel)
  0 siblings, 1 reply; 17+ messages in thread
From: Sudeep Holla @ 2025-01-20 13:34 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: Christian Marangi (Ansuel), kernel test robot, llvm, Sudeep Holla,
	oe-kbuild-all

On Mon, Jan 20, 2025 at 02:01:30PM +0100, Ulf Hansson wrote:
> + Sudeep,
> 
> On Mon, 20 Jan 2025 at 11:37, Christian Marangi (Ansuel)
> <ansuelsmth@gmail.com> wrote:
> >
> > Il giorno lun 20 gen 2025 alle ore 11:32 kernel test robot
> > <lkp@intel.com> ha scritto:
> > >
> > > tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> > > head:   1573c8d4cb206a2d1454ff711e79f8df2353290b
> > > commit: 82e703dd438b71432cc0ccbb90925d1e32dd014a [9185/10024] pmdomain: airoha: Add Airoha CPU PM Domain support
> > > config: arm-randconfig-001-20250120 (https://download.01.org/0day-ci/archive/20250120/202501201840.XmpHXpQ4-lkp@intel.com/config)
> > > compiler: clang version 20.0.0git (https://github.com/llvm/llvm-project c23f2417dc5f6dc371afb07af5627ec2a9d373a0)
> > > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250120/202501201840.XmpHXpQ4-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/202501201840.XmpHXpQ4-lkp@intel.com/
> > >
> > > All errors (new ones prefixed by >>):
> > >
> > > >> drivers/pmdomain/mediatek/airoha-cpu-pmdomain.c:59:2: error: write to reserved register 'R7'
> > >       59 |         arm_smccc_1_1_invoke(AIROHA_SIP_AVS_HANDLE, AIROHA_AVS_OP_FREQ_DYN_ADJ,
> > >          |         ^
> > >    include/linux/arm-smccc.h:632:4: note: expanded from macro 'arm_smccc_1_1_invoke'
> > >      632 |                         arm_smccc_1_1_smc(__VA_ARGS__);                 \
> > >          |                         ^
> > >    include/linux/arm-smccc.h:575:48: note: expanded from macro 'arm_smccc_1_1_smc'
> > >      575 | #define arm_smccc_1_1_smc(...)  __arm_smccc_1_1(SMCCC_SMC_INST, __VA_ARGS__)
> > >          |                                                 ^
> > >    include/linux/arm-smccc.h:477:24: note: expanded from macro 'SMCCC_SMC_INST'
> > >      477 | #define SMCCC_SMC_INST  __SMC(0)
> > >          |                         ^
> > >    note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
> > >    arch/arm/include/asm/opcodes.h:215:2: note: expanded from macro '__inst_arm_thumb32'
> > >      215 |         __inst_thumb32(thumb_opcode)
> > >          |         ^
> > >    arch/arm/include/asm/opcodes.h:205:27: note: expanded from macro '__inst_thumb32'
> > >      205 | #define __inst_thumb32(x) ___inst_thumb32(                              \
> > >          |                           ^
> > >    arch/arm/include/asm/opcodes.h:230:2: note: expanded from macro '___inst_thumb32'
> > >      230 |         ".short " __stringify(first) ", " __stringify(second) "\n\t"
> > >          |         ^
> > > >> drivers/pmdomain/mediatek/airoha-cpu-pmdomain.c:59:2: error: write to reserved register 'R7'
> > >    include/linux/arm-smccc.h:629:4: note: expanded from macro 'arm_smccc_1_1_invoke'
> > >      629 |                         arm_smccc_1_1_hvc(__VA_ARGS__);                 \
> > >          |                         ^
> > >    include/linux/arm-smccc.h:591:48: note: expanded from macro 'arm_smccc_1_1_hvc'
> > >      591 | #define arm_smccc_1_1_hvc(...)  __arm_smccc_1_1(SMCCC_HVC_INST, __VA_ARGS__)
> > >          |                                                 ^
> > >    include/linux/arm-smccc.h:478:24: note: expanded from macro 'SMCCC_HVC_INST'
> > >      478 | #define SMCCC_HVC_INST  __HVC(0)
> > >          |                         ^
> > >    note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
> > >    arch/arm/include/asm/opcodes.h:215:2: note: expanded from macro '__inst_arm_thumb32'
> > >      215 |         __inst_thumb32(thumb_opcode)
> > >          |         ^
> > >    arch/arm/include/asm/opcodes.h:205:27: note: expanded from macro '__inst_thumb32'
> > >      205 | #define __inst_thumb32(x) ___inst_thumb32(                              \
> > >          |                           ^
> > >    arch/arm/include/asm/opcodes.h:230:2: note: expanded from macro '___inst_thumb32'
> > >      230 |         ".short " __stringify(first) ", " __stringify(second) "\n\t"
> > >          |         ^
> > > >> drivers/pmdomain/mediatek/airoha-cpu-pmdomain.c:59:2: error: write to reserved register 'R7'
> > >    include/linux/arm-smccc.h:635:4: note: expanded from macro 'arm_smccc_1_1_invoke'
> > >      635 |                         __fail_smccc_1_1(__VA_ARGS__);                  \
> > >          |                         ^
> > >    include/linux/arm-smccc.h:602:8: note: expanded from macro '__fail_smccc_1_1'
> > >      602 |                 asm ("" :                                               \
> > >          |                      ^
> > >    drivers/pmdomain/mediatek/airoha-cpu-pmdomain.c:35:2: error: write to reserved register 'R7'
> > >       35 |         arm_smccc_1_1_invoke(AIROHA_SIP_AVS_HANDLE, AIROHA_AVS_OP_GET_FREQ,
> > >          |         ^
> > >    include/linux/arm-smccc.h:632:4: note: expanded from macro 'arm_smccc_1_1_invoke'
> > >      632 |                         arm_smccc_1_1_smc(__VA_ARGS__);                 \
> > >          |                         ^
> > >    include/linux/arm-smccc.h:575:48: note: expanded from macro 'arm_smccc_1_1_smc'
> > >      575 | #define arm_smccc_1_1_smc(...)  __arm_smccc_1_1(SMCCC_SMC_INST, __VA_ARGS__)
> > >          |                                                 ^
> > >    include/linux/arm-smccc.h:477:24: note: expanded from macro 'SMCCC_SMC_INST'
> > >      477 | #define SMCCC_SMC_INST  __SMC(0)
> > >          |                         ^
> > >    note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
> > >    arch/arm/include/asm/opcodes.h:215:2: note: expanded from macro '__inst_arm_thumb32'
> > >      215 |         __inst_thumb32(thumb_opcode)
> > >          |         ^
> > >    arch/arm/include/asm/opcodes.h:205:27: note: expanded from macro '__inst_thumb32'
> > >      205 | #define __inst_thumb32(x) ___inst_thumb32(                              \
> > >          |                           ^
> > >    arch/arm/include/asm/opcodes.h:230:2: note: expanded from macro '___inst_thumb32'
> > >      230 |         ".short " __stringify(first) ", " __stringify(second) "\n\t"
> > >          |         ^
> > >    drivers/pmdomain/mediatek/airoha-cpu-pmdomain.c:35:2: error: write to reserved register 'R7'
> > >    include/linux/arm-smccc.h:629:4: note: expanded from macro 'arm_smccc_1_1_invoke'
> > >      629 |                         arm_smccc_1_1_hvc(__VA_ARGS__);                 \
> > >          |                         ^
> > >    include/linux/arm-smccc.h:591:48: note: expanded from macro 'arm_smccc_1_1_hvc'
> > >      591 | #define arm_smccc_1_1_hvc(...)  __arm_smccc_1_1(SMCCC_HVC_INST, __VA_ARGS__)
> > >          |                                                 ^
> > >    include/linux/arm-smccc.h:478:24: note: expanded from macro 'SMCCC_HVC_INST'
> > >      478 | #define SMCCC_HVC_INST  __HVC(0)
> > >          |                         ^
> > >    note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
> > >    arch/arm/include/asm/opcodes.h:215:2: note: expanded from macro '__inst_arm_thumb32'
> > >      215 |         __inst_thumb32(thumb_opcode)
> > >          |         ^
> > >    arch/arm/include/asm/opcodes.h:205:27: note: expanded from macro '__inst_thumb32'
> > >      205 | #define __inst_thumb32(x) ___inst_thumb32(                              \
> > >          |                           ^
> > >    arch/arm/include/asm/opcodes.h:230:2: note: expanded from macro '___inst_thumb32'
> > >      230 |         ".short " __stringify(first) ", " __stringify(second) "\n\t"
> > >          |         ^
> > >    drivers/pmdomain/mediatek/airoha-cpu-pmdomain.c:35:2: error: write to reserved register 'R7'
> > >    include/linux/arm-smccc.h:635:4: note: expanded from macro 'arm_smccc_1_1_invoke'
> > >      635 |                         __fail_smccc_1_1(__VA_ARGS__);                  \
> > >          |                         ^
> > >    include/linux/arm-smccc.h:602:8: note: expanded from macro '__fail_smccc_1_1'
> > >      602 |                 asm ("" :                                               \
> > >          |                      ^
> > >    6 errors generated.
> > >
> > >
> > > vim +/R7 +59 drivers/pmdomain/mediatek/airoha-cpu-pmdomain.c
> > >
> > >     53
> > >     54  static int airoha_cpu_pmdomain_set_performance_state(struct generic_pm_domain *domain,
> > >     55                                                       unsigned int state)
> > >     56  {
> > >     57          struct arm_smccc_res res;
> > >     58
> > >   > 59          arm_smccc_1_1_invoke(AIROHA_SIP_AVS_HANDLE, AIROHA_AVS_OP_FREQ_DYN_ADJ,
> > >     60                               0, state, 0, 0, 0, 0, &res);
> > >     61
> > >     62          /* SMC signal correct apply by unsetting BIT 0 */
> > >     63          return res.a0 & BIT(0) ? -EINVAL : 0;
> > >     64  }
> > >     65
> > >
> > > --
> > > 0-DAY CI Kernel Test Service
> > > https://github.com/intel/lkp-tests/wiki
> >
> > Mhhhh.... Any idea how to fix this? Maybe we have to exclude some flags?
> > Error is "error: write to reserved register 'R7'" and I guess it's very specific
> > to some kind of ARM ERRATA.
> 
> I don't know to be honest. The arm-scmi transport driver
> (drivers/firmware/arm_scmi/transports/smc.c) is having similar calls
> with 9 parameters to arm_smccc_1_1_invoke(). Not sure why it's a
> problem here and not there?
>

I think it is known issue and must be solved with the below patch if my
understanding is right.

> Anyway, do you need all the parameters? Perhaps try to drop some?
>

I don't think we need to do that.

> That said, I am keeping the offending patch as is and expecting to get
> a fix as soon as possible.
>

Let me know if the patch helps.

Regards,
Sudeep

--->8

diff --git i/drivers/pmdomain/mediatek/Makefile w/drivers/pmdomain/mediatek/Makefile
index 0f6edce9239b..7e7016f9526e 100644
--- i/drivers/pmdomain/mediatek/Makefile
+++ w/drivers/pmdomain/mediatek/Makefile
@@ -2,3 +2,9 @@
 obj-$(CONFIG_MTK_SCPSYS)               += mtk-scpsys.o
 obj-$(CONFIG_MTK_SCPSYS_PM_DOMAINS)    += mtk-pm-domains.o
 obj-$(CONFIG_AIROHA_CPU_PM_DOMAIN)     += airoha-cpu-pmdomain.o
+ifeq ($(CONFIG_THUMB2_KERNEL)$(CONFIG_CC_IS_CLANG),yy)
+# The use of R7 in the SMCCC conflicts with the compiler's use of R7 as a frame
+# pointer in Thumb2 mode, which is forcibly enabled by Clang when profiling
+# hooks are inserted via the -pg switch.
+CFLAGS_REMOVE_airoha-cpu-pmdomain.o += $(CC_FLAGS_FTRACE)
+endif


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

* Re: [linux-next:master 9185/10024] drivers/pmdomain/mediatek/airoha-cpu-pmdomain.c:59:2: error: write to reserved register 'R7'
  2025-01-20 13:34     ` Sudeep Holla
@ 2025-01-20 13:37       ` Christian Marangi (Ansuel)
  2025-01-20 13:44         ` Sudeep Holla
  0 siblings, 1 reply; 17+ messages in thread
From: Christian Marangi (Ansuel) @ 2025-01-20 13:37 UTC (permalink / raw)
  To: Sudeep Holla; +Cc: Ulf Hansson, kernel test robot, llvm, oe-kbuild-all

Il giorno lun 20 gen 2025 alle ore 14:34 Sudeep Holla
<sudeep.holla@arm.com> ha scritto:
>
> On Mon, Jan 20, 2025 at 02:01:30PM +0100, Ulf Hansson wrote:
> > + Sudeep,
> >
> > On Mon, 20 Jan 2025 at 11:37, Christian Marangi (Ansuel)
> > <ansuelsmth@gmail.com> wrote:
> > >
> > > Il giorno lun 20 gen 2025 alle ore 11:32 kernel test robot
> > > <lkp@intel.com> ha scritto:
> > > >
> > > > tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> > > > head:   1573c8d4cb206a2d1454ff711e79f8df2353290b
> > > > commit: 82e703dd438b71432cc0ccbb90925d1e32dd014a [9185/10024] pmdomain: airoha: Add Airoha CPU PM Domain support
> > > > config: arm-randconfig-001-20250120 (https://download.01.org/0day-ci/archive/20250120/202501201840.XmpHXpQ4-lkp@intel.com/config)
> > > > compiler: clang version 20.0.0git (https://github.com/llvm/llvm-project c23f2417dc5f6dc371afb07af5627ec2a9d373a0)
> > > > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250120/202501201840.XmpHXpQ4-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/202501201840.XmpHXpQ4-lkp@intel.com/
> > > >
> > > > All errors (new ones prefixed by >>):
> > > >
> > > > >> drivers/pmdomain/mediatek/airoha-cpu-pmdomain.c:59:2: error: write to reserved register 'R7'
> > > >       59 |         arm_smccc_1_1_invoke(AIROHA_SIP_AVS_HANDLE, AIROHA_AVS_OP_FREQ_DYN_ADJ,
> > > >          |         ^
> > > >    include/linux/arm-smccc.h:632:4: note: expanded from macro 'arm_smccc_1_1_invoke'
> > > >      632 |                         arm_smccc_1_1_smc(__VA_ARGS__);                 \
> > > >          |                         ^
> > > >    include/linux/arm-smccc.h:575:48: note: expanded from macro 'arm_smccc_1_1_smc'
> > > >      575 | #define arm_smccc_1_1_smc(...)  __arm_smccc_1_1(SMCCC_SMC_INST, __VA_ARGS__)
> > > >          |                                                 ^
> > > >    include/linux/arm-smccc.h:477:24: note: expanded from macro 'SMCCC_SMC_INST'
> > > >      477 | #define SMCCC_SMC_INST  __SMC(0)
> > > >          |                         ^
> > > >    note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
> > > >    arch/arm/include/asm/opcodes.h:215:2: note: expanded from macro '__inst_arm_thumb32'
> > > >      215 |         __inst_thumb32(thumb_opcode)
> > > >          |         ^
> > > >    arch/arm/include/asm/opcodes.h:205:27: note: expanded from macro '__inst_thumb32'
> > > >      205 | #define __inst_thumb32(x) ___inst_thumb32(                              \
> > > >          |                           ^
> > > >    arch/arm/include/asm/opcodes.h:230:2: note: expanded from macro '___inst_thumb32'
> > > >      230 |         ".short " __stringify(first) ", " __stringify(second) "\n\t"
> > > >          |         ^
> > > > >> drivers/pmdomain/mediatek/airoha-cpu-pmdomain.c:59:2: error: write to reserved register 'R7'
> > > >    include/linux/arm-smccc.h:629:4: note: expanded from macro 'arm_smccc_1_1_invoke'
> > > >      629 |                         arm_smccc_1_1_hvc(__VA_ARGS__);                 \
> > > >          |                         ^
> > > >    include/linux/arm-smccc.h:591:48: note: expanded from macro 'arm_smccc_1_1_hvc'
> > > >      591 | #define arm_smccc_1_1_hvc(...)  __arm_smccc_1_1(SMCCC_HVC_INST, __VA_ARGS__)
> > > >          |                                                 ^
> > > >    include/linux/arm-smccc.h:478:24: note: expanded from macro 'SMCCC_HVC_INST'
> > > >      478 | #define SMCCC_HVC_INST  __HVC(0)
> > > >          |                         ^
> > > >    note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
> > > >    arch/arm/include/asm/opcodes.h:215:2: note: expanded from macro '__inst_arm_thumb32'
> > > >      215 |         __inst_thumb32(thumb_opcode)
> > > >          |         ^
> > > >    arch/arm/include/asm/opcodes.h:205:27: note: expanded from macro '__inst_thumb32'
> > > >      205 | #define __inst_thumb32(x) ___inst_thumb32(                              \
> > > >          |                           ^
> > > >    arch/arm/include/asm/opcodes.h:230:2: note: expanded from macro '___inst_thumb32'
> > > >      230 |         ".short " __stringify(first) ", " __stringify(second) "\n\t"
> > > >          |         ^
> > > > >> drivers/pmdomain/mediatek/airoha-cpu-pmdomain.c:59:2: error: write to reserved register 'R7'
> > > >    include/linux/arm-smccc.h:635:4: note: expanded from macro 'arm_smccc_1_1_invoke'
> > > >      635 |                         __fail_smccc_1_1(__VA_ARGS__);                  \
> > > >          |                         ^
> > > >    include/linux/arm-smccc.h:602:8: note: expanded from macro '__fail_smccc_1_1'
> > > >      602 |                 asm ("" :                                               \
> > > >          |                      ^
> > > >    drivers/pmdomain/mediatek/airoha-cpu-pmdomain.c:35:2: error: write to reserved register 'R7'
> > > >       35 |         arm_smccc_1_1_invoke(AIROHA_SIP_AVS_HANDLE, AIROHA_AVS_OP_GET_FREQ,
> > > >          |         ^
> > > >    include/linux/arm-smccc.h:632:4: note: expanded from macro 'arm_smccc_1_1_invoke'
> > > >      632 |                         arm_smccc_1_1_smc(__VA_ARGS__);                 \
> > > >          |                         ^
> > > >    include/linux/arm-smccc.h:575:48: note: expanded from macro 'arm_smccc_1_1_smc'
> > > >      575 | #define arm_smccc_1_1_smc(...)  __arm_smccc_1_1(SMCCC_SMC_INST, __VA_ARGS__)
> > > >          |                                                 ^
> > > >    include/linux/arm-smccc.h:477:24: note: expanded from macro 'SMCCC_SMC_INST'
> > > >      477 | #define SMCCC_SMC_INST  __SMC(0)
> > > >          |                         ^
> > > >    note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
> > > >    arch/arm/include/asm/opcodes.h:215:2: note: expanded from macro '__inst_arm_thumb32'
> > > >      215 |         __inst_thumb32(thumb_opcode)
> > > >          |         ^
> > > >    arch/arm/include/asm/opcodes.h:205:27: note: expanded from macro '__inst_thumb32'
> > > >      205 | #define __inst_thumb32(x) ___inst_thumb32(                              \
> > > >          |                           ^
> > > >    arch/arm/include/asm/opcodes.h:230:2: note: expanded from macro '___inst_thumb32'
> > > >      230 |         ".short " __stringify(first) ", " __stringify(second) "\n\t"
> > > >          |         ^
> > > >    drivers/pmdomain/mediatek/airoha-cpu-pmdomain.c:35:2: error: write to reserved register 'R7'
> > > >    include/linux/arm-smccc.h:629:4: note: expanded from macro 'arm_smccc_1_1_invoke'
> > > >      629 |                         arm_smccc_1_1_hvc(__VA_ARGS__);                 \
> > > >          |                         ^
> > > >    include/linux/arm-smccc.h:591:48: note: expanded from macro 'arm_smccc_1_1_hvc'
> > > >      591 | #define arm_smccc_1_1_hvc(...)  __arm_smccc_1_1(SMCCC_HVC_INST, __VA_ARGS__)
> > > >          |                                                 ^
> > > >    include/linux/arm-smccc.h:478:24: note: expanded from macro 'SMCCC_HVC_INST'
> > > >      478 | #define SMCCC_HVC_INST  __HVC(0)
> > > >          |                         ^
> > > >    note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
> > > >    arch/arm/include/asm/opcodes.h:215:2: note: expanded from macro '__inst_arm_thumb32'
> > > >      215 |         __inst_thumb32(thumb_opcode)
> > > >          |         ^
> > > >    arch/arm/include/asm/opcodes.h:205:27: note: expanded from macro '__inst_thumb32'
> > > >      205 | #define __inst_thumb32(x) ___inst_thumb32(                              \
> > > >          |                           ^
> > > >    arch/arm/include/asm/opcodes.h:230:2: note: expanded from macro '___inst_thumb32'
> > > >      230 |         ".short " __stringify(first) ", " __stringify(second) "\n\t"
> > > >          |         ^
> > > >    drivers/pmdomain/mediatek/airoha-cpu-pmdomain.c:35:2: error: write to reserved register 'R7'
> > > >    include/linux/arm-smccc.h:635:4: note: expanded from macro 'arm_smccc_1_1_invoke'
> > > >      635 |                         __fail_smccc_1_1(__VA_ARGS__);                  \
> > > >          |                         ^
> > > >    include/linux/arm-smccc.h:602:8: note: expanded from macro '__fail_smccc_1_1'
> > > >      602 |                 asm ("" :                                               \
> > > >          |                      ^
> > > >    6 errors generated.
> > > >
> > > >
> > > > vim +/R7 +59 drivers/pmdomain/mediatek/airoha-cpu-pmdomain.c
> > > >
> > > >     53
> > > >     54  static int airoha_cpu_pmdomain_set_performance_state(struct generic_pm_domain *domain,
> > > >     55                                                       unsigned int state)
> > > >     56  {
> > > >     57          struct arm_smccc_res res;
> > > >     58
> > > >   > 59          arm_smccc_1_1_invoke(AIROHA_SIP_AVS_HANDLE, AIROHA_AVS_OP_FREQ_DYN_ADJ,
> > > >     60                               0, state, 0, 0, 0, 0, &res);
> > > >     61
> > > >     62          /* SMC signal correct apply by unsetting BIT 0 */
> > > >     63          return res.a0 & BIT(0) ? -EINVAL : 0;
> > > >     64  }
> > > >     65
> > > >
> > > > --
> > > > 0-DAY CI Kernel Test Service
> > > > https://github.com/intel/lkp-tests/wiki
> > >
> > > Mhhhh.... Any idea how to fix this? Maybe we have to exclude some flags?
> > > Error is "error: write to reserved register 'R7'" and I guess it's very specific
> > > to some kind of ARM ERRATA.
> >
> > I don't know to be honest. The arm-scmi transport driver
> > (drivers/firmware/arm_scmi/transports/smc.c) is having similar calls
> > with 9 parameters to arm_smccc_1_1_invoke(). Not sure why it's a
> > problem here and not there?
> >
>
> I think it is known issue and must be solved with the below patch if my
> understanding is right.
>

If it's a known issue and affects also other use of smcc why we need
specific fix in the driver makefile instead of a more generic one.

Do you have a link for the known issue?

> > Anyway, do you need all the parameters? Perhaps try to drop some?
> >
>
> I don't think we need to do that.
>

No we don't but the macro require to define all of them...

> > That said, I am keeping the offending patch as is and expecting to get
> > a fix as soon as possible.
> >
>
> Let me know if the patch helps.
>

I will test!

> Regards,
> Sudeep
>
> --->8
>
> diff --git i/drivers/pmdomain/mediatek/Makefile w/drivers/pmdomain/mediatek/Makefile
> index 0f6edce9239b..7e7016f9526e 100644
> --- i/drivers/pmdomain/mediatek/Makefile
> +++ w/drivers/pmdomain/mediatek/Makefile
> @@ -2,3 +2,9 @@
>  obj-$(CONFIG_MTK_SCPSYS)               += mtk-scpsys.o
>  obj-$(CONFIG_MTK_SCPSYS_PM_DOMAINS)    += mtk-pm-domains.o
>  obj-$(CONFIG_AIROHA_CPU_PM_DOMAIN)     += airoha-cpu-pmdomain.o
> +ifeq ($(CONFIG_THUMB2_KERNEL)$(CONFIG_CC_IS_CLANG),yy)
> +# The use of R7 in the SMCCC conflicts with the compiler's use of R7 as a frame
> +# pointer in Thumb2 mode, which is forcibly enabled by Clang when profiling
> +# hooks are inserted via the -pg switch.
> +CFLAGS_REMOVE_airoha-cpu-pmdomain.o += $(CC_FLAGS_FTRACE)
> +endif
>

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

* Re: [linux-next:master 9185/10024] drivers/pmdomain/mediatek/airoha-cpu-pmdomain.c:59:2: error: write to reserved register 'R7'
  2025-01-20 13:37       ` Christian Marangi (Ansuel)
@ 2025-01-20 13:44         ` Sudeep Holla
  2025-01-20 14:52           ` Christian Marangi (Ansuel)
  0 siblings, 1 reply; 17+ messages in thread
From: Sudeep Holla @ 2025-01-20 13:44 UTC (permalink / raw)
  To: Christian Marangi (Ansuel)
  Cc: Ulf Hansson, kernel test robot, Sudeep Holla, llvm, oe-kbuild-all

On Mon, Jan 20, 2025 at 02:37:19PM +0100, Christian Marangi (Ansuel) wrote:
> Il giorno lun 20 gen 2025 alle ore 14:34 Sudeep Holla
> <sudeep.holla@arm.com> ha scritto:
> >
> > On Mon, Jan 20, 2025 at 02:01:30PM +0100, Ulf Hansson wrote:
> > > + Sudeep,
> > >
> > > On Mon, 20 Jan 2025 at 11:37, Christian Marangi (Ansuel)
> > > <ansuelsmth@gmail.com> wrote:

[...]

> > > >
> > > > Mhhhh.... Any idea how to fix this? Maybe we have to exclude some flags?
> > > > Error is "error: write to reserved register 'R7'" and I guess it's very specific
> > > > to some kind of ARM ERRATA.
> > >
> > > I don't know to be honest. The arm-scmi transport driver
> > > (drivers/firmware/arm_scmi/transports/smc.c) is having similar calls
> > > with 9 parameters to arm_smccc_1_1_invoke(). Not sure why it's a
> > > problem here and not there?
> > >
> >
> > I think it is known issue and must be solved with the below patch if my
> > understanding is right.
> >
> 
> If it's a known issue and affects also other use of smcc why we need
> specific fix in the driver makefile instead of a more generic one.
>

IIUC, arm_smccc_1_1_invoke() is a macro which can be used anywhere.
There are reasons why we can't move it to a module and export it.

> Do you have a link for the known issue?
>

Nothing handy, but quick google search gave me this:
https://bugs.llvm.org/show_bug.cgi?id=45826

--
Regards,
Sudeep

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

* Re: [linux-next:master 9185/10024] drivers/pmdomain/mediatek/airoha-cpu-pmdomain.c:59:2: error: write to reserved register 'R7'
  2025-01-20 13:44         ` Sudeep Holla
@ 2025-01-20 14:52           ` Christian Marangi (Ansuel)
  2025-01-20 15:05             ` Sudeep Holla
  2025-01-20 17:28             ` Nathan Chancellor
  0 siblings, 2 replies; 17+ messages in thread
From: Christian Marangi (Ansuel) @ 2025-01-20 14:52 UTC (permalink / raw)
  To: Sudeep Holla; +Cc: Ulf Hansson, kernel test robot, llvm, oe-kbuild-all

Il giorno lun 20 gen 2025 alle ore 14:44 Sudeep Holla
<sudeep.holla@arm.com> ha scritto:
>
> On Mon, Jan 20, 2025 at 02:37:19PM +0100, Christian Marangi (Ansuel) wrote:
> > Il giorno lun 20 gen 2025 alle ore 14:34 Sudeep Holla
> > <sudeep.holla@arm.com> ha scritto:
> > >
> > > On Mon, Jan 20, 2025 at 02:01:30PM +0100, Ulf Hansson wrote:
> > > > + Sudeep,
> > > >
> > > > On Mon, 20 Jan 2025 at 11:37, Christian Marangi (Ansuel)
> > > > <ansuelsmth@gmail.com> wrote:
>
> [...]
>
> > > > >
> > > > > Mhhhh.... Any idea how to fix this? Maybe we have to exclude some flags?
> > > > > Error is "error: write to reserved register 'R7'" and I guess it's very specific
> > > > > to some kind of ARM ERRATA.
> > > >
> > > > I don't know to be honest. The arm-scmi transport driver
> > > > (drivers/firmware/arm_scmi/transports/smc.c) is having similar calls
> > > > with 9 parameters to arm_smccc_1_1_invoke(). Not sure why it's a
> > > > problem here and not there?
> > > >
> > >
> > > I think it is known issue and must be solved with the below patch if my
> > > understanding is right.
> > >
> >
> > If it's a known issue and affects also other use of smcc why we need
> > specific fix in the driver makefile instead of a more generic one.
> >
>
> IIUC, arm_smccc_1_1_invoke() is a macro which can be used anywhere.
> There are reasons why we can't move it to a module and export it.
>
> > Do you have a link for the known issue?
> >
>
> Nothing handy, but quick google search gave me this:
> https://bugs.llvm.org/show_bug.cgi?id=45826
>

If only these test report were easy to report instead of me having to build
the massive llvm-20 dev version...

Any hint if anyone knows if precompiled cross tool are present around the web
(with llvm-20?)

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

* Re: [linux-next:master 9185/10024] drivers/pmdomain/mediatek/airoha-cpu-pmdomain.c:59:2: error: write to reserved register 'R7'
  2025-01-20 14:52           ` Christian Marangi (Ansuel)
@ 2025-01-20 15:05             ` Sudeep Holla
  2025-01-20 15:20               ` Christian Marangi (Ansuel)
  2025-01-20 17:28             ` Nathan Chancellor
  1 sibling, 1 reply; 17+ messages in thread
From: Sudeep Holla @ 2025-01-20 15:05 UTC (permalink / raw)
  To: Christian Marangi (Ansuel)
  Cc: Ulf Hansson, kernel test robot, Sudeep Holla, llvm, oe-kbuild-all

On Mon, Jan 20, 2025 at 03:52:09PM +0100, Christian Marangi (Ansuel) wrote:
> Il giorno lun 20 gen 2025 alle ore 14:44 Sudeep Holla
> <sudeep.holla@arm.com> ha scritto:
> >
> > On Mon, Jan 20, 2025 at 02:37:19PM +0100, Christian Marangi (Ansuel) wrote:
> > > Il giorno lun 20 gen 2025 alle ore 14:34 Sudeep Holla
> > > <sudeep.holla@arm.com> ha scritto:
> > > >
> > > > On Mon, Jan 20, 2025 at 02:01:30PM +0100, Ulf Hansson wrote:
> > > > > + Sudeep,
> > > > >
> > > > > On Mon, 20 Jan 2025 at 11:37, Christian Marangi (Ansuel)
> > > > > <ansuelsmth@gmail.com> wrote:
> >
> > [...]
> >
> > > > > >
> > > > > > Mhhhh.... Any idea how to fix this? Maybe we have to exclude some flags?
> > > > > > Error is "error: write to reserved register 'R7'" and I guess it's very specific
> > > > > > to some kind of ARM ERRATA.
> > > > >
> > > > > I don't know to be honest. The arm-scmi transport driver
> > > > > (drivers/firmware/arm_scmi/transports/smc.c) is having similar calls
> > > > > with 9 parameters to arm_smccc_1_1_invoke(). Not sure why it's a
> > > > > problem here and not there?
> > > > >
> > > >
> > > > I think it is known issue and must be solved with the below patch if my
> > > > understanding is right.
> > > >
> > >
> > > If it's a known issue and affects also other use of smcc why we need
> > > specific fix in the driver makefile instead of a more generic one.
> > >
> >
> > IIUC, arm_smccc_1_1_invoke() is a macro which can be used anywhere.
> > There are reasons why we can't move it to a module and export it.
> >
> > > Do you have a link for the known issue?
> > >
> >
> > Nothing handy, but quick google search gave me this:
> > https://bugs.llvm.org/show_bug.cgi?id=45826
> >
> 
> If only these test report were easy to report instead of me having to build
> the massive llvm-20 dev version...
> 
> Any hint if anyone knows if precompiled cross tool are present around the web
> (with llvm-20?)

I can test it I guess as I have clang v20. Let me give it a go.

-- 
Regards,
Sudeep

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

* Re: [linux-next:master 9185/10024] drivers/pmdomain/mediatek/airoha-cpu-pmdomain.c:59:2: error: write to reserved register 'R7'
  2025-01-20 15:05             ` Sudeep Holla
@ 2025-01-20 15:20               ` Christian Marangi (Ansuel)
  2025-01-20 15:28                 ` Christian Marangi (Ansuel)
  0 siblings, 1 reply; 17+ messages in thread
From: Christian Marangi (Ansuel) @ 2025-01-20 15:20 UTC (permalink / raw)
  To: Sudeep Holla; +Cc: Ulf Hansson, kernel test robot, llvm, oe-kbuild-all

Il giorno lun 20 gen 2025 alle ore 16:05 Sudeep Holla
<sudeep.holla@arm.com> ha scritto:
>
> On Mon, Jan 20, 2025 at 03:52:09PM +0100, Christian Marangi (Ansuel) wrote:
> > Il giorno lun 20 gen 2025 alle ore 14:44 Sudeep Holla
> > <sudeep.holla@arm.com> ha scritto:
> > >
> > > On Mon, Jan 20, 2025 at 02:37:19PM +0100, Christian Marangi (Ansuel) wrote:
> > > > Il giorno lun 20 gen 2025 alle ore 14:34 Sudeep Holla
> > > > <sudeep.holla@arm.com> ha scritto:
> > > > >
> > > > > On Mon, Jan 20, 2025 at 02:01:30PM +0100, Ulf Hansson wrote:
> > > > > > + Sudeep,
> > > > > >
> > > > > > On Mon, 20 Jan 2025 at 11:37, Christian Marangi (Ansuel)
> > > > > > <ansuelsmth@gmail.com> wrote:
> > >
> > > [...]
> > >
> > > > > > >
> > > > > > > Mhhhh.... Any idea how to fix this? Maybe we have to exclude some flags?
> > > > > > > Error is "error: write to reserved register 'R7'" and I guess it's very specific
> > > > > > > to some kind of ARM ERRATA.
> > > > > >
> > > > > > I don't know to be honest. The arm-scmi transport driver
> > > > > > (drivers/firmware/arm_scmi/transports/smc.c) is having similar calls
> > > > > > with 9 parameters to arm_smccc_1_1_invoke(). Not sure why it's a
> > > > > > problem here and not there?
> > > > > >
> > > > >
> > > > > I think it is known issue and must be solved with the below patch if my
> > > > > understanding is right.
> > > > >
> > > >
> > > > If it's a known issue and affects also other use of smcc why we need
> > > > specific fix in the driver makefile instead of a more generic one.
> > > >
> > >
> > > IIUC, arm_smccc_1_1_invoke() is a macro which can be used anywhere.
> > > There are reasons why we can't move it to a module and export it.
> > >
> > > > Do you have a link for the known issue?
> > > >
> > >
> > > Nothing handy, but quick google search gave me this:
> > > https://bugs.llvm.org/show_bug.cgi?id=45826
> > >
> >
> > If only these test report were easy to report instead of me having to build
> > the massive llvm-20 dev version...
> >
> > Any hint if anyone knows if precompiled cross tool are present around the web
> > (with llvm-20?)
>
> I can test it I guess as I have clang v20. Let me give it a go.
>

Ok no manage to repro and I can indeed confirm your patch fix the compilation
error...

My main question is... Is it acceptable tho?

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

* Re: [linux-next:master 9185/10024] drivers/pmdomain/mediatek/airoha-cpu-pmdomain.c:59:2: error: write to reserved register 'R7'
  2025-01-20 15:20               ` Christian Marangi (Ansuel)
@ 2025-01-20 15:28                 ` Christian Marangi (Ansuel)
  2025-01-20 15:31                   ` Christian Marangi (Ansuel)
  2025-01-20 15:35                   ` Sudeep Holla
  0 siblings, 2 replies; 17+ messages in thread
From: Christian Marangi (Ansuel) @ 2025-01-20 15:28 UTC (permalink / raw)
  To: Sudeep Holla; +Cc: Ulf Hansson, kernel test robot, llvm, oe-kbuild-all

Il giorno lun 20 gen 2025 alle ore 16:20 Christian Marangi (Ansuel)
<ansuelsmth@gmail.com> ha scritto:
>
> Il giorno lun 20 gen 2025 alle ore 16:05 Sudeep Holla
> <sudeep.holla@arm.com> ha scritto:
> >
> > On Mon, Jan 20, 2025 at 03:52:09PM +0100, Christian Marangi (Ansuel) wrote:
> > > Il giorno lun 20 gen 2025 alle ore 14:44 Sudeep Holla
> > > <sudeep.holla@arm.com> ha scritto:
> > > >
> > > > On Mon, Jan 20, 2025 at 02:37:19PM +0100, Christian Marangi (Ansuel) wrote:
> > > > > Il giorno lun 20 gen 2025 alle ore 14:34 Sudeep Holla
> > > > > <sudeep.holla@arm.com> ha scritto:
> > > > > >
> > > > > > On Mon, Jan 20, 2025 at 02:01:30PM +0100, Ulf Hansson wrote:
> > > > > > > + Sudeep,
> > > > > > >
> > > > > > > On Mon, 20 Jan 2025 at 11:37, Christian Marangi (Ansuel)
> > > > > > > <ansuelsmth@gmail.com> wrote:
> > > >
> > > > [...]
> > > >
> > > > > > > >
> > > > > > > > Mhhhh.... Any idea how to fix this? Maybe we have to exclude some flags?
> > > > > > > > Error is "error: write to reserved register 'R7'" and I guess it's very specific
> > > > > > > > to some kind of ARM ERRATA.
> > > > > > >
> > > > > > > I don't know to be honest. The arm-scmi transport driver
> > > > > > > (drivers/firmware/arm_scmi/transports/smc.c) is having similar calls
> > > > > > > with 9 parameters to arm_smccc_1_1_invoke(). Not sure why it's a
> > > > > > > problem here and not there?
> > > > > > >
> > > > > >
> > > > > > I think it is known issue and must be solved with the below patch if my
> > > > > > understanding is right.
> > > > > >
> > > > >
> > > > > If it's a known issue and affects also other use of smcc why we need
> > > > > specific fix in the driver makefile instead of a more generic one.
> > > > >
> > > >
> > > > IIUC, arm_smccc_1_1_invoke() is a macro which can be used anywhere.
> > > > There are reasons why we can't move it to a module and export it.
> > > >
> > > > > Do you have a link for the known issue?
> > > > >
> > > >
> > > > Nothing handy, but quick google search gave me this:
> > > > https://bugs.llvm.org/show_bug.cgi?id=45826
> > > >
> > >
> > > If only these test report were easy to report instead of me having to build
> > > the massive llvm-20 dev version...
> > >
> > > Any hint if anyone knows if precompiled cross tool are present around the web
> > > (with llvm-20?)
> >
> > I can test it I guess as I have clang v20. Let me give it a go.
> >
>
> Ok no manage to repro and I can indeed confirm your patch fix the compilation
> error...
>
> My main question is... Is it acceptable tho?

Honestly I will revert back and use the basic arm_smccc_smc. I don't really like
the fix in the makefile and I think it should be handled in a more
generic way for
any user of arm_smccc_1_1_invoke.

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

* Re: [linux-next:master 9185/10024] drivers/pmdomain/mediatek/airoha-cpu-pmdomain.c:59:2: error: write to reserved register 'R7'
  2025-01-20 15:28                 ` Christian Marangi (Ansuel)
@ 2025-01-20 15:31                   ` Christian Marangi (Ansuel)
  2025-01-20 15:33                     ` Sudeep Holla
  2025-01-20 15:35                   ` Sudeep Holla
  1 sibling, 1 reply; 17+ messages in thread
From: Christian Marangi (Ansuel) @ 2025-01-20 15:31 UTC (permalink / raw)
  To: Sudeep Holla; +Cc: Ulf Hansson, kernel test robot, llvm, oe-kbuild-all

Il giorno lun 20 gen 2025 alle ore 16:28 Christian Marangi (Ansuel)
<ansuelsmth@gmail.com> ha scritto:
>
> Il giorno lun 20 gen 2025 alle ore 16:20 Christian Marangi (Ansuel)
> <ansuelsmth@gmail.com> ha scritto:
> >
> > Il giorno lun 20 gen 2025 alle ore 16:05 Sudeep Holla
> > <sudeep.holla@arm.com> ha scritto:
> > >
> > > On Mon, Jan 20, 2025 at 03:52:09PM +0100, Christian Marangi (Ansuel) wrote:
> > > > Il giorno lun 20 gen 2025 alle ore 14:44 Sudeep Holla
> > > > <sudeep.holla@arm.com> ha scritto:
> > > > >
> > > > > On Mon, Jan 20, 2025 at 02:37:19PM +0100, Christian Marangi (Ansuel) wrote:
> > > > > > Il giorno lun 20 gen 2025 alle ore 14:34 Sudeep Holla
> > > > > > <sudeep.holla@arm.com> ha scritto:
> > > > > > >
> > > > > > > On Mon, Jan 20, 2025 at 02:01:30PM +0100, Ulf Hansson wrote:
> > > > > > > > + Sudeep,
> > > > > > > >
> > > > > > > > On Mon, 20 Jan 2025 at 11:37, Christian Marangi (Ansuel)
> > > > > > > > <ansuelsmth@gmail.com> wrote:
> > > > >
> > > > > [...]
> > > > >
> > > > > > > > >
> > > > > > > > > Mhhhh.... Any idea how to fix this? Maybe we have to exclude some flags?
> > > > > > > > > Error is "error: write to reserved register 'R7'" and I guess it's very specific
> > > > > > > > > to some kind of ARM ERRATA.
> > > > > > > >
> > > > > > > > I don't know to be honest. The arm-scmi transport driver
> > > > > > > > (drivers/firmware/arm_scmi/transports/smc.c) is having similar calls
> > > > > > > > with 9 parameters to arm_smccc_1_1_invoke(). Not sure why it's a
> > > > > > > > problem here and not there?
> > > > > > > >
> > > > > > >
> > > > > > > I think it is known issue and must be solved with the below patch if my
> > > > > > > understanding is right.
> > > > > > >
> > > > > >
> > > > > > If it's a known issue and affects also other use of smcc why we need
> > > > > > specific fix in the driver makefile instead of a more generic one.
> > > > > >
> > > > >
> > > > > IIUC, arm_smccc_1_1_invoke() is a macro which can be used anywhere.
> > > > > There are reasons why we can't move it to a module and export it.
> > > > >
> > > > > > Do you have a link for the known issue?
> > > > > >
> > > > >
> > > > > Nothing handy, but quick google search gave me this:
> > > > > https://bugs.llvm.org/show_bug.cgi?id=45826
> > > > >
> > > >
> > > > If only these test report were easy to report instead of me having to build
> > > > the massive llvm-20 dev version...
> > > >
> > > > Any hint if anyone knows if precompiled cross tool are present around the web
> > > > (with llvm-20?)
> > >
> > > I can test it I guess as I have clang v20. Let me give it a go.
> > >
> >
> > Ok no manage to repro and I can indeed confirm your patch fix the compilation
> > error...
> >
> > My main question is... Is it acceptable tho?
>
> Honestly I will revert back and use the basic arm_smccc_smc. I don't really like
> the fix in the makefile and I think it should be handled in a more
> generic way for
> any user of arm_smccc_1_1_invoke.

Actually sorry for the mail spam... Since this is already done I will follow
how it's done for drivers/firmware/arm_scmi/transports/Makefile

Creating the patch that fix this. Thanks a lot for the hint and suggestion
Sudeep Holla.

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

* Re: [linux-next:master 9185/10024] drivers/pmdomain/mediatek/airoha-cpu-pmdomain.c:59:2: error: write to reserved register 'R7'
  2025-01-20 15:31                   ` Christian Marangi (Ansuel)
@ 2025-01-20 15:33                     ` Sudeep Holla
  0 siblings, 0 replies; 17+ messages in thread
From: Sudeep Holla @ 2025-01-20 15:33 UTC (permalink / raw)
  To: Christian Marangi (Ansuel)
  Cc: Ulf Hansson, kernel test robot, llvm, oe-kbuild-all

On Mon, Jan 20, 2025 at 04:31:00PM +0100, Christian Marangi (Ansuel) wrote:
> Il giorno lun 20 gen 2025 alle ore 16:28 Christian Marangi (Ansuel)
> <ansuelsmth@gmail.com> ha scritto:
> 
> Actually sorry for the mail spam... Since this is already done I will follow
> how it's done for drivers/firmware/arm_scmi/transports/Makefile
> 

And in arch/arm/mach-bcm/Makefile and may be others.

> Creating the patch that fix this. Thanks a lot for the hint and suggestion
> Sudeep Holla.

You are welcome.

--
Regards,
Sudeep

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

* Re: [linux-next:master 9185/10024] drivers/pmdomain/mediatek/airoha-cpu-pmdomain.c:59:2: error: write to reserved register 'R7'
  2025-01-20 15:28                 ` Christian Marangi (Ansuel)
  2025-01-20 15:31                   ` Christian Marangi (Ansuel)
@ 2025-01-20 15:35                   ` Sudeep Holla
  1 sibling, 0 replies; 17+ messages in thread
From: Sudeep Holla @ 2025-01-20 15:35 UTC (permalink / raw)
  To: Christian Marangi (Ansuel)
  Cc: Ulf Hansson, kernel test robot, Sudeep Holla, llvm, oe-kbuild-all

On Mon, Jan 20, 2025 at 04:28:08PM +0100, Christian Marangi (Ansuel) wrote:
>
> Honestly I will revert back and use the basic arm_smccc_smc. I don't really like
> the fix in the makefile and I think it should be handled in a more
> generic way for any user of arm_smccc_1_1_invoke.

You can use arm_smccc_smc() or arm_smccc_hvc() if that works for you.
If the system supports SMCCC v1.1+, then arm_smccc_1_1_invoke() helper
provides a generic and portable way(switch between the conduits if
running within a VM for example)

--
Regards,
Sudeep

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

* Re: [linux-next:master 9185/10024] drivers/pmdomain/mediatek/airoha-cpu-pmdomain.c:59:2: error: write to reserved register 'R7'
  2025-01-20 14:52           ` Christian Marangi (Ansuel)
  2025-01-20 15:05             ` Sudeep Holla
@ 2025-01-20 17:28             ` Nathan Chancellor
  2025-01-20 17:39               ` Christian Marangi (Ansuel)
  1 sibling, 1 reply; 17+ messages in thread
From: Nathan Chancellor @ 2025-01-20 17:28 UTC (permalink / raw)
  To: Christian Marangi (Ansuel)
  Cc: Sudeep Holla, Ulf Hansson, kernel test robot, llvm, oe-kbuild-all

On Mon, Jan 20, 2025 at 03:52:09PM +0100, Christian Marangi (Ansuel) wrote:
> If only these test report were easy to report instead of me having to build
> the massive llvm-20 dev version...
> 
> Any hint if anyone knows if precompiled cross tool are present around the web
> (with llvm-20?)

I see this has been resolved based on my understanding of the rest of
the comments in this thread but I figured I would comment on this bit.
You generally do not need a version of LLVM from main (i.e., 20 right
now) to reproduce these reports, it just happens to be the version that
the robot used to flag this issue. I maintain precompiled versions of
stable LLVM releases on kernel.org, which would show this issue with
that same configuration, no building needed :)

https://mirrors.edge.kernel.org/pub/tools/llvm/

If you try the latest version and the problem does not show up, feel
free to comment on the report (which should have llvm@lists.linux.dev in
CC) to let us know and we can see if it is an LLVM main problem (and
bisect it to get it reported and fixed upstream at that point).

Cheers,
Nathan

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

* Re: [linux-next:master 9185/10024] drivers/pmdomain/mediatek/airoha-cpu-pmdomain.c:59:2: error: write to reserved register 'R7'
  2025-01-20 17:28             ` Nathan Chancellor
@ 2025-01-20 17:39               ` Christian Marangi (Ansuel)
  2025-01-20 18:02                 ` Nathan Chancellor
  0 siblings, 1 reply; 17+ messages in thread
From: Christian Marangi (Ansuel) @ 2025-01-20 17:39 UTC (permalink / raw)
  To: Nathan Chancellor
  Cc: Sudeep Holla, Ulf Hansson, kernel test robot, llvm, oe-kbuild-all

Il giorno lun 20 gen 2025 alle ore 18:28 Nathan Chancellor
<nathan@kernel.org> ha scritto:
>
> On Mon, Jan 20, 2025 at 03:52:09PM +0100, Christian Marangi (Ansuel) wrote:
> > If only these test report were easy to report instead of me having to build
> > the massive llvm-20 dev version...
> >
> > Any hint if anyone knows if precompiled cross tool are present around the web
> > (with llvm-20?)
>
> I see this has been resolved based on my understanding of the rest of
> the comments in this thread but I figured I would comment on this bit.
> You generally do not need a version of LLVM from main (i.e., 20 right
> now) to reproduce these reports, it just happens to be the version that
> the robot used to flag this issue. I maintain precompiled versions of
> stable LLVM releases on kernel.org, which would show this issue with
> that same configuration, no building needed :)
>
> https://mirrors.edge.kernel.org/pub/tools/llvm/
>
> If you try the latest version and the problem does not show up, feel
> free to comment on the report (which should have llvm@lists.linux.dev in
> CC) to let us know and we can see if it is an LLVM main problem (and
> bisect it to get it reported and fixed upstream at that point).
>

Hi Nathan,

I would like to first thank you and anyone involved in this kernel boot test
project. It's a life saviour and helped me a lot to catch all kind of corner
case with randconfig.

My main complain is that a lot of times, the repro step reference clang
version or also gcc version that are actually not present in the download
link making the repro step (and script) not usable.

Now I can use and try the previous version but given some compilation
error happens only on the most recent build tools (due to additional
warning and check introduced) It might be hard to repro.

My honest suggestion to make this even more accessible would be
to also provide beta release of the build tool. Or at least add some
comments in the repro file suggesting also to try with the previous
version.

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

* Re: [linux-next:master 9185/10024] drivers/pmdomain/mediatek/airoha-cpu-pmdomain.c:59:2: error: write to reserved register 'R7'
  2025-01-20 17:39               ` Christian Marangi (Ansuel)
@ 2025-01-20 18:02                 ` Nathan Chancellor
  2025-01-22  1:33                   ` Philip Li
  0 siblings, 1 reply; 17+ messages in thread
From: Nathan Chancellor @ 2025-01-20 18:02 UTC (permalink / raw)
  To: Christian Marangi (Ansuel), kernel test robot
  Cc: Sudeep Holla, Ulf Hansson, llvm, oe-kbuild-all

On Mon, Jan 20, 2025 at 06:39:10PM +0100, Christian Marangi (Ansuel) wrote:
> Il giorno lun 20 gen 2025 alle ore 18:28 Nathan Chancellor
> <nathan@kernel.org> ha scritto:
> >
> > On Mon, Jan 20, 2025 at 03:52:09PM +0100, Christian Marangi (Ansuel) wrote:
> > > If only these test report were easy to report instead of me having to build
> > > the massive llvm-20 dev version...
> > >
> > > Any hint if anyone knows if precompiled cross tool are present around the web
> > > (with llvm-20?)
> >
> > I see this has been resolved based on my understanding of the rest of
> > the comments in this thread but I figured I would comment on this bit.
> > You generally do not need a version of LLVM from main (i.e., 20 right
> > now) to reproduce these reports, it just happens to be the version that
> > the robot used to flag this issue. I maintain precompiled versions of
> > stable LLVM releases on kernel.org, which would show this issue with
> > that same configuration, no building needed :)
> >
> > https://mirrors.edge.kernel.org/pub/tools/llvm/
> >
> > If you try the latest version and the problem does not show up, feel
> > free to comment on the report (which should have llvm@lists.linux.dev in
> > CC) to let us know and we can see if it is an LLVM main problem (and
> > bisect it to get it reported and fixed upstream at that point).
> >
> 
> Hi Nathan,
> 
> I would like to first thank you and anyone involved in this kernel boot test
> project. It's a life saviour and helped me a lot to catch all kind of corner
> case with randconfig.

Heh, thanks for the high praise but I do not maintain or help with this
service. I am focused on maintaining the LLVM build support in the
kernel and our list is CC'd on reports that use clang so we can help
with issues that appear only with clang (such as this one). Sorry I was
unable to jump in sooner.

> My main complain is that a lot of times, the repro step reference clang
> version or also gcc version that are actually not present in the download
> link making the repro step (and script) not usable.
> 
> Now I can use and try the previous version but given some compilation
> error happens only on the most recent build tools (due to additional
> warning and check introduced) It might be hard to repro.
> 
> My honest suggestion to make this even more accessible would be
> to also provide beta release of the build tool. Or at least add some
> comments in the repro file suggesting also to try with the previous
> version.

This sounds like good feedback for the LKP folks. I have my own wrapper
and processes for reproducing these issues because I do it a lot so I am
unaware of the potential jagged edges with the reproducers. They are
usually pretty responsive to requests/reports of problems with their
stuff in my experience.

Cheers,
Nathan

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

* Re: [linux-next:master 9185/10024] drivers/pmdomain/mediatek/airoha-cpu-pmdomain.c:59:2: error: write to reserved register 'R7'
  2025-01-20 18:02                 ` Nathan Chancellor
@ 2025-01-22  1:33                   ` Philip Li
  0 siblings, 0 replies; 17+ messages in thread
From: Philip Li @ 2025-01-22  1:33 UTC (permalink / raw)
  To: Nathan Chancellor
  Cc: Christian Marangi (Ansuel), kernel test robot, Sudeep Holla,
	Ulf Hansson, llvm, oe-kbuild-all

On Mon, Jan 20, 2025 at 11:02:36AM -0700, Nathan Chancellor wrote:
> On Mon, Jan 20, 2025 at 06:39:10PM +0100, Christian Marangi (Ansuel) wrote:
> > Il giorno lun 20 gen 2025 alle ore 18:28 Nathan Chancellor
> > <nathan@kernel.org> ha scritto:
> > >
> > > On Mon, Jan 20, 2025 at 03:52:09PM +0100, Christian Marangi (Ansuel) wrote:
> > > > If only these test report were easy to report instead of me having to build
> > > > the massive llvm-20 dev version...
> > > >

[...]

> 
> > My main complain is that a lot of times, the repro step reference clang
> > version or also gcc version that are actually not present in the download
> > link making the repro step (and script) not usable.

Apologize for this, we will resolve this to avoid such issue.

> > 
> > Now I can use and try the previous version but given some compilation
> > error happens only on the most recent build tools (due to additional
> > warning and check introduced) It might be hard to repro.
> > 
> > My honest suggestion to make this even more accessible would be
> > to also provide beta release of the build tool. Or at least add some
> > comments in the repro file suggesting also to try with the previous
> > version.
> 
> This sounds like good feedback for the LKP folks. I have my own wrapper

Thanks all for the input, let me add it to our TODO list, before that we
will enhance the repro comments as suggested when the version is failed
for download.

> and processes for reproducing these issues because I do it a lot so I am
> unaware of the potential jagged edges with the reproducers. They are
> usually pretty responsive to requests/reports of problems with their
> stuff in my experience.
> 
> Cheers,
> Nathan
> 

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

end of thread, other threads:[~2025-01-22  1:33 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-20 10:32 [linux-next:master 9185/10024] drivers/pmdomain/mediatek/airoha-cpu-pmdomain.c:59:2: error: write to reserved register 'R7' kernel test robot
2025-01-20 10:36 ` Christian Marangi (Ansuel)
2025-01-20 13:01   ` Ulf Hansson
2025-01-20 13:34     ` Sudeep Holla
2025-01-20 13:37       ` Christian Marangi (Ansuel)
2025-01-20 13:44         ` Sudeep Holla
2025-01-20 14:52           ` Christian Marangi (Ansuel)
2025-01-20 15:05             ` Sudeep Holla
2025-01-20 15:20               ` Christian Marangi (Ansuel)
2025-01-20 15:28                 ` Christian Marangi (Ansuel)
2025-01-20 15:31                   ` Christian Marangi (Ansuel)
2025-01-20 15:33                     ` Sudeep Holla
2025-01-20 15:35                   ` Sudeep Holla
2025-01-20 17:28             ` Nathan Chancellor
2025-01-20 17:39               ` Christian Marangi (Ansuel)
2025-01-20 18:02                 ` Nathan Chancellor
2025-01-22  1:33                   ` Philip Li

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox