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=1796386545; b=1QAbuYt6Z3OQ168N/HjCUyFLCr9w2DSsO8rOk4EjLQGVH5xWF6tBYXhZTFRAb5AiJOOB MPGzmGYOyGvVt4qUH1wx0YZ0h/GPZ6W/CbJM47OZFRJO8kQmZurmF2XlewNVwtMazC+um 2RNpHAFKERJ5PZNR7LUFEMO3MqQhOFFX4AChAWdPJP1MajelBZwTYBb3wlVPDsuC0ukpz hUqWBhKjuAqkDUfBdv7BE9mYk4WC1RoHwIcuRCeVJvpyEp+6A1PcSke3b1HFkz5MxSKuz g98tvjmGHSjLc1YQupY5lUsBOR5jLixxfW9HUXjHr1ZGcM/fYxAd2K+v2dQ4sZFpOPQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796386545; 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=8hgNpTtjNEc1I5bMUOisCcrLX1SpZ3eRdxOBkG9ruwo=; b=uZimSjUHdOzZqLjIaDVfI2jH1OAOoxBAlWJ2YqTLuaAMb8ka+d5oWBj7IMMOEl7FyySG E3q4fBJZignSNoupBQgcwR/l9M7LJRjjJ9ALzAcZEGdeRWtQ2TmVI5gJgtLBZE3PqGCnN lJqq+MlGLt6UTnQ8uDCM0r4thairxh1q5Qw8oyTGekec8ZYBjxdIxcMdwdvSg3iGNDt+o 8u2WAlyTYUbrkiY/jtFVEvJNAEKbQmyd7rQbFbgCWJw067jtruPbeUrbz4lUONu2gySuT yVJerImsTk7u8YaA2FF8j7zh3V5pzeVevxgSjKenu5tLq/N0iZJdBX++S8ORtZ0jksw== 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=NAoLJRRV; 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 19477606A32C; Fri, 4 Dec 2026 12:15:45 +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=NAoLJRRV Received: by smtp.kernel.org (Postfix) with ESMTPSA id 83F011F0092C; Fri, 4 Dec 2026 12:15:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796386545; bh=8hgNpTtjNEc1I5bMUOisCcrLX1SpZ3eRdxOBkG9ruwo=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=NAoLJRRVqFpDJ17b2G6si+Ax2Wl4IqNUg/8Mszx+4y1+DfOjoQ+f3ZxvZ6Q+FTkoy hiAi0eOLsqsSLar9+qU1jsYjZOE2XjWZQQIwWxr2/4sZculNIQA7im2kT1AzVLDXX+ rIdu0AwOtcTbjQ+2TZIq2yk3tdeo7HJe9/9mRTNM= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Vineet Gupta Subject: [PATCH 6.6 1008/1167] ARC: io: work around GCC PR127718 in __raw_write{w,l}() Date: Fri, 4 Dec 2026 19:07:15 +0900 Message-ID: <20261204100728.463733877@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100702.047403948@linuxfoundation.org> References: <20261204100702.047403948@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.6-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"); }