Skip to content

io.h, logic_pio: Allow barriers for inX() and outX() be overridden

John Garry linux-arch linux-arm-kernel lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest3 patches 1 replyIn review
  2. v13 patches 2 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3io: Provide _inX() and _outX()include/asm-generic/io.h+44 -200 replies
2/3logic_pio: Improve macro argument namelib/logic_pio.c+11 -110 replies
3/3logic_pio: Use _inX() and _outX()lib/logic_pio.c+2 -20 replies

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchArnd Bergmann
1/3R-b
2/3R-b
3/3R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/3] io.h, logic_pio: Allow barriers for inX() and outX() be overridden

Since commits a7851aa54c0c ("io: change outX() to have their own IO barrier overrides") and 87fe2d543f81 ("io: change inX() to have their own IO barrier overrides"), the outX() and inX() functions have memory barriers which can be overridden per-arch.

However, under CONFIG_INDIRECT_PIO, logic_pio defines its own version of inX() and outX(), which still use readb et al. For these, the barrier after a raw read is weaker than it otherwise would be.

This series generates consistent behaviour for logic_pio, by defining generic _inX() and _outX() in asm-generic/io.h, and using those in logic_pio. Generic _inX() and _outX() have per-arch overrideable barriers.

The topic was discussed there originally:
https://lore.kernel.org/lkml/[email protected]/

A small tidy-up patch is included.

I hope that series can go through the arm-soc tree, as with other recent logic_pio changes.

Hi Arnd,

I added your tag, but please let me know if you have any issue with the updated change in patch #1.

cheers

- Differences to v1
- fix x86 clang build by adding extra build swicth for _{in,out}X
- added Arnd's RB tag

John Garry (3):
io: Provide _inX() and _outX()
logic_pio: Improve macro argument name
logic_pio: Use _inX() and _outX()

 include/asm-generic/io.h | 64 +++++++++++++++++++++++++++++++++---------------
 lib/logic_pio.c          | 22 ++++++++---------
 2 files changed, 55 insertions(+), 31 deletions(-)
Signature · 1 line
2.16.4