linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/4] sh: remove unused SLOW_DOWN_IO
@ 2022-10-21 19:36 Bjorn Helgaas
  2022-10-21 19:36 ` [PATCH v2 1/4] " Bjorn Helgaas
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Bjorn Helgaas @ 2022-10-21 19:36 UTC (permalink / raw)
  To: Rich Felker, Yoshinori Sato, linux-sh, linux-kernel, Bjorn Helgaas

Only alpha and sh define SLOW_DOWN_IO, and there are no uses of it.  Remove
it from sh and clean up some nearby macros.

These were previously posted 4/15/2022 at
  https://lore.kernel.org/all/20220415190817.842864-1-helgaas@kernel.org/
and reposted 10/13/2022 at
  https://lore.kernel.org/all/20221014001911.3342485-1-helgaas@kernel.org/

Changes from v1 to v2:
  - Drop the ia64 patch because Andrew applied it
      https://lore.kernel.org/all/20221021045245.99636C433C1@smtp.kernel.org/

  - Fix the sh build issues reported by the kernel test robot:
      https://lore.kernel.org/all/202210181211.ItV2YuJI-lkp@intel.com/

  - Add minor sh cleanup patches to __BUILD_IOPORT_SINGLE(),
    __BUILD_IOPORT_PFX(), and __BUILD_MEMORY_STRING()

  - Split sh and alpha to separate series

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
---
Bjorn Helgaas (4):
      sh: remove unused SLOW_DOWN_IO
      sh: remove unused __BUILD_IOPORT_SINGLE 'pfx' parameter
      sh: remove unnecessary __BUILD_IOPORT_PFX()
      sh: remove unnecessary __BUILD_MEMORY_STRING() 'pfx' parameter

 arch/sh/include/asm/io.h | 42 +++++++++++++-----------------------------
 1 file changed, 13 insertions(+), 29 deletions(-)
---
base-commit: f1947d7c8a61db1cb0ef909a6512ede0b1f2115b
change-id: 20221021-wip-bjorn-22-10-slow-down-io-be370a9a6ce2

Best regards,
-- 
Bjorn Helgaas <bhelgaas@google.com>

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

* [PATCH v2 1/4] sh: remove unused SLOW_DOWN_IO
  2022-10-21 19:36 [PATCH v2 0/4] sh: remove unused SLOW_DOWN_IO Bjorn Helgaas
@ 2022-10-21 19:36 ` Bjorn Helgaas
  2022-10-21 19:36 ` [PATCH v2 2/4] sh: remove unused __BUILD_IOPORT_SINGLE 'pfx' parameter Bjorn Helgaas
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Bjorn Helgaas @ 2022-10-21 19:36 UTC (permalink / raw)
  To: Rich Felker, Yoshinori Sato, linux-sh, linux-kernel, Bjorn Helgaas

io.h defines SLOW_DOWN_IO only when CONF_SLOWDOWN_IO is defined, but
CONF_SLOWDOWN_IO is never defined and is in fact explicitly undefined.
Remove SLOW_DOWN_IO and related code.

N.B. 37b7a97884ba ("sh: machvec IO death.") went to some trouble to add
CONF_SLOWDOWN_IO and SLOW_DOWN_IO, for no obvious reason.  Maybe there was
some out-of-tree case that used this.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: Rich Felker <dalias@libc.org>
Cc: linux-sh@vger.kernel.org
---
 arch/sh/include/asm/io.h | 19 +++----------------
 1 file changed, 3 insertions(+), 16 deletions(-)

diff --git a/arch/sh/include/asm/io.h b/arch/sh/include/asm/io.h
index fba90e670ed4..8043b7c235ca 100644
--- a/arch/sh/include/asm/io.h
+++ b/arch/sh/include/asm/io.h
@@ -121,11 +121,6 @@ __BUILD_MEMORY_STRING(__raw_, q, u64)
 
 #ifdef CONFIG_HAS_IOPORT_MAP
 
-/*
- * Slowdown I/O port space accesses for antique hardware.
- */
-#undef CONF_SLOWDOWN_IO
-
 /*
  * On SuperH I/O ports are memory mapped, so we access them using normal
  * load/store instructions. sh_io_port_base is the virtual address to
@@ -145,13 +140,7 @@ static inline void __set_io_port_base(unsigned long pbase)
 extern void __iomem *__ioport_map(unsigned long addr, unsigned int size);
 #endif
 
-#ifdef CONF_SLOWDOWN_IO
-#define SLOW_DOWN_IO __raw_readw(sh_io_port_base)
-#else
-#define SLOW_DOWN_IO
-#endif
-
-#define __BUILD_IOPORT_SINGLE(pfx, bwlq, type, p, slow)			\
+#define __BUILD_IOPORT_SINGLE(pfx, bwlq, type, p)			\
 									\
 static inline void pfx##out##bwlq##p(type val, unsigned long port)	\
 {									\
@@ -159,7 +148,6 @@ static inline void pfx##out##bwlq##p(type val, unsigned long port)	\
 									\
 	__addr = __ioport_map(port, sizeof(type));			\
 	*__addr = val;							\
-	slow;								\
 }									\
 									\
 static inline type pfx##in##bwlq##p(unsigned long port)			\
@@ -169,14 +157,13 @@ static inline type pfx##in##bwlq##p(unsigned long port)			\
 									\
 	__addr = __ioport_map(port, sizeof(type));			\
 	__val = *__addr;						\
-	slow;								\
 									\
 	return __val;							\
 }
 
 #define __BUILD_IOPORT_PFX(bus, bwlq, type)				\
-	__BUILD_IOPORT_SINGLE(bus, bwlq, type, ,)			\
-	__BUILD_IOPORT_SINGLE(bus, bwlq, type, _p, SLOW_DOWN_IO)
+	__BUILD_IOPORT_SINGLE(bus, bwlq, type,)				\
+	__BUILD_IOPORT_SINGLE(bus, bwlq, type, _p)
 
 #define BUILDIO_IOPORT(bwlq, type)					\
 	__BUILD_IOPORT_PFX(, bwlq, type)

-- 
b4 0.10.1

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

* [PATCH v2 2/4] sh: remove unused __BUILD_IOPORT_SINGLE 'pfx' parameter
  2022-10-21 19:36 [PATCH v2 0/4] sh: remove unused SLOW_DOWN_IO Bjorn Helgaas
  2022-10-21 19:36 ` [PATCH v2 1/4] " Bjorn Helgaas
@ 2022-10-21 19:36 ` Bjorn Helgaas
  2022-10-21 19:36 ` [PATCH v2 3/4] sh: remove unnecessary __BUILD_IOPORT_PFX() Bjorn Helgaas
  2022-10-21 19:36 ` [PATCH v2 4/4] sh: remove unnecessary __BUILD_MEMORY_STRING() 'pfx' parameter Bjorn Helgaas
  3 siblings, 0 replies; 5+ messages in thread
From: Bjorn Helgaas @ 2022-10-21 19:36 UTC (permalink / raw)
  To: Rich Felker, Yoshinori Sato, linux-sh, linux-kernel, Bjorn Helgaas

Previously __BUILD_IOPORT_SINGLE() accepted a "pfx" parameter, to which
__BUILD_IOPORT_PFX(), the only user of __BUILD_IOPORT_SINGLE(), passed
along its own "bus" parameter.  But users of __BUILD_IOPORT_PFX() supplied
nothing, so both "bus" and "pfx" are pointless.  Remove them.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
---
 arch/sh/include/asm/io.h | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/arch/sh/include/asm/io.h b/arch/sh/include/asm/io.h
index 8043b7c235ca..193640bd9563 100644
--- a/arch/sh/include/asm/io.h
+++ b/arch/sh/include/asm/io.h
@@ -140,9 +140,9 @@ static inline void __set_io_port_base(unsigned long pbase)
 extern void __iomem *__ioport_map(unsigned long addr, unsigned int size);
 #endif
 
-#define __BUILD_IOPORT_SINGLE(pfx, bwlq, type, p)			\
+#define __BUILD_IOPORT_SINGLE(bwlq, type, p)				\
 									\
-static inline void pfx##out##bwlq##p(type val, unsigned long port)	\
+static inline void out##bwlq##p(type val, unsigned long port)		\
 {									\
 	volatile type *__addr;						\
 									\
@@ -150,7 +150,7 @@ static inline void pfx##out##bwlq##p(type val, unsigned long port)	\
 	*__addr = val;							\
 }									\
 									\
-static inline type pfx##in##bwlq##p(unsigned long port)			\
+static inline type in##bwlq##p(unsigned long port)			\
 {									\
 	volatile type *__addr;						\
 	type __val;							\
@@ -161,12 +161,12 @@ static inline type pfx##in##bwlq##p(unsigned long port)			\
 	return __val;							\
 }
 
-#define __BUILD_IOPORT_PFX(bus, bwlq, type)				\
-	__BUILD_IOPORT_SINGLE(bus, bwlq, type,)				\
-	__BUILD_IOPORT_SINGLE(bus, bwlq, type, _p)
+#define __BUILD_IOPORT_PFX(bwlq, type)					\
+	__BUILD_IOPORT_SINGLE(bwlq, type,)				\
+	__BUILD_IOPORT_SINGLE(bwlq, type, _p)
 
 #define BUILDIO_IOPORT(bwlq, type)					\
-	__BUILD_IOPORT_PFX(, bwlq, type)
+	__BUILD_IOPORT_PFX(bwlq, type)
 
 BUILDIO_IOPORT(b, u8)
 BUILDIO_IOPORT(w, u16)

-- 
b4 0.10.1

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

* [PATCH v2 3/4] sh: remove unnecessary __BUILD_IOPORT_PFX()
  2022-10-21 19:36 [PATCH v2 0/4] sh: remove unused SLOW_DOWN_IO Bjorn Helgaas
  2022-10-21 19:36 ` [PATCH v2 1/4] " Bjorn Helgaas
  2022-10-21 19:36 ` [PATCH v2 2/4] sh: remove unused __BUILD_IOPORT_SINGLE 'pfx' parameter Bjorn Helgaas
@ 2022-10-21 19:36 ` Bjorn Helgaas
  2022-10-21 19:36 ` [PATCH v2 4/4] sh: remove unnecessary __BUILD_MEMORY_STRING() 'pfx' parameter Bjorn Helgaas
  3 siblings, 0 replies; 5+ messages in thread
From: Bjorn Helgaas @ 2022-10-21 19:36 UTC (permalink / raw)
  To: Rich Felker, Yoshinori Sato, linux-sh, linux-kernel, Bjorn Helgaas

The only reason __BUILD_IOPORT_PFX() existed was to accept a "bus"
parameter, but nothing ever used that.  Remove __BUILD_IOPORT_PFX() and
collapse it into BUILDIO_IOPORT().

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
---
 arch/sh/include/asm/io.h | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/arch/sh/include/asm/io.h b/arch/sh/include/asm/io.h
index 193640bd9563..e29e8870dc3b 100644
--- a/arch/sh/include/asm/io.h
+++ b/arch/sh/include/asm/io.h
@@ -161,13 +161,10 @@ static inline type in##bwlq##p(unsigned long port)			\
 	return __val;							\
 }
 
-#define __BUILD_IOPORT_PFX(bwlq, type)					\
+#define BUILDIO_IOPORT(bwlq, type)					\
 	__BUILD_IOPORT_SINGLE(bwlq, type,)				\
 	__BUILD_IOPORT_SINGLE(bwlq, type, _p)
 
-#define BUILDIO_IOPORT(bwlq, type)					\
-	__BUILD_IOPORT_PFX(bwlq, type)
-
 BUILDIO_IOPORT(b, u8)
 BUILDIO_IOPORT(w, u16)
 BUILDIO_IOPORT(l, u32)

-- 
b4 0.10.1

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

* [PATCH v2 4/4] sh: remove unnecessary __BUILD_MEMORY_STRING() 'pfx' parameter
  2022-10-21 19:36 [PATCH v2 0/4] sh: remove unused SLOW_DOWN_IO Bjorn Helgaas
                   ` (2 preceding siblings ...)
  2022-10-21 19:36 ` [PATCH v2 3/4] sh: remove unnecessary __BUILD_IOPORT_PFX() Bjorn Helgaas
@ 2022-10-21 19:36 ` Bjorn Helgaas
  3 siblings, 0 replies; 5+ messages in thread
From: Bjorn Helgaas @ 2022-10-21 19:36 UTC (permalink / raw)
  To: Rich Felker, Yoshinori Sato, linux-sh, linux-kernel, Bjorn Helgaas

Previously __BUILD_MEMORY_STRING() accepted a "pfx" parameter, to which all
users passed "__raw_".  Simplify this by dropping the parameter and
encoding "__raw_" in the function name explicitly.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
---
 arch/sh/include/asm/io.h | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/arch/sh/include/asm/io.h b/arch/sh/include/asm/io.h
index e29e8870dc3b..179420fc4053 100644
--- a/arch/sh/include/asm/io.h
+++ b/arch/sh/include/asm/io.h
@@ -86,11 +86,11 @@ __BUILD_UNCACHED_IO(w, u16)
 __BUILD_UNCACHED_IO(l, u32)
 __BUILD_UNCACHED_IO(q, u64)
 
-#define __BUILD_MEMORY_STRING(pfx, bwlq, type)				\
+#define __BUILD_MEMORY_STRING(bwlq, type)				\
 									\
 static inline void							\
-pfx##writes##bwlq(volatile void __iomem *mem, const void *addr,		\
-		  unsigned int count)					\
+__raw_writes##bwlq(volatile void __iomem *mem, const void *addr,	\
+		   unsigned int count)					\
 {									\
 	const volatile type *__addr = addr;				\
 									\
@@ -100,8 +100,8 @@ pfx##writes##bwlq(volatile void __iomem *mem, const void *addr,		\
 	}								\
 }									\
 									\
-static inline void pfx##reads##bwlq(volatile void __iomem *mem,		\
-				    void *addr, unsigned int count)	\
+static inline void __raw_reads##bwlq(volatile void __iomem *mem,	\
+				     void *addr, unsigned int count)	\
 {									\
 	volatile type *__addr = addr;					\
 									\
@@ -111,13 +111,13 @@ static inline void pfx##reads##bwlq(volatile void __iomem *mem,		\
 	}								\
 }
 
-__BUILD_MEMORY_STRING(__raw_, b, u8)
-__BUILD_MEMORY_STRING(__raw_, w, u16)
+__BUILD_MEMORY_STRING(b, u8)
+__BUILD_MEMORY_STRING(w, u16)
 
 void __raw_writesl(void __iomem *addr, const void *data, int longlen);
 void __raw_readsl(const void __iomem *addr, void *data, int longlen);
 
-__BUILD_MEMORY_STRING(__raw_, q, u64)
+__BUILD_MEMORY_STRING(q, u64)
 
 #ifdef CONFIG_HAS_IOPORT_MAP
 

-- 
b4 0.10.1

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

end of thread, other threads:[~2022-10-21 19:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-21 19:36 [PATCH v2 0/4] sh: remove unused SLOW_DOWN_IO Bjorn Helgaas
2022-10-21 19:36 ` [PATCH v2 1/4] " Bjorn Helgaas
2022-10-21 19:36 ` [PATCH v2 2/4] sh: remove unused __BUILD_IOPORT_SINGLE 'pfx' parameter Bjorn Helgaas
2022-10-21 19:36 ` [PATCH v2 3/4] sh: remove unnecessary __BUILD_IOPORT_PFX() Bjorn Helgaas
2022-10-21 19:36 ` [PATCH v2 4/4] sh: remove unnecessary __BUILD_MEMORY_STRING() 'pfx' parameter Bjorn Helgaas

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