Geert Uytterhoeven
2020-Jan-08 08:12 UTC
[Nouveau] [RFT 00/13] iomap: Constify ioreadX() iomem argument
Hi Krzysztof, On Wed, Jan 8, 2020 at 9:07 AM Geert Uytterhoeven <geert at linux-m68k.org> wrote:> On Tue, Jan 7, 2020 at 5:53 PM Krzysztof Kozlowski <krzk at kernel.org> wrote: > > The ioread8/16/32() and others have inconsistent interface among the > > architectures: some taking address as const, some not. > > > > It seems there is nothing really stopping all of them to take > > pointer to const. > > Shouldn't all of them take const volatile __iomem pointers? > It seems the "volatile" is missing from all but the implementations in > include/asm-generic/io.h.As my "volatile" comment applies to iowrite*(), too, probably that should be done in a separate patch. Hence with patches 1-5 squashed, and for patches 11-13: Reviewed-by: Geert Uytterhoeven <geert+renesas at glider.be> Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
Krzysztof Kozlowski
2020-Jan-08 08:18 UTC
[Nouveau] [RFT 00/13] iomap: Constify ioreadX() iomem argument
On Wed, 8 Jan 2020 at 09:13, Geert Uytterhoeven <geert at linux-m68k.org> wrote:> > Hi Krzysztof, > > On Wed, Jan 8, 2020 at 9:07 AM Geert Uytterhoeven <geert at linux-m68k.org> wrote: > > On Tue, Jan 7, 2020 at 5:53 PM Krzysztof Kozlowski <krzk at kernel.org> wrote: > > > The ioread8/16/32() and others have inconsistent interface among the > > > architectures: some taking address as const, some not. > > > > > > It seems there is nothing really stopping all of them to take > > > pointer to const. > > > > Shouldn't all of them take const volatile __iomem pointers? > > It seems the "volatile" is missing from all but the implementations in > > include/asm-generic/io.h. > > As my "volatile" comment applies to iowrite*(), too, probably that should be > done in a separate patch. > > Hence with patches 1-5 squashed, and for patches 11-13: > Reviewed-by: Geert Uytterhoeven <geert+renesas at glider.be>I'll add to this one also changes to ioreadX_rep() and add another patch for volatile for reads and writes. I guess your review will be appreciated once more because of ioreadX_rep() Thanks, Krzysztof
Christophe Leroy
2020-Jan-08 08:35 UTC
[Nouveau] [RFT 00/13] iomap: Constify ioreadX() iomem argument
Le 08/01/2020 ? 09:18, Krzysztof Kozlowski a ?crit?:> On Wed, 8 Jan 2020 at 09:13, Geert Uytterhoeven <geert at linux-m68k.org> wrote: >> >> Hi Krzysztof, >> >> On Wed, Jan 8, 2020 at 9:07 AM Geert Uytterhoeven <geert at linux-m68k.org> wrote: >>> On Tue, Jan 7, 2020 at 5:53 PM Krzysztof Kozlowski <krzk at kernel.org> wrote: >>>> The ioread8/16/32() and others have inconsistent interface among the >>>> architectures: some taking address as const, some not. >>>> >>>> It seems there is nothing really stopping all of them to take >>>> pointer to const. >>> >>> Shouldn't all of them take const volatile __iomem pointers? >>> It seems the "volatile" is missing from all but the implementations in >>> include/asm-generic/io.h. >> >> As my "volatile" comment applies to iowrite*(), too, probably that should be >> done in a separate patch. >> >> Hence with patches 1-5 squashed, and for patches 11-13: >> Reviewed-by: Geert Uytterhoeven <geert+renesas at glider.be> > > I'll add to this one also changes to ioreadX_rep() and add another > patch for volatile for reads and writes. I guess your review will be > appreciated once more because of ioreadX_rep() >volatile should really only be used where deemed necessary: https://www.kernel.org/doc/html/latest/process/volatile-considered-harmful.html It is said: " ... accessor functions might use volatile on architectures where direct I/O memory access does work. Essentially, each accessor call becomes a little critical section on its own and ensures that the access happens as expected by the programmer." Christophe
Possibly Parallel Threads
- [RFT 00/13] iomap: Constify ioreadX() iomem argument
- [RFT 00/13] iomap: Constify ioreadX() iomem argument
- [RFT 00/13] iomap: Constify ioreadX() iomem argument
- [RFT 00/13] iomap: Constify ioreadX() iomem argument
- [RFT 00/13] iomap: Constify ioreadX() iomem argument