From c1ef322491cb880fea4e52535b15448f2a573ded Mon Sep 17 00:00:00 2001 From: Arnd Bergmann Date: Fri, 15 Jul 2022 17:36:17 +0200 Subject: sparc: Use generic pci_mmap_resource_range() The main feature of the sparc-specific implementation of pci_mmap_resource_range() is that it allows mapping the entire PCI I/O space for a PCI host bridge using the /proc/bus/pci interface on a bridge device. The generic implementation cannot do this, but it also appears that this got broken for sparc by commit 9eff02e2042f ("PCI: check mmap range of /proc/bus/pci files too"), which enforces that each address is part of a BAR for kernels after 2.6.28. Remove it all, assuming that the corresponding user space code has already been changed to access /dev/ioport instead a long time ago. Add pci_iobar_pfn() to make it possible to map I/O resources. This is adapted from the powerpc version. Link: https://lore.kernel.org/lkml/1519887203.622.3.camel@infradead.org/t/ Link: https://lore.kernel.org/r/20220715153617.3393420-2-arnd@kernel.org Signed-off-by: Arnd Bergmann Signed-off-by: Bjorn Helgaas --- arch/sparc/include/asm/pci.h | 1 + 1 file changed, 1 insertion(+) (limited to 'arch/sparc/include') diff --git a/arch/sparc/include/asm/pci.h b/arch/sparc/include/asm/pci.h index 4deddf430e5d..dff90dce6cb7 100644 --- a/arch/sparc/include/asm/pci.h +++ b/arch/sparc/include/asm/pci.h @@ -37,6 +37,7 @@ static inline int pci_proc_domain(struct pci_bus *bus) #define HAVE_PCI_MMAP #define arch_can_pci_mmap_io() 1 #define HAVE_ARCH_PCI_GET_UNMAPPED_AREA +#define ARCH_GENERIC_PCI_MMAP_RESOURCE #define get_pci_unmapped_area get_fb_unmapped_area #endif /* CONFIG_SPARC64 */ -- cgit v1.2.3