Commit 5dd415ec authored by Bjorn Helgaas's avatar Bjorn Helgaas Committed by Ben Hutchings

alpha/PCI: Call iomem_is_exclusive() for IORESOURCE_MEM, but not IORESOURCE_IO

commit c20e1280 upstream.

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: 10a0ef39 ("PCI/alpha: pci sysfs resources")
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
CC: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
parent c94e97f3
...@@ -78,10 +78,10 @@ static int pci_mmap_resource(struct kobject *kobj, ...@@ -78,10 +78,10 @@ static int pci_mmap_resource(struct kobject *kobj,
if (i >= PCI_ROM_RESOURCE) if (i >= PCI_ROM_RESOURCE)
return -ENODEV; return -ENODEV;
if (!__pci_mmap_fits(pdev, i, vma, sparse)) if (res->flags & IORESOURCE_MEM && iomem_is_exclusive(res->start))
return -EINVAL; return -EINVAL;
if (iomem_is_exclusive(res->start)) if (!__pci_mmap_fits(pdev, i, vma, sparse))
return -EINVAL; return -EINVAL;
pcibios_resource_to_bus(pdev, &bar, res); pcibios_resource_to_bus(pdev, &bar, res);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment