Re: [PATCH v2] irqchip/irq-realtek-rtl: change to __raw reads and writes
From: Thomas Gleixner
Date: Wed Aug 19 2026 - 15:03:20 EST
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?
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.