]> err.no Git - linux-2.6/commitdiff
[POWERPC] Make pci_iounmap actually unmap things
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Thu, 26 Jul 2007 04:07:13 +0000 (14:07 +1000)
committerPaul Mackerras <paulus@samba.org>
Thu, 26 Jul 2007 06:17:48 +0000 (16:17 +1000)
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 <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/powerpc/kernel/iomap.c

index 601ef79a591618d75d1e0d2c919c993e6b4dc2fc..2a5cf868037083b6695670f5d99d1d6100daa5a4 100644 (file)
@@ -7,6 +7,7 @@
 #include <linux/pci.h>
 #include <linux/mm.h>
 #include <asm/io.h>
+#include <asm/pci-bridge.h>
 
 /*
  * 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);