]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
ARM: Allow unmapping of fixed PCI I/O mappings
authorVidya Sagar <vidyas@nvidia.com>
Mon, 11 Aug 2014 08:55:31 +0000 (14:25 +0530)
committerLaxman Dewangan <ldewangan@nvidia.com>
Wed, 13 Aug 2014 13:56:18 +0000 (06:56 -0700)
The new pci_iounmap_io() function can be used to unmap a fixed PCI I/O
mapping as established by pci_ioremap_io(). This will be useful to
support unbinding of PCI host drivers.

vidyas: make similar change for ARM64
based on http://git-master/r/#/c/450679

Bug 1496843

Change-Id: I5d1cbcf4f66b89b9711d6897ed444b680d20d613
Signed-off-by: Vidya Sagar <vidyas@nvidia.com>
Reviewed-on: http://git-master/r/454937
GVS: Gerrit_Virtual_Submit
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
arch/arm64/include/asm/io.h
arch/arm64/mm/ioremap.c

index e66f858f38d57d1371111ef9f5fb9946c270793b..5d736cbfb254244ba16570959c89d504747a552f 100644 (file)
@@ -249,6 +249,8 @@ extern void __iomem *ioremap_cache(phys_addr_t phys_addr, size_t size);
 #define IOMEM(x)       ((void __force __iomem *)(x))
 
 extern int pci_ioremap_io(unsigned int offset, phys_addr_t phys_addr);
+extern void pci_iounmap_io(unsigned int offset);
+
 
 /*
  * More restrictive address range checking than the default implementation
index f777f55fe26757df891d63153dd1158305104350..f15bcb87b08a406c334d551a21461bc9eeabd1a1 100644 (file)
@@ -99,6 +99,13 @@ int pci_ioremap_io(unsigned int offset, phys_addr_t phys_addr)
                                  __pgprot(PROT_DEVICE_nGnRE));
 }
 EXPORT_SYMBOL_GPL(pci_ioremap_io);
+
+void pci_iounmap_io(unsigned int offset)
+{
+       unmap_kernel_range(PCI_IOBASE + offset, SZ_64K);
+}
+EXPORT_SYMBOL_GPL(pci_iounmap_io);
+
 #endif
 void __iomem *ioremap_cache(phys_addr_t phys_addr, size_t size)
 {