From: Benjamin Herrenschmidt Date: Thu, 26 Jul 2007 04:07:13 +0000 (+1000) Subject: [POWERPC] Make pci_iounmap actually unmap things X-Git-Tag: v2.6.23-rc2~190^2~4 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=50747cb8189d54369d75e1bd73f84db431d39af8;p=linux-2.6 [POWERPC] Make pci_iounmap actually unmap things This patch uses the newly added functions for testing if an address is an ISA or PCI IO port to properly unmap things in pci_iounmap that aren't such ports. Without that, drivers using the iomap API will never actually unmap resources, which on IBM server machines will prevent hot-unplug of the corresponding HW adapters. Signed-off-by: Benjamin Herrenschmidt Signed-off-by: Paul Mackerras --- diff --git a/arch/powerpc/kernel/iomap.c b/arch/powerpc/kernel/iomap.c index 601ef79a59..2a5cf86803 100644 --- a/arch/powerpc/kernel/iomap.c +++ b/arch/powerpc/kernel/iomap.c @@ -7,6 +7,7 @@ #include #include #include +#include /* * Here comes the ppc64 implementation of the IOMAP @@ -136,7 +137,12 @@ void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max) void pci_iounmap(struct pci_dev *dev, void __iomem *addr) { - /* Nothing to do */ + if (isa_vaddr_is_ioport(addr)) + return; + if (pcibios_vaddr_is_ioport(addr)) + return; + iounmap(addr); } + EXPORT_SYMBOL(pci_iomap); EXPORT_SYMBOL(pci_iounmap);