linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 00/11] mm: ioremap:  Convert architectures to take GENERIC_IOREMAP way
@ 2022-08-20  0:31 Baoquan He
  2022-08-20  0:31 ` [PATCH v2 01/11] mm/ioremap: change the return value of io[re|un]map_allowed and rename Baoquan He
                   ` (10 more replies)
  0 siblings, 11 replies; 70+ messages in thread
From: Baoquan He @ 2022-08-20  0:31 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-mm, akpm, hch, agordeev, wangkefeng.wang, linux-arm-kernel,
	Baoquan He

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 codes of ioremap() and iounmap().

In this patchset, firstly adapt the hooks io[re|un]map_allowed, then
make use of them to convert those ARCH-es to take GENERIC_IOREMAP method.
With these change, duplicated ioremap/iounmap() code uder ARCH-es are
removed.

This is suggested by Christoph in below discussion:
https://lore.kernel.org/all/Yp7h0Jv6vpgt6xdZ@infradead.org/T/#u

And it's basically further action after arm64 has converted to
GENERIC_IOREMAP way in below patchset.
[PATCH v5 0/6] arm64: Cleanup ioremap() and support ioremap_prot()
https://lore.kernel.org/all/20220607125027.44946-1-wangkefeng.wang@huawei.com/T/#u

And some change of io[re|un]map_allowed() is borrowed from the v3 of
arm64 converting patch.
[PATCH v3 4/6] mm: ioremap: Add arch_ioremap/iounmap()
https://lore.kernel.org/all/20220519082552.117736-5-wangkefeng.wang@huawei.com/T/#u

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().

Testing:
It passes the testing on arm64. For other ARCHes, I only tried to pass
build with existing RPMs of cross compiling tools. ARCHes like openrisc,
parisc, don't build because of lack of cross compiling RPMS.

Baoquan He (11):
  mm/ioremap: change the return value of io[re|un]map_allowed and rename
  mm: ioremap: fixup the physical address and page prot
  mm: ioremap: allow ARCH to have its own ioremap definition
  arc: mm: Convert to GENERIC_IOREMAP
  hexagon: mm: Convert to GENERIC_IOREMAP
  ia64: mm: Convert to GENERIC_IOREMAP
  openrisc: mm: Convert to GENERIC_IOREMAP
  parisc: mm: Convert to GENERIC_IOREMAP
  s390: mm: Convert to GENERIC_IOREMAP
  sh: mm: Convert to GENERIC_IOREMAP
  xtensa: mm: Convert to GENERIC_IOREMAP

 arch/arc/Kconfig               |  1 +
 arch/arc/include/asm/io.h      | 19 +++++++---
 arch/arc/mm/ioremap.c          | 60 +++++--------------------------
 arch/arm64/include/asm/io.h    |  5 +--
 arch/arm64/mm/ioremap.c        | 16 ++++++---
 arch/hexagon/Kconfig           |  1 +
 arch/hexagon/include/asm/io.h  |  9 +++--
 arch/hexagon/mm/ioremap.c      | 44 -----------------------
 arch/ia64/Kconfig              |  1 +
 arch/ia64/include/asm/io.h     | 26 ++++++++------
 arch/ia64/mm/ioremap.c         | 50 ++++++--------------------
 arch/openrisc/Kconfig          |  1 +
 arch/openrisc/include/asm/io.h | 16 ++++++---
 arch/openrisc/mm/ioremap.c     | 51 +++++++++-----------------
 arch/parisc/Kconfig            |  1 +
 arch/parisc/include/asm/io.h   | 16 ++++++---
 arch/parisc/mm/ioremap.c       | 65 ++++------------------------------
 arch/s390/Kconfig              |  1 +
 arch/s390/include/asm/io.h     | 26 +++++++++-----
 arch/s390/pci/pci.c            | 60 +++++--------------------------
 arch/sh/Kconfig                |  1 +
 arch/sh/include/asm/io.h       | 47 ++++++++----------------
 arch/sh/mm/ioremap.c           | 61 ++++++-------------------------
 arch/xtensa/Kconfig            |  1 +
 arch/xtensa/include/asm/io.h   | 39 +++++++++-----------
 arch/xtensa/mm/ioremap.c       | 56 +++++++----------------------
 include/asm-generic/io.h       | 34 ++++++++++--------
 mm/ioremap.c                   | 12 ++++---
 28 files changed, 230 insertions(+), 490 deletions(-)
 delete mode 100644 arch/hexagon/mm/ioremap.c

-- 
2.34.1


^ permalink raw reply	[flat|nested] 70+ messages in thread

end of thread, other threads:[~2022-09-22 13:23 UTC | newest]

Thread overview: 70+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-20  0:31 [PATCH v2 00/11] mm: ioremap: Convert architectures to take GENERIC_IOREMAP way Baoquan He
2022-08-20  0:31 ` [PATCH v2 01/11] mm/ioremap: change the return value of io[re|un]map_allowed and rename Baoquan He
2022-08-21  6:53   ` Christoph Hellwig
2022-08-22 23:55     ` Baoquan He
2022-08-22  6:25   ` Christophe Leroy
2022-08-23  0:20     ` Baoquan He
2022-08-23  5:24       ` Christophe Leroy
2022-08-23 15:14         ` Baoquan He
2022-08-23 15:26           ` Christophe Leroy
2022-08-24  8:16             ` David Laight
2022-08-28 14:44               ` Baoquan He
2022-08-28  8:36   ` Alexander Gordeev
2022-08-28  9:55     ` Baoquan He
2022-08-20  0:31 ` [PATCH v2 02/11] mm: ioremap: fixup the physical address and page prot Baoquan He
2022-08-21  6:54   ` Christoph Hellwig
2022-08-23  1:13     ` Baoquan He
2022-08-22  6:30   ` Christophe Leroy
2022-08-23  1:19     ` Baoquan He
2022-08-23  5:33       ` Christophe Leroy
2022-08-23 12:32         ` Baoquan He
2022-08-23 19:03           ` Christophe Leroy
2022-08-28 11:10             ` Baoquan He
2022-09-12  2:55               ` Baoquan He
2022-09-12  7:10                 ` Christophe Leroy
2022-09-13 15:11                   ` Baoquan He
2022-09-21 16:40                     ` Christophe Leroy
2022-09-22 13:23                       ` Baoquan He
2022-08-20  0:31 ` [PATCH v2 03/11] mm: ioremap: allow ARCH to have its own ioremap definition Baoquan He
2022-08-21  6:57   ` Christoph Hellwig
2022-08-23  2:42     ` Baoquan He
2022-08-20  0:31 ` [PATCH v2 04/11] arc: mm: Convert to GENERIC_IOREMAP Baoquan He
2022-08-20  0:31 ` [PATCH v2 05/11] hexagon: " Baoquan He
2022-08-20  1:23   ` Brian Cain
2022-08-21  7:00   ` Christoph Hellwig
2022-08-28 15:08     ` Baoquan He
2022-08-22  6:38   ` Christophe Leroy
2022-08-28 15:12     ` Baoquan He
2022-08-20  0:31 ` [PATCH v2 06/11] ia64: " Baoquan He
2022-08-21  7:02   ` Christoph Hellwig
2022-08-28 15:12     ` Baoquan He
2022-08-20  0:31 ` [PATCH v2 07/11] openrisc: " Baoquan He
2022-08-21  7:03   ` Christoph Hellwig
2022-08-29  1:40     ` Baoquan He
2022-08-29  6:42       ` Stafford Horne
2022-08-29  8:18         ` Baoquan He
2022-08-30  6:05     ` Christophe Leroy
2022-08-29  6:32   ` Stafford Horne
2022-08-29  8:19     ` Baoquan He
2022-08-20  0:31 ` [PATCH v2 08/11] parisc: " Baoquan He
2022-08-20  4:03   ` kernel test robot
2022-08-21 10:26     ` Baoquan He
2022-08-21 14:18       ` Helge Deller
2022-08-30 13:00     ` Baoquan He
2022-08-20  0:31 ` [PATCH v2 09/11] s390: " Baoquan He
2022-08-21  7:05   ` Christoph Hellwig
2022-08-22 15:08     ` Niklas Schnelle
2022-08-31  8:59       ` Baoquan He
2022-08-22 15:19   ` Niklas Schnelle
2022-08-31  8:58     ` Baoquan He
2022-08-23 12:30   ` Niklas Schnelle
2022-08-31  8:50     ` Baoquan He
2022-08-20  0:31 ` [PATCH v2 10/11] sh: " Baoquan He
2022-08-20  3:41   ` kernel test robot
2022-09-01 10:39     ` Baoquan He
2022-09-01 12:11       ` [kbuild-all] " Chen, Rong A
2022-09-01 12:31         ` Baoquan He
2022-09-02  9:48     ` Baoquan He
2022-08-21  7:06   ` Christoph Hellwig
2022-09-01  7:36     ` Baoquan He
2022-08-20  0:31 ` [PATCH v2 11/11] xtensa: " Baoquan He

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).