Generic Linux architectural discussions
 help / color / mirror / Atom feed
* [PATCH v9 0/4] Consolidate IO memcpy functions
@ 2024-10-10 12:36 Julian Vetter
  2024-10-10 12:36 ` [PATCH v9 1/4] Consolidate IO memcpy/memset into iomem_copy.c Julian Vetter
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Julian Vetter @ 2024-10-10 12:36 UTC (permalink / raw)
  To: Arnd Bergmann, Catalin Marinas, Will Deacon, Guo Ren, Huacai Chen,
	WANG Xuerui, Andrew Morton, Geert Uytterhoeven, Richard Henderson,
	Niklas Schnelle, Takashi Iwai, Miquel Raynal, David Laight,
	Johannes Berg, Christoph Hellwig
  Cc: linux-arm-kernel, linux-kernel, linux-csky, loongarch, linux-arch,
	Yann Sionneau, Julian Vetter

Thank you for your remarks Arnd and Christoph. You're right the patches
got a bit out of hand. I have now guarded the prototypes as well with
'#ifndef' and I have dropped the other unnecessary patches for now.

Thank you Niklas for testing the changes on s390! I have dropped the
according patch for now. But I will send it to the s390 mailinglist as a
separate patch.

Thank you Takashi for ack'ing the patch 14. I will send this one as well
as a separate patch to the UM mailinglist.

Signed-off-by: Julian Vetter <jvetter@kalrayinc.com>
---
Changes for v9:
- Moved functions into a new file iomem_copy.c which is built
  unconditionally
- Guard prototypes with '#ifndef memcpy_fromio', etc.
- Dropped patches 5 to 14 for now. I will send some of the changes in
  separate patches or patchsets to the appropriate mailinglists
- Added proper reviewed-by and acked-by to arm64 and csky patches

Changes for v8:
- Dropped the arch/um patch that adds dummy implementations for IO
  memcpy functions
- Added 3 new patches that fix the dependency problem for UM (added
  dependencies on HAS_IOMEM || INDIRECT_IOMEM)
- Added new patch for s390 to internally call the zpci_memcpy functions
  and not the generic ones from libs/iomap_copy.c
- Addressed reviewer comments and replaced 2 or 3 shifts by
  'qc *= ~0UL / 0xff;'
- Addressed reviewer comments on pasrisc (masking the int value)
- Addressed reviewer comments on alpha (masking the int value)

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 (4):
  Consolidate IO memcpy/memset into iomem_copy.c
  arm64: Use generic IO memcpy/memset
  csky: Use generic IO memcpy/memset
  loongarch: Use generic IO memcpy/memset

 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 ----------------------
 include/asm-generic/io.h        |  62 +++------------
 lib/Makefile                    |   2 +-
 lib/iomem_copy.c                | 134 ++++++++++++++++++++++++++++++++
 11 files changed, 147 insertions(+), 359 deletions(-)
 delete mode 100644 arch/csky/kernel/io.c
 delete mode 100644 arch/loongarch/kernel/io.c
 create mode 100644 lib/iomem_copy.c

-- 
2.34.1






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

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

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-10 12:36 [PATCH v9 0/4] Consolidate IO memcpy functions Julian Vetter
2024-10-10 12:36 ` [PATCH v9 1/4] Consolidate IO memcpy/memset into iomem_copy.c Julian Vetter
2024-10-11  7:49   ` Christoph Hellwig
2024-10-11  8:23   ` Arnd Bergmann
2024-10-10 12:36 ` [PATCH v9 2/4] arm64: Use generic IO memcpy/memset Julian Vetter
2024-10-10 12:36 ` [PATCH v9 3/4] csky: " Julian Vetter
2024-10-10 12:36 ` [PATCH v9 4/4] loongarch: " Julian Vetter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox