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=1796380802; b=Lj6xorBDkSh0ml0pbA/leuCPn8t9PYLU0/uGtd8+Ell2voOcSwMW39Dl7SV/aN9YJMBH RCDomryQpq/eKW/gdYaebMMgr3zYs3VWUeBpCXGdw+fTnJIxKPxLIT1T8So1x0WT6xz8y ZehYt6tQh/+fd7X/oVJy0aLVtFEYC2jNQwGyVUbIET1Jx4DQggFgKzv2HY11YwY9w+Y1m GOrdrQ9M1BewI4I8E7S2SC2EmxP6GXuRbU14/tgUDfX7xmyc5eZxbK0uKgke3us2Oo3D7 zWx8JpvKf62pvFm9RaojwBuZJeyMpOnrULzVpdKzRDx2KOsW04uJYO6x/SP9yQokbUA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796380802; 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=kQ7dELpR4Z2TyOC/798WxVfL49/aFWu8VGKgF4+NyO4=; b=WnE2GUbUbZZki5izHzcUdFy60IFJn0IDSZ36Q6Qow33dmJ3wFFU9w8E17OEB6uCr4Vvc xMF5uyGBwvAhqbHs3Q3sejWQfJ/sqX7/qR2VaL/MjY8jIST5GgQM9XL7DErHoTLGYG+CP 2WmQf2BmuVAoP75qvdPI+1PbDsHYeFD8l/wDZy4i6+Sel4EFvgtpZnzcd1x1uVrslm8Dh Z+IYbO0h9sM9CJNWu8FPw9F4gziR5TYNuXyga9uDQWeaJJBFwq+EnCZ0V3RTJnsn2TYCc a7FJabZqyDCgEBzNjcE6RQxxdXUjUL4okHH2Z+KwrvL3oAnNptwERl7382QrvmozN2w== 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="d3ZC1lR/"; 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 E8D6D606A336; Fri, 4 Dec 2026 10:40:01 +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=d3ZC1lR/ Received: by smtp.kernel.org (Postfix) with ESMTPSA id 64AA61F000C2; Fri, 4 Dec 2026 10:40:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796380801; bh=kQ7dELpR4Z2TyOC/798WxVfL49/aFWu8VGKgF4+NyO4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=d3ZC1lR/rIxpk94cQHYUfnL/Ry3flUTTcqY86WTX/LC0ss4TROfpnvOF0Xc1Drakc rHTHeSC/3x3QfLLSo1PZQfLGebYeez9H4bQj9kdPWZJBMIHeX7KRdKbF+Idna92+hI PC/nNLlKnlEULkEhVxdZxkZkNFIdgqLBN0GVYILs= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Vineet Gupta Subject: [PATCH 7.3 429/742] ARC: io: work around GCC PR127718 in __raw_write{w,l}() Date: Fri, 4 Dec 2026 19:04:53 +0900 Message-ID: <20261204100646.503643063@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100635.034361255@linuxfoundation.org> References: <20261204100635.034361255@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 7.3-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 @@ -133,10 +133,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"); } @@ -144,10 +148,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"); }