Re: [PATCH v2] irqchip/irq-realtek-rtl: change to __raw reads and writes

From: Rustam Adilov

Date: Thu Aug 20 2026 - 11:00:58 EST


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