]> www.infradead.org Git - users/jedix/linux-maple.git/commit
PCI: Let pci_mmap_page_range() take resource address
authorYinghai Lu <yinghai@kernel.org>
Mon, 25 Jul 2016 22:07:59 +0000 (16:07 -0600)
committerChuck Anderson <chuck.anderson@oracle.com>
Sun, 28 May 2017 02:43:59 +0000 (19:43 -0700)
commitffd179e0bc12f98af775e9e531cffd5007e9d473
tree9312cc9bed9e4c91b97b72e76e5f6c98e0ce4029
parent0211e7a7554f0f9ce59f9f8dd740f71cc69b4b17
PCI: Let pci_mmap_page_range() take resource address

Original pci_mmap_page_range() is taking PCI BAR value aka usr_address.

Bjorn found out that it would be much simple to pass resource address
directly and avoid extra those __pci_mmap_make_offset.

In this patch:
1. in proc path: proc_bus_pci_mmap, try convert back to resource
   before calling pci_mmap_page_range
2. in sysfs path: pci_mmap_resource will just offset with resource start.
3. all pci_mmap_page_range will have vma->vm_pgoff with in resource
   range instead of BAR value.
4. skip calling __pci_mmap_make_offset, as the checking is done
   in pci_mmap_fits().

-v2: add pci_user_to_resource and remove __pci_mmap_make_offset
-v3: pass resource pointer with pci_mmap_page_range()
-v4: put __pci_mmap_make_offset() removing to following patch
     seperate /sys io access alignment checking to another patch
     updated after Bjorn's pci_resource_to_user() changes.
-v5: update after fix for pci_mmap with proc path accoring to
     Bjorn.

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Cc: linuxppc-dev@lists.ozlabs.org
Cc: sparclinux@vger.kernel.org
Cc: linux-xtensa@linux-xtensa.org
Orabug: 22855133

Signed-off-by: Khalid Aziz <khalid.aziz@oracle.com>
(cherry picked from commit d6ccd78899c966eec1bac726f96f6cbed5b9960e)
Signed-off-by: Allen Pais <allen.pais@oracle.com>
arch/microblaze/pci/pci-common.c
arch/powerpc/kernel/pci-common.c
arch/sparc/kernel/pci.c
arch/xtensa/kernel/pci.c
drivers/pci/pci-sysfs.c
drivers/pci/pci.h
drivers/pci/proc.c