From nobody Mon Sep 28 15:34:35 2026 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6DC2847CC73; Thu, 20 Aug 2026 16:36:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787243803; cv=none; b=RccIirma+JEASJ3QXCfRmlqeVigkqIFith6nO99preeu6UKjHUruYjs1OzwPBMYcRlHCmdRUPSgKo+oXaF5bKLdY/yV/Kxo36WyLDV68q9fvp6RqT6je7GZLptwniWipq9od3/sWkOFWrMfcPoAU+8h+q10mv4Jap59B1WVsOTE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787243803; c=relaxed/simple; bh=KwxJkzHYnsVpdal0lMCx1br39/jctW3eu1PkH+AqvXA=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=cPqZThMaVLshPtsm50vSL/2DaOygkDNwggrHAGpbK4hT2mDHub3+dX8fZE6XvBvnRTmp6IpTB++O2P82qPZfSspDd0ypgCX5XymiyR2dSMCEvx/iojuJw+VxsJ0Xj5dyTB/9KdXIWOaYluwXySesJvvh55X3c8LqGFl0QDaxAGg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=1sYfe7lQ; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=5dI4goMA; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="1sYfe7lQ"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="5dI4goMA" Date: Thu, 20 Aug 2026 16:36:37 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1787243799; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jdOQy8j8IvWgRchVA35TeWXJHkb9FOLODG7GF+D7GlA=; b=1sYfe7lQnI7mZv4saB5Ei8nNidltVll/evz+JnwicSMKOdk/NWUmluIVFNoSRiOlllaZEL mixWO8e0Y67yR1tPB3dx+Chp1u5rL0pdozYLa2TP04xLh8aNI1peyj/MXwS5V8aVyoHivv dqKl5nmW09tuBA4CxFOR0rIcQPOtRgHlUi57+dZn5LDnYqhtg7GleLnIw/Hxty5uljGM4a spgVI3KEj5+GAo1N2fxlz8KRn5VcwTz6cLcxXarpyZ0C9QKK05vzk+AaJqL3yO+3Lz70GI qlQn4MZvLKVD8B/f6HrChxj3liIVfJ6Zqpdo/K0yxJDZ01/pk2m09xNU+Si+Lg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1787243799; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jdOQy8j8IvWgRchVA35TeWXJHkb9FOLODG7GF+D7GlA=; b=5dI4goMA/3LNPCukooMpuHXCofmNkmZCi0e+9P8m7u4PluM5lK7bUsBlAwLgwswuDBbN6T IZCfSYgmvRukoqAA== From: "tip-bot2 for Rustam Adilov" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: irq/urgent] irqchip/irq-realtek-rtl: Use readl_be()/writel_be() instead of readl()/writel() Cc: Rustam Adilov , Thomas Gleixner , Carlo Szelinsky , x86@kernel.org, linux-kernel@vger.kernel.org, maz@kernel.org In-Reply-To: <20260820162017.28507-1-adilov@disroot.org> References: <20260820162017.28507-1-adilov@disroot.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <178724379760.1542179.1849602622321803765.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The following commit has been merged into the irq/urgent branch of tip: Commit-ID: 58b34b72b64bfbfc5f8ad4d8f229942aff76597e Gitweb: https://git.kernel.org/tip/58b34b72b64bfbfc5f8ad4d8f229942af= f76597e Author: Rustam Adilov AuthorDate: Thu, 20 Aug 2026 21:20:17 +05:00 Committer: Thomas Gleixner CommitterDate: Thu, 20 Aug 2026 18:34:59 +02:00 irqchip/irq-realtek-rtl: Use readl_be()/writel_be() instead of readl()/writ= el() When CONFIG_SWAP_IO_SPACE is enabled, readl() performs a swap from little endian device to big endian CPU and vice versa for writel(). This is incorrect for Realtek Interrupt controller as that is a big endian device and so the LE to BE conversions are unwanted. Fix this by converting the MMIO accesses to readl_be() and writel_be(). Fixes: 9f3a0f34b84a ("irqchip: Add support for Realtek RTL838x/RTL839x inte= rrupt controller") Signed-off-by: Rustam Adilov Signed-off-by: Thomas Gleixner Tested-by: Carlo Szelinsky Link: https://patch.msgid.link/20260820162017.28507-1-adilov@disroot.org --- drivers/irqchip/irq-realtek-rtl.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/drivers/irqchip/irq-realtek-rtl.c b/drivers/irqchip/irq-realte= k-rtl.c index c8becb4..26e52c3 100644 --- a/drivers/irqchip/irq-realtek-rtl.c +++ b/drivers/irqchip/irq-realtek-rtl.c @@ -1,5 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-only /* + * Realtek Interrupt controller. + * + * The Realtek Interrupt controller is a big endian device found in the + * Realtek MIPS SoCs. + * * Copyright (C) 2020 Birger Koblitz * Copyright (C) 2020 Bert Vermeulen * Copyright (C) 2020 John Crispin @@ -50,18 +55,18 @@ static inline void enable_gimr(unsigned int cpu, unsign= ed int hw_irq) { u32 gimr; =20 - gimr =3D readl(REG(cpu, RTL_ICTL_GIMR)); + gimr =3D readl_be(REG(cpu, RTL_ICTL_GIMR)); gimr |=3D BIT(hw_irq); - writel(gimr, REG(cpu, RTL_ICTL_GIMR)); + writel_be(gimr, REG(cpu, RTL_ICTL_GIMR)); } =20 static inline void disable_gimr(unsigned int cpu, unsigned int hw_irq) { u32 gimr; =20 - gimr =3D readl(REG(cpu, RTL_ICTL_GIMR)); + gimr =3D readl_be(REG(cpu, RTL_ICTL_GIMR)); gimr &=3D ~BIT(hw_irq); - writel(gimr, REG(cpu, RTL_ICTL_GIMR)); + writel_be(gimr, REG(cpu, RTL_ICTL_GIMR)); } =20 static void write_irr(unsigned int cpu, int hw_irq, u32 value) @@ -71,9 +76,9 @@ static void write_irr(unsigned int cpu, int hw_irq, u32 v= alue) unsigned int shift =3D IRR_SHIFT(hw_irq); u32 irr; =20 - irr =3D readl(irr0 + offset) & ~(0xf << shift); + irr =3D readl_be(irr0 + offset) & ~(0xf << shift); irr |=3D (value & 0xf) << shift; - writel(irr, irr0 + offset); + writel_be(irr, irr0 + offset); } =20 static void realtek_ictl_unmask_irq(struct irq_data *i) @@ -159,7 +164,8 @@ static void realtek_irq_dispatch(struct irq_desc *desc) unsigned int hw_irq; =20 chained_irq_enter(chip, desc); - pending =3D readl(REG(cpu, RTL_ICTL_GIMR)) & readl(REG(cpu, RTL_ICTL_GISR= )) & output->mask; + pending =3D readl_be(REG(cpu, RTL_ICTL_GIMR)) & + readl_be(REG(cpu, RTL_ICTL_GISR)) & output->mask; =20 if (unlikely(!pending)) { spurious_interrupt();