From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796383761; b=yGKz9goA5KlJXx5zBreTTrgv3Yg7MfRSofTxU6nVwHdUCozFCz6RCn1i16oa55onmjEb XRsw29trpqUkgGtoCtUCYzKWMyOZuvrOhpjznzIqhYFwpBi9+4+wMjsAx3qKdcCoXL2rK S/qnN1+Ovi930ZOIeWIG5FJKALesXxFlhkUd00XF2ctcklCRjMH1JtOvuTb8B57cuJLih CnwBgwF0Gjj85IIVb5fBckRwipOwSUvzqwPhEuaOzKei3A65i8fszFavBpKDIsfLiWr+i s+6ehvP8LbJSXljEWsOwFI7453eITKwBpLp8Ke64vN8FTQact+Ub8or4epe68YzYNQQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796383761; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=+27c54BX2XPCu5/HapwoLViJPQxBUZeP+0yt/E4m19E=; b=TIQ8ZobQCTCmTxurhIX3PTMzILdTCJDLfx1eEGuD6DPeoXi9ZawGWFHPDdGqlGEshiKu 6nP+A8OQq/pz2Q0cFFG1LFnvlIxIJmVdT6aeIoWau3/lh7t46HE32XXz+z+nD63YhP/JW PGn9O8rMFUiUplbbdJL3vFFWvlgSjhEPC3X46hSvbUHFxhgJkkMVPwcA5As3n+CLfcDRE hGA8TvjlsVyd5cVnmfNTneyqQlbZOCUh/whGEQ11i25hWRjlF/mH8LJPwOBny/k8eJBqV 5W6vzLr67ma2qu/vQAkXTFO4yVYMZhyA0OavXHZIWMt9zUTCfdsfWSvVCGtgczxduAQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=vaKD8qD3; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2AB76606A32D; Fri, 4 Dec 2026 11:29:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=vaKD8qD3 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5FDF51F00897; Fri, 4 Dec 2026 11:29:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796383760; bh=+27c54BX2XPCu5/HapwoLViJPQxBUZeP+0yt/E4m19E=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=vaKD8qD3JOjBrOsGodyO09/Wnwz2NJ6ZkHUt8PhoeEPuRXGWZSu2CSGH0M9ofcD4I yxMrWeHzarUEPS20a4TlEqyHDs9EMwaVsO3216WC74EcsR7JNDE12CLcPhCy0ve9hm J4vrt2GCDxhl+kXjJyODGoCNuh1xhakd0miahZhI= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Vineet Gupta Subject: [PATCH 6.12 356/555] ARC: io: work around GCC PR127718 in __raw_write{w,l}() Date: Fri, 4 Dec 2026 19:06:39 +0900 Message-ID: <20261204100623.469008136@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100603.988357525@linuxfoundation.org> References: <20261204100603.988357525@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Vineet Gupta commit 603b4fd69b4e77770761ea03451e2164186f8590 upstream. The __raw_write{w,l}() accessors use inline asm with an "m" operand for the store destination. GCC's ARC backend lets "m" match any legitimate address, including the register-indexed [b,c] forms that only loads support: stores only have [reg], [reg,s9] and [limm] addressing. With newer GCC (late-combine in GCC 15, combine in GCC 16), a writew() with a scaled, non-constant offset gets stw.as r2,[r0,r1] which the assembler rejects: Error: inappropriate arguments for opcode 'stw' With GCC 16 this breaks even hsdk_defconfig (drivers/net/pcs/ pcs-xpcs-plat.c) and axs101_defconfig. allyesconfig additionally trips in drivers/pinctrl/renesas/pinctrl-rza2.c and drivers/video/fbdev/ s3c-fb.c. Work around it by passing the address in a register and using a fixed [%1] address in the asm template, so the compiler can't pick an addressing mode that stores don't support. This is the minimal fix. The next patch drops the inline asm altogether. Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127718 Cc: stable@vger.kernel.org Signed-off-by: Vineet Gupta Signed-off-by: Greg Kroah-Hartman --- arch/arc/include/asm/io.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) --- a/arch/arc/include/asm/io.h +++ b/arch/arc/include/asm/io.h @@ -136,10 +136,14 @@ static inline void __raw_writeb(u8 b, vo #define __raw_writew __raw_writew static inline void __raw_writew(u16 s, volatile void __iomem *addr) { + /* + * Not an "m" operand: GCC can pick a register-indexed address for it, + * which ST doesn't support (GCC PR target/127718). + */ __asm__ __volatile__( - " stw%U1 %0, %1 \n" + " stw %0, [%1] \n" : - : "r" (s), "m" (*(volatile u16 __force *)addr) + : "r" (s), "r" (addr) : "memory"); } @@ -147,10 +151,11 @@ static inline void __raw_writew(u16 s, v #define __raw_writel __raw_writel static inline void __raw_writel(u32 w, volatile void __iomem *addr) { + /* See __raw_writew() above for why this doesn't use an "m" operand. */ __asm__ __volatile__( - " st%U1 %0, %1 \n" + " st %0, [%1] \n" : - : "r" (w), "m" (*(volatile u32 __force *)addr) + : "r" (w), "r" (addr) : "memory"); }