linux-m68k.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v7 00/10] Consolidate IO memcpy functions
@ 2024-09-30 13:23 Julian Vetter
  2024-09-30 13:23 ` [PATCH v7 01/10] Consolidate IO memcpy/memset into iomap_copy.c Julian Vetter
                   ` (10 more replies)
  0 siblings, 11 replies; 23+ messages in thread
From: Julian Vetter @ 2024-09-30 13:23 UTC (permalink / raw)
  To: Arnd Bergmann, Russell King, Catalin Marinas, Will Deacon,
	Guo Ren, Huacai Chen, WANG Xuerui, Andrew Morton,
	Geert Uytterhoeven, Richard Henderson, Ivan Kokshaysky,
	Matt Turner, James E . J . Bottomley, Helge Deller,
	Yoshinori Sato, Rich Felker, John Paul Adrian Glaubitz,
	Richard Weinberger, Anton Ivanov, Johannes Berg
  Cc: linux-arm-kernel, linux-kernel, linux-csky, loongarch, linux-m68k,
	linux-alpha, linux-parisc, linux-sh, linux-um, linux-arch,
	Yann Sionneau, Julian Vetter

Thank you all for your remarks. I have addressed your feedback. I have
also added the full history of the patchset, because it now targets
additional architectures.

Arnd: Unfortunately when adding the prototypes as 'extern ..' into
asm-generic/io.h they conflict with some individual implementations
(namely m68k, alpha, parisc, and sh). So, I have aligned these functions
to match the prototypes in asm-generic/io.h.
For the um problem, unfortunately there are A LOT of drivers that use
these IO memcpy functions, so I went a bit the lazy route and added
dummy functions to um's io.h.

David: Thank you for your remarks. I have replaced the mix of long,
uintptr_t, etc. all by long + sizeof(long). I have also split the
read/write operation from the put/get_unaligned into two lines for
better readability.

Signed-off-by: Julian Vetter <jvetter@kalrayinc.com>
---
Changes for v7:
- Added dummy implementations for memcpy_{to,from}io and memset_io on um
  architecture so drivers that use these functions build for um
- Replaced all accesses and checks by long type
- Added function prototypes as extern to asm-generic/io.h
- Removed '__' from the 3 new function names
- Some archs implement their own version of these IO functions with
  slightly different prototypes. So, I added 3 new patches to align
  prototypes with new ones in iomap_copy.c + io.h

Changes for v6:
- Added include of linux/align.h to fix build on arm arch
- Replaced compile-time check by ifdef for the CONFIG_64BIT otherwise we
  get a warning for the 'qc << 32' for archs with 32bit int types
- Suffixed arch commits by arch name

Changes for v5:
- Added functions to iomap_copy.c as proposed by Arndt
- Removed again the new io_copy.c and related objects
- Removed GENERIC_IO_COPY symbol and instead rely on the existing
  HAS_IOMEM symbol
- Added prototypes of __memcpy_{to,from}io and __memset_io functions to
  asm-generic/io.h

Changes for v4:
- Replaced memcpy/memset in asm-generic/io.h by the new
  __memcpy_{to,from}io and __memset_io, so individual architectures can
  use it instead of using their own implementation.

Changes for v3:
- Replaced again 'if(IS_ENABLED(CONFIG_64BIT))' by '#ifdef CONFIG_64BIT'
  because on 32bit architectures (e.g., csky), __raw_{read,write}q are
  not defined. So, it leads to compilation errors

Changes for v2:
- Renamed io.c -> io_copy.c
- Updated flag to 'GENERIC_IO_COPY'
- Replaced pointer dereferences by 'put_unaligned()'/'get_unaligned()'
- Replaced '#ifdef CONFIG_64BIT' by 'if(IS_ENABLED(CONFIG_64BIT))'
- Removed '__raw_{read,write}_native' and replaced by
  'if(IS_ENABLED(CONFIG_64BIT))' -> '__raw_write{l,q}'
---
Julian Vetter (10):
  Consolidate IO memcpy/memset into iomap_copy.c
  arm64: Use generic IO memcpy/memset
  csky: Use generic IO memcpy/memset
  loongarch: Use generic IO memcpy/memset
  m68k: Align prototypes of IO memcpy/memset
  alpha: Align prototypes of IO memcpy/memset
  parisc: Align prototypes of IO memcpy/memset
  sh: Align prototypes of IO memcpy/memset
  um: Add dummy implementation for IO memcpy/memset
  arm: Align prototype of IO memset

 arch/alpha/include/asm/io.h     |   6 +-
 arch/alpha/kernel/io.c          |   4 +-
 arch/arm/include/asm/io.h       |   2 +-
 arch/arm64/include/asm/io.h     |  11 ---
 arch/arm64/kernel/io.c          |  87 ---------------------
 arch/csky/include/asm/io.h      |  11 ---
 arch/csky/kernel/Makefile       |   2 +-
 arch/csky/kernel/io.c           |  91 ----------------------
 arch/loongarch/include/asm/io.h |  10 ---
 arch/loongarch/kernel/Makefile  |   2 +-
 arch/loongarch/kernel/io.c      |  94 ----------------------
 arch/m68k/include/asm/kmap.h    |   8 +-
 arch/parisc/include/asm/io.h    |   3 -
 arch/parisc/lib/io.c            |   6 +-
 arch/sh/include/asm/io.h        |   3 -
 arch/sh/kernel/io.c             |   6 +-
 arch/um/include/asm/io.h        |  17 ++++
 include/asm-generic/io.h        |  58 ++------------
 lib/iomap_copy.c                | 133 ++++++++++++++++++++++++++++++++
 19 files changed, 173 insertions(+), 381 deletions(-)
 delete mode 100644 arch/csky/kernel/io.c
 delete mode 100644 arch/loongarch/kernel/io.c

-- 
2.34.1






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

end of thread, other threads:[~2024-10-07  8:06 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-30 13:23 [PATCH v7 00/10] Consolidate IO memcpy functions Julian Vetter
2024-09-30 13:23 ` [PATCH v7 01/10] Consolidate IO memcpy/memset into iomap_copy.c Julian Vetter
2024-10-03  4:23   ` kernel test robot
2024-10-03 16:46   ` Richard Henderson
2024-10-06 18:50     ` David Laight
2024-09-30 13:23 ` [PATCH v7 02/10] arm64: Use generic IO memcpy/memset Julian Vetter
2024-09-30 13:23 ` [PATCH v7 03/10] csky: " Julian Vetter
2024-09-30 13:23 ` [PATCH v7 04/10] loongarch: " Julian Vetter
2024-09-30 13:23 ` [PATCH v7 05/10] m68k: Align prototypes of " Julian Vetter
2024-09-30 17:46   ` Geert Uytterhoeven
2024-09-30 13:23 ` [PATCH v7 06/10] alpha: " Julian Vetter
2024-10-03 14:46   ` Richard Henderson
2024-09-30 13:23 ` [PATCH v7 07/10] parisc: " Julian Vetter
2024-10-03 14:49   ` Richard Henderson
2024-09-30 13:23 ` [PATCH v7 08/10] sh: " Julian Vetter
2024-09-30 17:52   ` Geert Uytterhoeven
2024-09-30 13:23 ` [PATCH v7 09/10] um: Add dummy implementation for " Julian Vetter
2024-10-01 12:53   ` Johannes Berg
2024-10-07  7:49     ` Julian Vetter
2024-10-07  8:06       ` Johannes Berg
2024-09-30 13:23 ` [PATCH v7 10/10] arm: Align prototype of IO memset Julian Vetter
2024-09-30 17:50   ` Geert Uytterhoeven
2024-10-01 12:46 ` [PATCH v7 00/10] Consolidate IO memcpy functions Niklas Schnelle

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