From: Bjorn Helgaas Date: Fri, 8 Apr 2016 00:15:14 +0000 (-0700) Subject: PCI: Supply CPU physical address (not bus address) to iomem_is_exclusive() X-Git-Tag: v3.2.82~89 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c94e97f3a7795cbf6c0296fba1341e5508492055;p=pandora-kernel.git PCI: Supply CPU physical address (not bus address) to iomem_is_exclusive() commit ca620723d4ff9ea7ed484eab46264c3af871b9ae upstream. iomem_is_exclusive() requires a CPU physical address, but on some arches we supplied a PCI bus address instead. On most arches, pci_resource_to_user(res) returns "res->start", which is a CPU physical address. But on microblaze, mips, powerpc, and sparc, it returns the PCI bus address corresponding to "res->start". The result is that pci_mmap_resource() may fail when it shouldn't (if the bus address happens to match an existing resource), or it may succeed when it should fail (if the resource is exclusive but the bus address doesn't match it). Call iomem_is_exclusive() with "res->start", which is always a CPU physical address, not the result of pci_resource_to_user(). Fixes: e8de1481fd71 ("resource: allow MMIO exclusivity for device drivers") Suggested-by: Yinghai Lu Signed-off-by: Bjorn Helgaas CC: Arjan van de Ven Signed-off-by: Ben Hutchings --- Reading git-diff-tree failed