|
@@ -25,6 +25,7 @@
|
|
|
#include <linux/device.h>
|
|
|
#include <linux/pm_runtime.h>
|
|
|
#include <linux/pci_hotplug.h>
|
|
|
+#include <linux/vmalloc.h>
|
|
|
#include <asm/setup.h>
|
|
|
#include <linux/aer.h>
|
|
|
#include "pci.h"
|
|
@@ -3165,6 +3166,23 @@ int __weak pci_remap_iospace(const struct resource *res, phys_addr_t phys_addr)
|
|
|
#endif
|
|
|
}
|
|
|
|
|
|
+/**
|
|
|
+ * pci_unmap_iospace - Unmap the memory mapped I/O space
|
|
|
+ * @res: resource to be unmapped
|
|
|
+ *
|
|
|
+ * Unmap the CPU virtual address @res from virtual address space.
|
|
|
+ * Only architectures that have memory mapped IO functions defined
|
|
|
+ * (and the PCI_IOBASE value defined) should call this function.
|
|
|
+ */
|
|
|
+void pci_unmap_iospace(struct resource *res)
|
|
|
+{
|
|
|
+#if defined(PCI_IOBASE) && defined(CONFIG_MMU)
|
|
|
+ unsigned long vaddr = (unsigned long)PCI_IOBASE + res->start;
|
|
|
+
|
|
|
+ unmap_kernel_range(vaddr, resource_size(res));
|
|
|
+#endif
|
|
|
+}
|
|
|
+
|
|
|
static void __pci_set_master(struct pci_dev *dev, bool enable)
|
|
|
{
|
|
|
u16 old_cmd, cmd;
|