Re: AW: [PATCH] clocksource: rtl-otto: Change driver to use __raw reads and writes

From: Rustam Adilov

Date: Fri May 15 2026 - 10:33:10 EST


Hi Markus,
On 2026-05-14 20:50, markus.stockhausen@xxxxxx wrote:
>> Von: Chris Packham <Chris.Packham@xxxxxxxxxxxxxxxxxxx>
>> Gesendet: Mittwoch, 13. Mai 2026 23:05
>> Betreff: Re: [PATCH] clocksource: rtl-otto: Change driver to use __raw reads and writes
>> ...
>>> Fix this by replacing all instances of ioread32 and iowrite32 with
>>> __raw_readl and __raw_writel variants. Since they essentially do
>>> the same register access, this shouldn't affect anything on other
>>> machines.
>>>
>>> Signed-off-by: Rustam Adilov <adilov@xxxxxxxxxxx>
>
> IIRC the current functions use memory barriers while the
> new ones do not. Timers are critical and cost me a lot
> of time in the past [1]. We nearly lost support for several
> devices last year. So I like to have at least some stability
> confirmation from downstream.

As far as i can see, if you untangle the the BUILDIO_MEM(l, u32) in [1]
you should see they do have barriers as denoted by barrier argument being set.
So that means, in MIPS, both readl/writel are the same as their __raw variants.
And both ioread32/iowrite32 are using readl/writel under the hood so...

[1] - https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/mips/include/asm/io.h

> Markus
>
> [1] https://lkml.org/lkml/2025/8/4/240

Best,
Rustam