mm: ioremap: Convert architectures to take GENERIC_IOREMAP way
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v8 Latest19 patches 7 repliesIn review 18 of 19 applied
- v719 patches 13 repliesSuperseded
- v619 patches 17 repliesApplied
Earlier versions · 6
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v5 posting 2/2 | 17 patches | 59 replies | Superseded | |
| v5 posting 1/2 | 17 patches | 3 replies | Superseded | |
| v4 | 16 patches | 19 replies | Superseded | |
| v3 | 11 patches | 16 replies | Superseded | |
| v2 | 11 patches | 56 replies | Superseded | |
| v1 | 11 patches | 9 replies | Superseded |
Changes in v8 from the cover letter
- Fix the error reported by lkp test robot on patch [PATCH v7 02/19] hexagon: mm: Convert to GENERIC_IOREMAP Thanks to Nathan for providing the code fix after reproducing.
- Fix the conflict in patch 15 when rebasing to latest linus's tree because of earlier commit ef104443bffa.
Patches in v8 18 of 19 applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/19 | asm-generic/iomap.h: remove ARCH_HAS_IOREMAP_xx macrosarch/ arch/ arch/ +6 more | +8 | 0 replies | Applied |
| 2/19 | hexagon: mm: Convert to GENERIC_IOREMAParch/ arch/ arch/ +2 more | +9 | 1 reply | Applied |
| 3/19 | openrisc: mm: remove unneeded early ioremap codearch/ | +5 | 0 replies | Applied |
| 4/19 | mm/ioremap: Define generic_ioremap_prot() and generic_iounmap()include/ mm/ | +20 | 0 replies | Applied |
| 5/19 | mm: ioremap: allow ARCH to have its own ioremap method definitioninclude/ mm/ | +7 | 0 replies | Applied |
| 6/19 | mm/ioremap: add slab availability checking in ioremap_protmm/ | +4 | 0 replies | Applied |
| 7/19 | arc: mm: Convert to GENERIC_IOREMAParch/ arch/ arch/ | +8 | 0 replies | Applied |
| 8/19 | ia64: mm: Convert to GENERIC_IOREMAParch/ arch/ arch/ | +12 | 0 replies | Applied |
| 9/19 | openrisc: mm: Convert to GENERIC_IOREMAParch/ arch/ arch/ | +7 | 0 replies | Applied |
| 10/19 | s390: mm: Convert to GENERIC_IOREMAParch/ arch/ arch/ +1 more | +24 | 0 replies | Applied |
| 11/19 | sh: add <asm-generic/io.h> includingarch/ arch/ | +32 | 6 replies | |
| 12/19 | sh: mm: Convert to GENERIC_IOREMAParch/ arch/ arch/ | +20 | 0 replies | Applied |
| 13/19 | xtensa: mm: Convert to GENERIC_IOREMAParch/ arch/ arch/ | +27 | 0 replies | Applied |
| 14/19 | parisc: mm: Convert to GENERIC_IOREMAParch/ arch/ arch/ | +15 | 0 replies | Applied |
| 15/19 | mm/ioremap: Consider IOREMAP space in generic ioremapmm/ | +12 | 0 replies | Applied |
| 16/19 | mm: move is_ioremap_addr() into new header filearch/ include/ include/ +2 more | +32 | 0 replies | Applied |
| 17/19 | powerpc: mm: Convert to GENERIC_IOREMAParch/ arch/ arch/ +2 more | +16 | 0 replies | Applied |
| 18/19 | arm64 : mm: add wrapper function ioremap_prot()arch/ arch/ | +7 | 0 replies | Applied |
| 19/19 | mm: ioremap: remove unneeded ioremap_allowed and iounmap_allowedinclude/ mm/ | +0 | 0 replies | Applied |
Reviews trailers per patch
18 of 19 patches have a Reviewed-by or Acked-by.
| Patch | Geert Uytterhoeven | Mike Rapoport (IBM) | Christoph Hellwig | Stafford Horne | Kefeng Wang | Arnd Bergmann | Niklas Schnelle | Helge Deller | Catalin Marinas | John Paul Adrian Glaubitz |
|---|---|---|---|---|---|---|---|---|---|---|
| 1/19 | A-b | R-b | R-b | |||||||
| 2/19 | R-b | |||||||||
| 3/19 | R-b | R-b | A-b | |||||||
| 4/19 | R-b | R-b | R-b | |||||||
| 5/19 | R-b | R-b | R-b | A-b | ||||||
| 6/19 | R-b | R-b | R-b | |||||||
| 7/19 | R-b | R-b | ||||||||
| 8/19 | R-b | R-b | ||||||||
| 9/19 | R-b | R-b | ||||||||
| 10/19 | R-b | R-b | R-b T-b | |||||||
| 11/19 | A-b | |||||||||
| 12/19 | ||||||||||
| 13/19 | R-b | R-b | ||||||||
| 14/19 | R-b | R-b | A-b | |||||||
| 15/19 | R-b | |||||||||
| 16/19 | R-b | |||||||||
| 17/19 | R-b | R-b | ||||||||
| 18/19 | R-b | R-b | R-b | A-b | ||||||
| 19/19 | R-b | R-b | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 10 reviewers.
Cover letter [PATCH v8 00/19] mm: ioremap: Convert architectures to take GENERIC_IOREMAP way
Motivation and implementation:
==============================
Currently, many architecutres have't taken the standard GENERIC_IOREMAP way to implement ioremap_prot(), iounmap(), and ioremap_xx(), but make these functions specifically under each arch's folder. Those cause many duplicated code of ioremap() and iounmap().
In this patchset, firstly introduce generic_ioremap_prot() and generic_iounmap() to extract the generic code for GENERIC_IOREMAP. By taking GENERIC_IOREMAP method, the generic generic_ioremap_prot(), generic_iounmap(), and their generic wrapper ioremap_prot(), ioremap() and iounmap() are all visible and available to arch. Arch needs to provide wrapper functions to override the generic version if there's arch specific handling in its corresponding ioremap_prot(), ioremap() or iounmap(). With these changes, duplicated ioremap/iounmap() code uder ARCH-es are removed, and the equivalent functioality is kept as before.
Background info:
================
1)
The converting more architectures to take GENERIC_IOREMAP way is suggested by Christoph in below discussion:
https://lore.kernel.org/all/[email protected]/T/#u
2)
In the previous v1 to v3, it's basically further action after arm64 has converted to GENERIC_IOREMAP way in below patchset. It's done by adding hook ioremap_allowed() and iounmap_allowed() in ARCH to add ARCH specific handling the middle of ioremap_prot() and iounmap().
[PATCH v5 0/6] arm64: Cleanup ioremap() and support ioremap_prot()
https://lore.kernel.org/all/[email protected]/T/#u
Later, during v3 reviewing, Christophe Leroy suggested to introduce generic_ioremap_prot() and generic_iounmap() to generic codes, and ARCH can provide wrapper function ioremap_prot(), ioremap() or iounmap() if needed. Christophe made a RFC patchset as below to specially demonstrate his idea. This is what v4 and now v5 is doing.
[RFC PATCH 0/8] mm: ioremap: Convert architectures to take GENERIC_IOREMAP way
https://lore.kernel.org/all/[email protected]/T/#u
Testing:
========
In v8, I only applied this patchset onto the latest linus's tree to build and run on arm64 and s390.
History:
=======v7->v8:
- Fix the error reported by lkp test robot on patch [PATCH v7 02/19] hexagon: mm: Convert to GENERIC_IOREMAP Thanks to Nathan for providing the code fix after reproducing.
- Fix the conflict in patch 15 when rebasing to latest linus's tree because of earlier commit ef104443bffa.
v6->v7:
- Fix the building error on s390 and hexagon reported by lkp test robot.
- Add Christoph, Mike, Catalin and Helge's ack.
v5->v6:
- Remove stale descriptions in log - Mike
- Remove the early unmapping handling from fixmap pool in iounmap() in openrisc; Based on that, iounmap() in openrisc ARCH can be removed - Mike
- Add WARN_ON_ONCE to aid debugging in generic_ioremap_prot() - Christoph
- Split the inclusion of include/asm-generic/io.h and redefining of the helpers from the old patch 11 into a prep patch; The following patch can only contain code converting to GENERIC_IOREMAP for SuperH - Christoph
- Add header file linux/ioremap.h and move is_ioremap_addr() over there - Christoph
v4->v5:
- Ard and Christophe suggested adding a preparation patch to remove ARCH_HAS_IOREMAP_xx macros, this is done in newly added patch 1.
- In the current patch 13 ("parisc: mm: Convert to GENERIC_IOREMAP"), so we don't need to add ARCH_HAS_IOREMAP_WC.
v3->v4:
- Change to contain arch specific handling in wrapper function ioremap(), ioremap_prot() or iounmap() to replace the old hook ioremap|iounmap_allowed() hook way for each arch.
- Add two patches to convert powerpc to GENERIC_IOREMAP. They are picked from above Christophe's RFC patchset, I made some changes to make them formal.
v2->v3:
- Rewrite log of all patches to add more details as Christoph suggested.
- Merge the old patch 1 and 2 which adjusts return values and parameters of arch_ioremap() into one patch, namely the current patch 3. Christoph suggested this.
- Change the return value of arch_iounmap() to bool type since we only do arch specific address filtering or address checking, bool value can reflect the checking better. This is pointed out by Niklas when he reviewed the s390 patch.
- Put hexagon patch at the beginning of patchset since hexagon has the same ioremap() and iounmap() as standard ones, no arch_ioremap() and arch_iounmap() hooks need be introduced. So the later arch_ioremap and arch_iounmap() adjustment are not related in hexagon. Christophe suggested this.
- Remove the early ioremap code from openrisc ioremap() firstly since openrisc doesn't have early ioremap handling in openrisc arch code. This simplifies the later converting to GENERIC_IOREMAP method. Christoph and Stafford suggersted this.
- Fix compiling erorrs reported by lkp in parisc and sh patches. Adding macro defintions for those port|mem io functions in <asm/io.h> to avoid repeated definition in <asm-generic/io.h>.
v1->v2:
- Rename io[re|un]map_allowed() to arch_io[re|un]map() and made some minor changes in patch 1~2 as per Alexander and Kefeng's suggestions. Accordingly, adjust patches~4~11 because of the renaming arch_io[re|un]map().
Baoquan He (16):
asm-generic/iomap.h: remove ARCH_HAS_IOREMAP_xx macros
hexagon: mm: Convert to GENERIC_IOREMAP
openrisc: mm: remove unneeded early ioremap code
mm: ioremap: allow ARCH to have its own ioremap method definition mm/ioremap: add slab availability checking in ioremap_prot
arc: mm: Convert to GENERIC_IOREMAP
ia64: mm: Convert to GENERIC_IOREMAP
openrisc: mm: Convert to GENERIC_IOREMAP
s390: mm: Convert to GENERIC_IOREMAP
sh: add <asm-generic/io.h> including
sh: mm: Convert to GENERIC_IOREMAP
xtensa: mm: Convert to GENERIC_IOREMAP
parisc: mm: Convert to GENERIC_IOREMAP
mm: move is_ioremap_addr() into new header file
arm64 : mm: add wrapper function ioremap_prot()
mm: ioremap: remove unneeded ioremap_allowed and iounmap_allowed
Christophe Leroy (3):
mm/ioremap: Define generic_ioremap_prot() and generic_iounmap() mm/ioremap: Consider IOREMAP space in generic ioremap
powerpc: mm: Convert to GENERIC_IOREMAP
arch/arc/Kconfig | 1 + arch/arc/include/asm/io.h | 7 ++- arch/arc/mm/ioremap.c | 49 ++--------------- arch/arm64/include/asm/io.h | 3 +- arch/arm64/mm/ioremap.c | 10 ++-- arch/hexagon/Kconfig | 1 + arch/hexagon/include/asm/io.h | 11 ++-- arch/hexagon/kernel/hexagon_ksyms.c | 2 - arch/hexagon/mm/Makefile | 2 +- arch/hexagon/mm/ioremap.c | 44 ---------------- arch/ia64/Kconfig | 1 + arch/ia64/include/asm/io.h | 13 ++--- arch/ia64/mm/ioremap.c | 41 +++------------ arch/loongarch/include/asm/io.h | 2 - arch/m68k/include/asm/io_mm.h | 2 - arch/m68k/include/asm/kmap.h | 2 - arch/mips/include/asm/io.h | 5 +- arch/openrisc/Kconfig | 1 + arch/openrisc/include/asm/io.h | 11 ++-- arch/openrisc/mm/ioremap.c | 82 ----------------------------- arch/parisc/Kconfig | 1 + arch/parisc/include/asm/io.h | 15 ++++-- arch/parisc/mm/ioremap.c | 62 ++-------------------- arch/powerpc/Kconfig | 1 + arch/powerpc/include/asm/io.h | 17 ++---- arch/powerpc/include/asm/pgtable.h | 10 ---- arch/powerpc/mm/ioremap.c | 26 +-------- arch/powerpc/mm/ioremap_32.c | 19 ++++--- arch/powerpc/mm/ioremap_64.c | 12 +---- arch/s390/Kconfig | 1 + arch/s390/include/asm/io.h | 21 ++++---- arch/s390/kernel/perf_cpum_sf.c | 2 +- arch/s390/pci/pci.c | 57 ++++---------------- arch/sh/Kconfig | 1 + arch/sh/include/asm/io.h | 65 ++++++++++++----------- arch/sh/include/asm/io_noioport.h | 7 +++ arch/sh/mm/ioremap.c | 65 ++++------------------- arch/x86/include/asm/io.h | 5 -- arch/xtensa/Kconfig | 1 + arch/xtensa/include/asm/io.h | 32 +++++------ arch/xtensa/mm/ioremap.c | 58 +++++--------------- drivers/net/ethernet/sfc/io.h | 2 +- drivers/net/ethernet/sfc/siena/io.h | 2 +- include/asm-generic/io.h | 31 +++-------- include/asm-generic/iomap.h | 6 +-- include/linux/ioremap.h | 30 +++++++++++ include/linux/mm.h | 5 -- kernel/iomem.c | 1 + mm/ioremap.c | 41 ++++++++++----- 49 files changed, 249 insertions(+), 637 deletions(-) delete mode 100644 arch/hexagon/mm/ioremap.c create mode 100644 include/linux/ioremap.h
Signature · 1 line
2.34.1