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=1796389235; b=uaES2J+eNHUTiIaG21fPFNUrO9gzbDkV35Isr5ahQGJiJ9wL2nnLckh6Gu+YTIg8aibK YcO2e/cdn0CsMDG8YnspoZ6HFllydCJCAtXV50ng9ijApVc5S1RLsIhObDpbItnjOxOAh vpfhkGUj+YfTxdO7uI90t2/EYQPKvF/Dl8K0SBNpbtXGbHmZWh3N23J55fhf4s9Enzepl eMTjVpWhGZulq83KC7ChCQXr5yN0GV5dUi/w2KWB1v5A0/8XEkuMQAP9Uz308XIRDXpBj KXKEU97OdS75plac7PEEk52/VJ15x63JGDDATz3dy1vEksvLJRAAq6qpK4Qh3rPq7RA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796389235; 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=gwzB09f5RA5cOGEZYoVEhkPifLV3KBbrc7qqakN5drc=; b=mVNvgEPL2/qDnwNT5OLeIzDsWWfyir/1DdVihTr4KZ63pcGZyzxLSRg7G5uB6A/1LZgQ sHSiLDfdvvKMDM62WEgUZEkDwU87kzUD78JeD2xAJSlfCkfEtB3rfKbf8eGAjfDi+Sz93 jO6wUZrxIPLS4XTVaPCvJ5O73rsofBhS/FNQJZ8KMu7fIgn+15ZGmJmJIgWRsNEF1nhdC ycZefEX8FtGZP3aJ2zxolIxMRUqFUerNfnpHfY5QqnryDCTCkxxOV9cujr98dSXyT32BH XA3poKkZ8N2MP+1Wrujll1EtMJAQSYwR1HZGXmdDaVmW2BDac8CfRwj2UVEZTivGdWQ== 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=1tPDB7qT; 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 93AF7606A322; Fri, 4 Dec 2026 13:00:35 +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=1tPDB7qT Received: by smtp.kernel.org (Postfix) with ESMTPSA id 94BF91F0093A; Fri, 4 Dec 2026 13:00:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796389235; bh=gwzB09f5RA5cOGEZYoVEhkPifLV3KBbrc7qqakN5drc=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=1tPDB7qTjH5OfHSSsHv1n8P374e7e6+r75fNWjtbPj9BQhqRfreNswnlAl99boQ/B yh3DJoNyJRhlQ09b+tylnGqGc5Zqe3oRQmNol43vqq9wwO/SHkgTxOQBBoMdFR7owR 8m2J2cQGgFI8YP36N4i3AySY0Ud3AuT5xzwgWLuU= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Vineet Gupta Subject: [PATCH 6.1 0915/1059] ARC: io: work around GCC PR127718 in __raw_write{w,l}() Date: Fri, 4 Dec 2026 19:07:26 +0900 Message-ID: <20261204100707.721437837@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100643.980430235@linuxfoundation.org> References: <20261204100643.980430235@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-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 @@ -137,10 +137,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"); } @@ -148,10 +152,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"); }