Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

PCI: Move isa_dma_bridge_buggy out of asm/dma.h

The isa_dma_bridge_buggy symbol is only used for x86_32, and only x86_32
platforms or quirks ever set it.

Add a new linux/isa-dma.h header that #defines isa_dma_bridge_buggy to 0
except on x86_32, where we keep it as a variable, and remove all the arch-
specific definitions.

[bhelgaas: commit log]
Suggested-by: Arnd Bergmann <arnd@arndb.de>
Suggested-by: Christoph Hellwig <hch@infradead.org>
Link: https://lore.kernel.org/r/20220722214944.831438-3-shorne@gmail.com
Signed-off-by: Stafford Horne <shorne@gmail.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>

authored by

Stafford Horne and committed by
Bjorn Helgaas
abb4970a ae85b23c

+21 -100
-9
arch/alpha/include/asm/dma.h
··· 365 365 #define KERNEL_HAVE_CHECK_DMA 366 366 extern int check_dma(unsigned int dmanr); 367 367 368 - /* From PCI */ 369 - 370 - #ifdef CONFIG_PCI 371 - extern int isa_dma_bridge_buggy; 372 - #else 373 - #define isa_dma_bridge_buggy (0) 374 - #endif 375 - 376 - 377 368 #endif /* _ASM_DMA_H */
-5
arch/arc/include/asm/dma.h
··· 7 7 #define ASM_ARC_DMA_H 8 8 9 9 #define MAX_DMA_ADDRESS 0xC0000000 10 - #ifdef CONFIG_PCI 11 - extern int isa_dma_bridge_buggy; 12 - #else 13 - #define isa_dma_bridge_buggy 0 14 - #endif 15 10 16 11 #endif
-6
arch/arm/include/asm/dma.h
··· 143 143 144 144 #endif /* CONFIG_ISA_DMA_API */ 145 145 146 - #ifdef CONFIG_PCI 147 - extern int isa_dma_bridge_buggy; 148 - #else 149 - #define isa_dma_bridge_buggy (0) 150 - #endif 151 - 152 146 #endif /* __ASM_ARM_DMA_H */
-2
arch/arm64/include/asm/pci.h
··· 20 20 #define arch_can_pci_mmap_wc() 1 21 21 #define ARCH_GENERIC_PCI_MMAP_RESOURCE 1 22 22 23 - extern int isa_dma_bridge_buggy; 24 - 25 23 #ifdef CONFIG_PCI 26 24 static inline int pci_proc_domain(struct pci_bus *bus) 27 25 {
-2
arch/csky/include/asm/pci.h
··· 15 15 /* C-SKY shim does not initialize PCI bus */ 16 16 #define pcibios_assign_all_busses() 1 17 17 18 - extern int isa_dma_bridge_buggy; 19 - 20 18 #ifdef CONFIG_PCI 21 19 static inline int pci_proc_domain(struct pci_bus *bus) 22 20 {
-2
arch/ia64/include/asm/dma.h
··· 12 12 13 13 extern unsigned long MAX_DMA_ADDRESS; 14 14 15 - extern int isa_dma_bridge_buggy; 16 - 17 15 #define free_dma(x) 18 16 19 17 #endif /* _ASM_IA64_DMA_H */
-6
arch/m68k/include/asm/dma.h
··· 6 6 bootmem allocator (but this should do it for this) */ 7 7 #define MAX_DMA_ADDRESS PAGE_OFFSET 8 8 9 - #ifdef CONFIG_PCI 10 - extern int isa_dma_bridge_buggy; 11 - #else 12 - #define isa_dma_bridge_buggy (0) 13 - #endif 14 - 15 9 #endif /* _M68K_DMA_H */
-6
arch/microblaze/include/asm/dma.h
··· 9 9 /* Virtual address corresponding to last available physical memory address. */ 10 10 #define MAX_DMA_ADDRESS (CONFIG_KERNEL_START + memory_size - 1) 11 11 12 - #ifdef CONFIG_PCI 13 - extern int isa_dma_bridge_buggy; 14 - #else 15 - #define isa_dma_bridge_buggy (0) 16 - #endif 17 - 18 12 #endif /* _ASM_MICROBLAZE_DMA_H */
-8
arch/mips/include/asm/dma.h
··· 307 307 extern int request_dma(unsigned int dmanr, const char * device_id); /* reserve a DMA channel */ 308 308 extern void free_dma(unsigned int dmanr); /* release it again */ 309 309 310 - /* From PCI */ 311 - 312 - #ifdef CONFIG_PCI 313 - extern int isa_dma_bridge_buggy; 314 - #else 315 - #define isa_dma_bridge_buggy (0) 316 - #endif 317 - 318 310 #endif /* _ASM_DMA_H */
-6
arch/parisc/include/asm/dma.h
··· 176 176 177 177 #define free_dma(dmanr) 178 178 179 - #ifdef CONFIG_PCI 180 - extern int isa_dma_bridge_buggy; 181 - #else 182 - #define isa_dma_bridge_buggy (0) 183 - #endif 184 - 185 179 #endif /* _ASM_DMA_H */
-6
arch/powerpc/include/asm/dma.h
··· 340 340 /* release it again */ 341 341 extern void free_dma(unsigned int dmanr); 342 342 343 - #ifdef CONFIG_PCI 344 - extern int isa_dma_bridge_buggy; 345 - #else 346 - #define isa_dma_bridge_buggy (0) 347 - #endif 348 - 349 343 #endif /* __KERNEL__ */ 350 344 #endif /* _ASM_POWERPC_DMA_H */
-2
arch/riscv/include/asm/pci.h
··· 20 20 21 21 #define ARCH_GENERIC_PCI_MMAP_RESOURCE 1 22 22 23 - extern int isa_dma_bridge_buggy; 24 - 25 23 #ifdef CONFIG_PCI 26 24 static inline int pci_proc_domain(struct pci_bus *bus) 27 25 {
-6
arch/s390/include/asm/dma.h
··· 11 11 */ 12 12 #define MAX_DMA_ADDRESS 0x80000000 13 13 14 - #ifdef CONFIG_PCI 15 - extern int isa_dma_bridge_buggy; 16 - #else 17 - #define isa_dma_bridge_buggy (0) 18 - #endif 19 - 20 14 #endif /* _ASM_S390_DMA_H */
-6
arch/sh/include/asm/dma.h
··· 137 137 extern int dma_create_sysfs_files(struct dma_channel *, struct dma_info *); 138 138 extern void dma_remove_sysfs_files(struct dma_channel *, struct dma_info *); 139 139 140 - #ifdef CONFIG_PCI 141 - extern int isa_dma_bridge_buggy; 142 - #else 143 - #define isa_dma_bridge_buggy (0) 144 - #endif 145 - 146 140 #endif /* __ASM_SH_DMA_H */
-8
arch/sparc/include/asm/dma.h
··· 82 82 #define DMA_BURST64 0x40 83 83 #define DMA_BURSTBITS 0x7f 84 84 85 - /* From PCI */ 86 - 87 - #ifdef CONFIG_PCI 88 - extern int isa_dma_bridge_buggy; 89 - #else 90 - #define isa_dma_bridge_buggy (0) 91 - #endif 92 - 93 85 #ifdef CONFIG_SPARC32 94 86 struct device; 95 87
-2
arch/um/include/asm/pci.h
··· 9 9 10 10 #define pcibios_assign_all_busses() 1 11 11 12 - extern int isa_dma_bridge_buggy; 13 - 14 12 #ifdef CONFIG_PCI_DOMAINS 15 13 static inline int pci_proc_domain(struct pci_bus *bus) 16 14 {
-8
arch/x86/include/asm/dma.h
··· 307 307 extern void free_dma(unsigned int dmanr); 308 308 #endif 309 309 310 - /* From PCI */ 311 - 312 - #ifdef CONFIG_PCI 313 - extern int isa_dma_bridge_buggy; 314 - #else 315 - #define isa_dma_bridge_buggy (0) 316 - #endif 317 - 318 310 #endif /* _ASM_X86_DMA_H */
-7
arch/xtensa/include/asm/dma.h
··· 52 52 extern int request_dma(unsigned int dmanr, const char * device_id); 53 53 extern void free_dma(unsigned int dmanr); 54 54 55 - #ifdef CONFIG_PCI 56 - extern int isa_dma_bridge_buggy; 57 - #else 58 - #define isa_dma_bridge_buggy (0) 59 - #endif 60 - 61 - 62 55 #endif
+1 -1
drivers/comedi/drivers/comedi_isadma.c
··· 8 8 #include <linux/slab.h> 9 9 #include <linux/delay.h> 10 10 #include <linux/dma-mapping.h> 11 - #include <asm/dma.h> 11 + #include <linux/isa-dma.h> 12 12 #include <linux/comedi/comedidev.h> 13 13 #include <linux/comedi/comedi_isadma.h> 14 14
+2
drivers/pci/pci.c
··· 41 41 }; 42 42 EXPORT_SYMBOL_GPL(pci_power_names); 43 43 44 + #ifdef CONFIG_X86_32 44 45 int isa_dma_bridge_buggy; 45 46 EXPORT_SYMBOL(isa_dma_bridge_buggy); 47 + #endif 46 48 47 49 int pci_pci_problems; 48 50 EXPORT_SYMBOL(pci_pci_problems);
+3 -1
drivers/pci/quirks.c
··· 17 17 #include <linux/kernel.h> 18 18 #include <linux/export.h> 19 19 #include <linux/pci.h> 20 + #include <linux/isa-dma.h> /* isa_dma_bridge_buggy */ 20 21 #include <linux/init.h> 21 22 #include <linux/delay.h> 22 23 #include <linux/acpi.h> ··· 31 30 #include <linux/pm_runtime.h> 32 31 #include <linux/suspend.h> 33 32 #include <linux/switchtec.h> 34 - #include <asm/dma.h> /* isa_dma_bridge_buggy */ 35 33 #include "pci.h" 36 34 37 35 static ktime_t fixup_debug_start(struct pci_dev *dev, ··· 239 239 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82441, quirk_passive_release); 240 240 DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82441, quirk_passive_release); 241 241 242 + #ifdef CONFIG_X86_32 242 243 /* 243 244 * The VIA VP2/VP3/MVP3 seem to have some 'features'. There may be a 244 245 * workaround but VIA don't answer queries. If you happen to have good ··· 266 265 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NEC, PCI_DEVICE_ID_NEC_CBUS_1, quirk_isa_dma_hangs); 267 266 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NEC, PCI_DEVICE_ID_NEC_CBUS_2, quirk_isa_dma_hangs); 268 267 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NEC, PCI_DEVICE_ID_NEC_CBUS_3, quirk_isa_dma_hangs); 268 + #endif 269 269 270 270 /* 271 271 * Intel NM10 "TigerPoint" LPC PM1a_STS.BM_STS must be clear
+14
include/linux/isa-dma.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0 */ 2 + 3 + #ifndef __LINUX_ISA_DMA_H 4 + #define __LINUX_ISA_DMA_H 5 + 6 + #include <asm/dma.h> 7 + 8 + #if defined(CONFIG_PCI) && defined(CONFIG_X86_32) 9 + extern int isa_dma_bridge_buggy; 10 + #else 11 + #define isa_dma_bridge_buggy (0) 12 + #endif 13 + 14 + #endif /* __LINUX_ISA_DMA_H */
+1 -1
sound/core/isadma.c
··· 12 12 #undef HAVE_REALLY_SLOW_DMA_CONTROLLER 13 13 14 14 #include <linux/export.h> 15 + #include <linux/isa-dma.h> 15 16 #include <sound/core.h> 16 - #include <asm/dma.h> 17 17 18 18 /** 19 19 * snd_dma_program - program an ISA DMA transfer