summaryrefslogtreecommitdiffstats
path: root/arch/alpha
diff options
context:
space:
mode:
authorBjorn Helgaas <bhelgaas@google.com>2016-04-25 22:59:50 +0200
committerBjorn Helgaas <bhelgaas@google.com>2016-04-25 22:59:50 +0200
commitc20e128030caf0537d5e906753eac1c28fefdb75 (patch)
treedcc068d254a6040254555e0747d863fc68f035bc /arch/alpha
parentPCI: Supply CPU physical address (not bus address) to iomem_is_exclusive() (diff)
downloadlinux-c20e128030caf0537d5e906753eac1c28fefdb75.tar.xz
linux-c20e128030caf0537d5e906753eac1c28fefdb75.zip
alpha/PCI: Call iomem_is_exclusive() for IORESOURCE_MEM, but not IORESOURCE_IO
The alpha pci_mmap_resource() is used for both IORESOURCE_MEM and IORESOURCE_IO resources, but iomem_is_exclusive() is only applicable for IORESOURCE_MEM. Call iomem_is_exclusive() only for IORESOURCE_MEM resources, and do it earlier to match the generic version of pci_mmap_resource(). Fixes: 10a0ef39fbd1 ("PCI/alpha: pci sysfs resources") Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> CC: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Diffstat (limited to 'arch/alpha')
-rw-r--r--arch/alpha/kernel/pci-sysfs.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/alpha/kernel/pci-sysfs.c b/arch/alpha/kernel/pci-sysfs.c
index 99e8d4796c96..92c0d460815b 100644
--- a/arch/alpha/kernel/pci-sysfs.c
+++ b/arch/alpha/kernel/pci-sysfs.c
@@ -77,10 +77,10 @@ static int pci_mmap_resource(struct kobject *kobj,
if (i >= PCI_ROM_RESOURCE)
return -ENODEV;
- if (!__pci_mmap_fits(pdev, i, vma, sparse))
+ if (res->flags & IORESOURCE_MEM && iomem_is_exclusive(res->start))
return -EINVAL;
- if (iomem_is_exclusive(res->start))
+ if (!__pci_mmap_fits(pdev, i, vma, sparse))
return -EINVAL;
pcibios_resource_to_bus(pdev->bus, &bar, res);