public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Xi Ruoyao <xry111@xry111.site>,
	Huacai Chen <chenhuacai@kernel.org>,
	WANG Xuerui <kernel@xen0n.name>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	loongarch@lists.linux.dev, Zixing Liu <liushuyu@aosc.io>,
	Mingcong Bai <jeffbai@aosc.io>, Xi Ruoyao <xry111@xry111.site>,
	Jiaxun Yang <jiaxun.yang@flygoat.com>,
	Arnd Bergmann <arnd@arndb.de>,
	Yangyang Lian <lianyangyang@kylinos.cn>,
	Yawei Li <liyawei@loongson.cn>,
	George Guo <dongtai.guo@linux.dev>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] LoongArch: detect and disable sc.q if erratic
Date: Tue, 7 Apr 2026 23:21:14 +0800	[thread overview]
Message-ID: <202604072314.9J2SQEFo-lkp@intel.com> (raw)
In-Reply-To: <20260402044732.164294-2-xry111@xry111.site>

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

           reply	other threads:[~2026-04-07 15:22 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <20260402044732.164294-2-xry111@xry111.site>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202604072314.9J2SQEFo-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=arnd@arndb.de \
    --cc=chenhuacai@kernel.org \
    --cc=dongtai.guo@linux.dev \
    --cc=jeffbai@aosc.io \
    --cc=jiaxun.yang@flygoat.com \
    --cc=kernel@xen0n.name \
    --cc=lianyangyang@kylinos.cn \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liushuyu@aosc.io \
    --cc=liyawei@loongson.cn \
    --cc=llvm@lists.linux.dev \
    --cc=loongarch@lists.linux.dev \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=xry111@xry111.site \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox