From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from layka.disroot.org (layka.disroot.org [178.21.23.139]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3EA5435FF6E for ; Thu, 20 Aug 2026 14:57:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=178.21.23.139 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787237830; cv=none; b=hcZuIuqTUOddiipVp/+bje82tyueNRmBGxU5+08xwewxXbD4AURpPYidp70MFQzu6TYIcyEyVznDFj7YiMuISHlTU77Hs2BFz4y7Gs1EXZo4Kak9MNRQBPyE9mX7RKlbI7ujkNoA5YVlcoupRsieRoTnXnpl+gVY+6kjEJadQoM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787237830; c=relaxed/simple; bh=gs8UTraLvWvEf43NyVXXwMltfxJsGGyFf2ysARr+UkU=; h=MIME-Version:Date:From:To:Cc:Subject:In-Reply-To:References: Message-ID:Content-Type; b=QBGxqc/Koq6sE80+k473GrznDqY+Gaxu3NdWlDRS3KbWihEmtmNgP6mFgVMU4PmwJ2Mo5UL2SXwHS5i1tV4Yj8JNuNG1RriEMKR22S/4EaF0GvYWexQjUPPa+77S8RwFzbr/LFVc5aHb69S3L+1LM+uDLeG8GJ8V0ZYZdSlefbs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=disroot.org; spf=pass smtp.mailfrom=disroot.org; dkim=pass (2048-bit key) header.d=disroot.org header.i=@disroot.org header.b=SGiajn1b; arc=none smtp.client-ip=178.21.23.139 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=disroot.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=disroot.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=disroot.org header.i=@disroot.org header.b="SGiajn1b" Received: from mail01.layka.lan (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 91C258795C; Thu, 20 Aug 2026 16:56:59 +0200 (CEST) X-Virus-Scanned: SPAM Filter at disroot.org Received: from layka.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id d9zr6hMvtsIe; Thu, 20 Aug 2026 16:56:59 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1787237819; bh=gs8UTraLvWvEf43NyVXXwMltfxJsGGyFf2ysARr+UkU=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=SGiajn1bhee/FT+8ASmqjQUFXfvu66akfym89Twl9jXg2p14XmfdrKzut3zTs4jfw m/H4PNECuEykP/nF13TGoQkRqzjXmCNf8x/k2bwfrFzV1Hu7WprwvdLKdgTQgMDoFm xHcUPEme/uLRTRxWT1b9c7V36kfu1CqggXlj3JVq6IUv5z1lh30ICf33MIaQmnBYZ2 viv67gNxGvWCs4OIYs3YXvy/wF9DxqMhAhL8Mbu44TmoKCZupohaIKVzO0wop4iJAH QL3EeThyD9YUOcGMXXn2WZjGyXEjBNszUYkOhoUWoXc9f5/o5VkWmSOIqYKyxL4i6n cmcODxIj4svuA== Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Date: Thu, 20 Aug 2026 14:56:54 +0000 From: Rustam Adilov To: Thomas Gleixner Cc: Birger Koblitz , Bert Vermeulen , John Crispin , linux-kernel@vger.kernel.org, Carlo Szelinsky Subject: Re: [PATCH v2] irqchip/irq-realtek-rtl: change to __raw reads and writes In-Reply-To: <87o6eyj5mr.ffs@fw13> References: <20260725101456.31619-1-adilov@disroot.org> <87o6eyj5mr.ffs@fw13> Message-ID: X-Sender: adilov@disroot.org Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On 2026-08-19 19:02, Thomas Gleixner wrote: > On Sat, Jul 25 2026 at 15:14, Rustam Adilov wrote: >> When CONFIG_SWAP_IO_SPACE is enabled, readl() and writel() are >> changed to perform a byte swap to little endian type. This is >> incorrect because the devices that use the irq-realtek-rtl driver >> are all big endian MIPS chips. > > That still does not make sense. With CONFIG_SWAP_IO_SPACE() enabled > readl() performs a address swizzle to convert from BE (CPU) to LE > (device). readl() swaps the read data from LE (device) to BE (CPU) > and writel() the other way round. > > You need that change not because your CPU is big endian. You need it > because the device is BE, so you don't want to have the LE -> BE > conversion, right? Right, yes. Still getting the grasp of the SWAP_IO_SPACE it seems. > Btw, please use readl_be() and writel_be() as those are the proper > generic interfaces for this. > > And please put a comment into the driver explaining that the device is > BE. Okay, will do that in the next version. Best, Rustam