Remove unused SLOW_DOWN_IO
Subsystems (8)
cover Remove unused SLOW_DOWN_IO
From: Bjorn Helgaas <[email protected]>
Only alpha, ia64, powerpc, and sh define SLOW_DOWN_IO, and there are no actual uses of it. The few references to it are in situations that are themselves unused. Remove them all.
It should be safe to apply these independently and in any order. The only place SLOW_DOWN_IO is used at all is the lmc_var.h definition of DELAY, which is itself never used.
Bjorn Helgaas (7):
net: wan: atp: remove unused eeprom_delay()
net: wan: lmc: remove unused DELAY()
net: remove comments that mention obsolete __SLOW_DOWN_IO
sh: remove unused SLOW_DOWN_IO
powerpc: Remove unused SLOW_DOWN_IO definition
ia64: remove unused __SLOW_DOWN_IO and SLOW_DOWN_IO definitions
alpha: remove unused __SLOW_DOWN_IO and SLOW_DOWN_IO definitions
arch/alpha/include/asm/io.h | 4 ---- arch/ia64/include/asm/io.h | 4 ---- arch/powerpc/include/asm/io.h | 2 -- arch/sh/include/asm/io.h | 17 ++--------------- drivers/atm/nicstarmac.c | 5 ----- drivers/net/ethernet/dec/tulip/winbond-840.c | 2 -- drivers/net/ethernet/natsemi/natsemi.c | 2 -- drivers/net/ethernet/realtek/atp.h | 4 ---- drivers/net/wan/lmc/lmc_main.c | 8 -------- drivers/net/wan/lmc/lmc_var.h | 8 -------- 10 files changed, 2 insertions(+), 54 deletions(-)
Signature · 1 line
2.25.1
PATCH 1/7 net: wan: atp: remove unused eeprom_delay()
From: Bjorn Helgaas <[email protected]>
atp.h is included only by atp.c, which does not use eeprom_delay(). Remove the unused definition.
--- drivers/net/ethernet/realtek/atp.h | 4 ---- 1 file changed, 4 deletions(-)
drivers/net/ethernet/realtek/atp.h +0 -4
@@ -255,10 +255,6 @@ static inline void write_word_mode0(short ioaddr, unsigned short value)#define EE_DATA_WRITE 0x01/* EEPROM chip data in. */ #define EE_DATA_READ 0x08/* EEPROM chip data out. */ -/* Delay between EEPROM clock transitions. */ -#define eeprom_delay (ticks) \ -do { int _i = 40; while (--_i > 0) { __SLOW_DOWN_IO; } } while (0) -/* The EEPROM commands include the alway-set leading bit. */ #define EE_WRITE_CMD (offset) (((5 << 6) + (offset)) << 17)#define EE_READ (offset) (((6 << 6) + (offset)) << 17)
Signature · 1 line
2.25.1
PATCH 2/7 net: wan: lmc: remove unused DELAY()
In reply to Bjorn HelgaasFrom: Bjorn Helgaas <[email protected]>
lmc_var.h is included only by files in drivers/net/wan/lmc/, and none of them uses DELAY(). Remove the unused definition and related comments.
--- drivers/net/wan/lmc/lmc_main.c | 8 -------- drivers/net/wan/lmc/lmc_var.h | 8 -------- 2 files changed, 16 deletions(-)
drivers/net/wan/lmc/lmc_main.c +0 -8
@@ -1669,21 +1669,17 @@ unsigned lmc_mii_readreg (lmc_softc_t * const sc, unsigned devaddr, unsigned regLMC_CSR_WRITE (sc, csr_9, dataval);lmc_delay (); -/* __SLOW_DOWN_IO; */ LMC_CSR_WRITE (sc, csr_9, dataval |0x10000 );lmc_delay (); -/* __SLOW_DOWN_IO; */ }for (i =19 ; i >0 ; i--) {LMC_CSR_WRITE (sc, csr_9,0x40000 );lmc_delay (); -/* __SLOW_DOWN_IO; */ retval = (retval <<1 ) | ((LMC_CSR_READ (sc, csr_9) &0x80000 ) ?1 :0 );LMC_CSR_WRITE (sc, csr_9,0x40000 |0x10000 );lmc_delay (); -/* __SLOW_DOWN_IO; */ }return (retval >>1 ) &0xffff ;
@@ -1708,10 +1704,8 @@ void lmc_mii_writereg (lmc_softc_t * const sc, unsigned devaddr, unsigned regno,LMC_CSR_WRITE (sc, csr_9, datav);lmc_delay (); -/* __SLOW_DOWN_IO; */ LMC_CSR_WRITE (sc, csr_9, (datav |0x10000 ));lmc_delay (); -/* __SLOW_DOWN_IO; */ i--; }
@@ -1720,10 +1714,8 @@ void lmc_mii_writereg (lmc_softc_t * const sc, unsigned devaddr, unsigned regno, {LMC_CSR_WRITE (sc, csr_9,0x40000 );lmc_delay (); -/* __SLOW_DOWN_IO; */ LMC_CSR_WRITE (sc, csr_9,0x50000 );lmc_delay (); -/* __SLOW_DOWN_IO; */ i--; } }
drivers/net/wan/lmc/lmc_var.h +0 -8
@@ -44,14 +44,6 @@ typedef struct lmc___ctl lmc_ctl_t;#define LMC_CSR_WRITE (sc, reg, val) \ outl((val), (sc)->lmc_csrs.reg) -//#ifdef _LINUX_DELAY_H -// #define SLOW_DOWN_IO udelay(2); -// #undef __SLOW_DOWN_IO -// #define __SLOW_DOWN_IO udelay(2); -//#endif - -#define DELAY (n) SLOW_DOWN_IO -#define lmc_delay () inl(sc->lmc_csrs.csr_9)/* This macro sync's up with the mii so that reads and writes can take place */
Signature · 1 line
2.25.1
PATCH 3/7 net: remove comments that mention obsolete __SLOW_DOWN_IO
In reply to Bjorn HelgaasFrom: Bjorn Helgaas <[email protected]>
--- drivers/atm/nicstarmac.c | 5 ----- drivers/net/ethernet/dec/tulip/winbond-840.c | 2 -- drivers/net/ethernet/natsemi/natsemi.c | 2 -- 3 files changed, 9 deletions(-)
drivers/atm/nicstarmac.c +0 -5
@@ -14,11 +14,6 @@ typedef void __iomem *virt_addr_t;#define CYCLE_DELAY 5 -/* -This was the original definition -#define osp_MicroDelay(microsec) \ -do { int _i = 4*microsec; while (--_i > 0) { __SLOW_DOWN_IO; }} while (0) -*/ #define osp_MicroDelay (microsec) {unsigned long useconds = (microsec); \ udelay((useconds));}/*
drivers/net/ethernet/dec/tulip/winbond-840.c +0 -2
@@ -474,8 +474,6 @@ static int w840_probe1(struct pci_dev *pdev, const struct pci_device_id *ent)No extra delay is needed with 33Mhz PCI, but future 66Mhz access may need a delay. Note that pre-2.0.34 kernels had a cache-alignment bug that made udelay() unreliable. -The old method of using an ISA access as a delay, __SLOW_DOWN_IO__, is -deprecated. */ #define eeprom_delay (ee_addr) ioread32(ee_addr)
drivers/net/ethernet/natsemi/natsemi.c +0 -2
@@ -989,8 +989,6 @@ static int natsemi_probe1(struct pci_dev *pdev, const struct pci_device_id *ent)No extra delay is needed with 33Mhz PCI, but future 66Mhz access may need a delay. Note that pre-2.0.34 kernels had a cache-alignment bug that made udelay() unreliable. -The old method of using an ISA access as a delay, __SLOW_DOWN_IO__, is -deprecated. */ #define eeprom_delay (ee_addr) readl(ee_addr)
Signature · 1 line
2.25.1
PATCH 4/7 sh: remove unused SLOW_DOWN_IO
In reply to Bjorn HelgaasFrom: Bjorn Helgaas <[email protected]>
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.
--- arch/sh/include/asm/io.h | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-)
arch/sh/include/asm/io.h +2 -15
@@ -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, _p,)#define BUILDIO_IOPORT (bwlq, type) \ __BUILD_IOPORT_PFX(, bwlq, type)
Signature · 1 line
2.25.1
PATCH 5/7 powerpc: Remove unused SLOW_DOWN_IO definition
In reply to Bjorn HelgaasFrom: Bjorn Helgaas <[email protected]>
Remove unused SLOW_DOWN_IO definition.
--- arch/powerpc/include/asm/io.h | 2 -- 1 file changed, 2 deletions(-)
arch/powerpc/include/asm/io.h +0 -2
@@ -38,8 +38,6 @@ extern struct pci_dev *isa_bridge_pcidev;#define SIO_CONFIG_RA 0x398#define SIO_CONFIG_RD 0x399 -#define SLOW_DOWN_IO -/* 32 bits uses slightly different variables for the various IO * bases. Most of this file only uses _IO_BASE though which we * define properly based on the platform
Signature · 1 line
2.25.1
PATCH 6/7 ia64: remove unused __SLOW_DOWN_IO and SLOW_DOWN_IO definitions
In reply to Bjorn HelgaasFrom: Bjorn Helgaas <[email protected]>
Remove unused __SLOW_DOWN_IO and SLOW_DOWN_IO definitions.
--- arch/ia64/include/asm/io.h | 4 ---- 1 file changed, 4 deletions(-)
arch/ia64/include/asm/io.h +0 -4
@@ -23,10 +23,6 @@#include <asm/unaligned.h> #include <asm/early_ioremap.h> -/* We don't use IO slowdowns on the ia64, but.. */ -#define __SLOW_DOWN_IO do { } while (0) -#define SLOW_DOWN_IO do { } while (0) -#define __IA64_UNCACHED_OFFSET RGN_BASE(RGN_UNCACHED)/*
Signature · 1 line
2.25.1
PATCH 7/7 alpha: remove unused __SLOW_DOWN_IO and SLOW_DOWN_IO definitions
In reply to Bjorn HelgaasFrom: Bjorn Helgaas <[email protected]>
Remove unused __SLOW_DOWN_IO and SLOW_DOWN_IO definitions.
--- arch/alpha/include/asm/io.h | 4 ---- 1 file changed, 4 deletions(-)
arch/alpha/include/asm/io.h +0 -4
@@ -14,10 +14,6 @@the implementation we have here matches that interface. */ #include <asm-generic/iomap.h> -/* We don't use IO slowdowns on the Alpha, but.. */ -#define __SLOW_DOWN_IO do { } while (0) -#define SLOW_DOWN_IO do { } while (0) -/* * Virtual -> physical identity mapping starts at this offset */
Signature · 1 line
2.25.1
Jakub Kicinski
maintainerQuoted 9 lines · On Fri, 15 Apr 2022 14:08:10 -0500 Bjorn Helgaas wrote:
From: Bjorn Helgaas <[email protected]>
Only alpha, ia64, powerpc, and sh define
SLOW_DOWN_IO, and there are no actual uses of it. The few references to it are in situations that are themselves unused. Remove them all.It should be safe to apply these independently and in any order. The only place
SLOW_DOWN_IOis used at all is thelmc_var.hdefinition of DELAY, which is itself never used.
Hi Bojrn! Would you mind reposting just patches 1 and 3 for networking? LMC got removed in net-next (commit a5b116a0fa90 ("net: wan: remove the lanmedia (lmc) driver")) so the entire series fails to apply and therefore defeats all of our patch handling scripts :S
Quoted 7 lines · Jakub Kicinski
Quoted 6 lines · On Fri, 15 Apr 2022 14:08:10 -0500 Bjorn Helgaas wrote:
From: Bjorn Helgaas <[email protected]>
Only alpha, ia64, powerpc, and sh define
SLOW_DOWN_IO, and there are no actual uses of it. The few references to it are in situations that are themselves unused. Remove them all.
Quoted 8 lines
Quoted 3 lines
It should be safe to apply these independently and in any order. The only place
SLOW_DOWN_IOis used at all is thelmc_var.hdefinition of DELAY, which is itself never used.Hi Bojrn! Would you mind reposting just patches 1 and 3 for networking? LMC got removed in net-next (commit
a5b116a0fa90("net: wan: remove the lanmedia (lmc) driver")) so the entire series fails to apply and therefore defeats all of our patch handling scripts :S
Sure, coming up, with reduced cc: list.
Michael Ellerman
AppliedRe: (subset) [PATCH 0/7] Remove unused SLOW_DOWN_IO
In reply to Bjorn HelgaasQuoted 11 lines · Bjorn Helgaas
From: Bjorn Helgaas <[email protected]>
Only alpha, ia64, powerpc, and sh define
SLOW_DOWN_IO, and there are no actual uses of it. The few references to it are in situations that are themselves unused. Remove them all.It should be safe to apply these independently and in any order. The only place
SLOW_DOWN_IOis used at all is thelmc_var.hdefinition of DELAY, which is itself never used.[...]
Applied to powerpc/next.
[5/7] powerpc: Remove unused SLOW_DOWN_IO definition
https://git.kernel.org/powerpc/c/755a9d44e6e2a217cceaab9fe2c8bac55ee7f8b2
cheers