Skip to content

RFC powerpc: make iowrite32be etc. inline

Rasmus Villemoes linux-arch linuxppc-dev lkml oe-kbuild-all 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest5 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5asm-generic: move pcu_iounmap from iomap.h to pci_iomap.hinclude/asm-generic/iomap.h include/asm-generic/pci_iomap.h+7 -100 replies
2/5asm-generic: employ "ifndef foo; define foo foo" idiom in iomap.hinclude/asm-generic/iomap.h+88 -60 replies
3/5powerpc: move pci_iounmap() from iomap.c to pci-common.carch/powerpc/kernel/iomap.c arch/powerpc/kernel/pci-common.c+13 -130 replies
4/5powerpc: make pcibios_vaddr_is_ioport() staticarch/powerpc/include/asm/pci-bridge.h arch/powerpc/kernel/pci-common.c+2 -110 replies
5/5powerpc: make iowrite32 and friends static inline when no indirectionarch/powerpc/include/asm/io.h arch/powerpc/kernel/Makefile+173 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH 0/5] powerpc: make iowrite32be etc. inline

When trying to make the QUICC Engine drivers compile on arm, I mechanically (with coccinelle) changed out_be32() to iowrite32be() etc. Christophe pointed out [1][2] that that would pessimize the powerpc SOCs since the IO accesses now incur a function call overhead. He asked that I try to make those io accessors inline on ppc, and this is the best I could come up with.

At first I tried something that wouldn't need to touch anything outside arch/powerpc/, but I ended up with conditional inclusion of asm-generic headers and/or duplicating a lot of their contents.

The diffstat may become a little better if kernel/iomap.c can indeed be removed (due to !CONFIG_PPC_INDIRECT_PIO && CONFIG_PPC_INDIRECT_MMIO never happening).

[1] https://lore.kernel.org/lkml/[email protected]/
[2] https://lore.kernel.org/lkml/[email protected]/

Rasmus Villemoes (5):
asm-generic: move pcu_iounmap from iomap.h to pci_iomap.h
asm-generic: employ "ifndef foo; define foo foo" idiom in iomap.h
powerpc: move pci_iounmap() from iomap.c to pci-common.c
powerpc: make pcibios_vaddr_is_ioport() static
powerpc: make iowrite32 and friends static inline when no indirection

 arch/powerpc/include/asm/io.h         | 172 ++++++++++++++++++++++++++
 arch/powerpc/include/asm/pci-bridge.h |   9 --
 arch/powerpc/kernel/Makefile          |   2 +-
 arch/powerpc/kernel/iomap.c           |  13 --
 arch/powerpc/kernel/pci-common.c      |  15 ++-
 include/asm-generic/iomap.h           | 104 +++++++++++++---
 include/asm-generic/pci_iomap.h       |   7 ++
 7 files changed, 282 insertions(+), 40 deletions(-)
Signature · 1 line
2.23.0