* Re: [PATCH] LoongArch: detect and disable sc.q if erratic
[not found] <20260402044732.164294-2-xry111@xry111.site>
@ 2026-04-07 15:21 ` kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-04-07 15:21 UTC (permalink / raw)
To: Xi Ruoyao, Huacai Chen, WANG Xuerui
Cc: llvm, oe-kbuild-all, loongarch, Zixing Liu, Mingcong Bai,
Xi Ruoyao, Jiaxun Yang, Arnd Bergmann, Yangyang Lian, Yawei Li,
George Guo, linux-kernel
Hi Xi,
kernel test robot noticed the following build errors:
[auto build test ERROR on soc/for-next]
[also build test ERROR on linus/master v7.0-rc7 next-20260406]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Xi-Ruoyao/LoongArch-detect-and-disable-sc-q-if-erratic/20260407-193425
base: https://git.kernel.org/pub/scm/linux/kernel/git/soc/soc.git for-next
patch link: https://lore.kernel.org/r/20260402044732.164294-2-xry111%40xry111.site
patch subject: [PATCH] LoongArch: detect and disable sc.q if erratic
config: loongarch-allnoconfig (https://download.01.org/0day-ci/archive/20260407/202604072314.9J2SQEFo-lkp@intel.com/config)
compiler: clang version 23.0.0git (https://github.com/llvm/llvm-project c80443cd37b2e2788cba67ffa180a6331e5f0791)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260407/202604072314.9J2SQEFo-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/202604072314.9J2SQEFo-lkp@intel.com/
All errors (new ones prefixed by >>):
>> arch/loongarch/kernel/cpu-probe.c:151:23: error: invalid operand for instruction
151 | "move\t%[tmp], $r0\n\t"
| ^
<inline asm>:3:22: note: instantiated into assembly here
3 | sc.q $a2, $a0, $a1, 0
| ^
1 error generated.
vim +151 arch/loongarch/kernel/cpu-probe.c
134
135 /*
136 * Some LoongArch has broken sc.q which incorrectly handles the upper word
137 * when the lower word is zero. Newer firmware versions (such as the 202602
138 * release from Loongson) seem to contain a workaround for this issue.
139 *
140 * Disable sc.q if erratic to ensure reliability and compatibility.
141 */
142 static bool sc_q_is_sane(void)
143 {
144 struct {
145 long word[2];
146 } __aligned(16) mem;
147 register long tmp;
148
149 asm (
150 "1:ll.d\t$r0, %[mem]\n\t"
> 151 "move\t%[tmp], $r0\n\t"
152 "sc.q\t%[tmp], %[one], %[mem]\n\t"
153 "beqz\t%[tmp], 1b"
154 : [mem] "=ZB" (mem), [tmp] "=&r" (tmp)
155 : [one] "r" (1));
156
157 if (mem.word[1] != 1) {
158 pr_warn_once("Warning: sc.q is erratic on this platform, disabling for both kernel and HWCAP. Please try a firmware update.");
159 return false;
160 }
161
162 return true;
163 }
164
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] only message in thread