[PATCH v1 0/4] PCI: pci_resource_to_user() cleanups

2016-06-17 Thread Bjorn Helgaas via Linuxppc-dev
The /sys/devices/pci.../.../resource and /proc/bus/pci/devices files
contain PCI BAR addresses.  On most architectures these addresses are
"resource" values, e.g., CPU physical memory addresses or Linux I/O port
numbers.  These may be offset from the raw PCI values if there are multiple
PCI host bridges.

On others (microblaze, mips, powerpc, sparc) they are raw PCI values as
they would appear on the PCI bus.  pci_resource_to_user() converts from the
struct resource to whatever the arch wants to expose.  It's a no-op on
most arches.

The PCI core provides a pcibios_resource_to_bus() function that converts
from struct resource values to raw PCI bus values.  These patches use that
when possible instead of the arch-specific hand-coded equivalent.

These shouldn't fix or break anything unless I've made a mistake.

---

Bjorn Helgaas (4):
  PCI: Unify pci_resource_to_user() declarations
  microblaze/PCI: Implement pci_resource_to_user() with 
pcibios_resource_to_bus()
  powerpc/pci: Implement pci_resource_to_user() with 
pcibios_resource_to_bus()
  sparc/PCI: Implement pci_resource_to_user() with pcibios_resource_to_bus()


 arch/microblaze/include/asm/pci.h |3 ---
 arch/microblaze/pci/pci-common.c  |   42 -
 arch/mips/include/asm/pci.h   |   10 -
 arch/mips/pci/pci.c   |   10 +
 arch/powerpc/include/asm/pci.h|3 ---
 arch/powerpc/kernel/pci-common.c  |   42 -
 arch/sparc/include/asm/pci_64.h   |3 ---
 arch/sparc/kernel/pci.c   |   20 ++
 include/linux/pci.h   |6 -
 9 files changed, 54 insertions(+), 85 deletions(-)
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH v1 0/3] PCI: Clean up write combining usage for user mmap

2016-06-09 Thread Bjorn Helgaas via Linuxppc-dev
These patches:

  - Enforce a "no write combining on I/O port space mapping" policy.
This seems like an obviously good thing but was previously
enforced only by powerpc.

  - Stop giving powerpc users write combining mappings of prefetchable
memory they ask for write combining with the procfs
PCIIOC_WRITE_COMBINE ioctl or a sysfs "resourceN_wc" file.

  - Clean up arch-specific code that related to the above.

Ben, I'm particularly interested in your thoughts about the powerpc
change.  It should "only" affect performance of users who aren't
actually requesting write combining.  I don't know how many of those
users there might be.

Yinghai, I added your sign-off to the powerpc part, since you posted
that exact patch.  Let me know if you don't want that.

These are on my pci/resource branch.

---

Bjorn Helgaas (2):
  PCI: Ignore write combining when mapping I/O port space
  microblaze/PCI: Remove useless __pci_mmap_set_pgprot()

Yinghai Lu (1):
  powerpc/pci: Remove __pci_mmap_set_pgprot()


 arch/microblaze/pci/pci-common.c |   31 +--
 arch/powerpc/kernel/pci-common.c |   37 -
 drivers/pci/proc.c   |9 ++---
 3 files changed, 11 insertions(+), 66 deletions(-)
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev