linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 00/27] PCI resource mmap cleanup
@ 2017-04-12 12:25 David Woodhouse
  2017-04-12 12:25 ` [PATCH v2 01/27] pci: Fix pci_mmap_fits() for HAVE_PCI_RESOURCE_TO_USER platforms David Woodhouse
                   ` (29 more replies)
  0 siblings, 30 replies; 39+ messages in thread
From: David Woodhouse @ 2017-04-12 12:25 UTC (permalink / raw)
  To: linux-pci, linux-arch, linux-kernel

This pursues my previous patch set all the way to its logical conclusion.

It kills off the legacy arch-provided pci_mmap_page_range() completely,
along with its vile 'address converted by pci_resource_to_user()' API
and the various bugs and other strange behaviour that various
architectures had.

In some cases like IA64 I've killed off the odd behaviour *first* in
separately reviewable patches, before the final switch over to the
generic code which should then basically have no functional effect.

To accommodate the ARM64 maintainers' desire *not* to support mmap
through /proc/bus/pci I have separated HAVE_PCI_MMAP from the sysfs
implementation, which (as of the last patch in the series) ends up
present on *all* platforms with an MMU. I still don't think that's a
*good* idea though; it's a generic part of /proc, and nobody ever did
answer my question about what *else* we can delete from /proc on ARM64
"because it's a new platform"...

I would very much like the interesting parts of this to go through the
arch maintainers' trees. I'd suggest that we can pull everything up to
and including patch 19 ("pci: Add I/O BAR support to generic
pci_mmap_resource_range()") through the PCI tree, which includes the
relatively trivial architectures. Then the others can go through the
appropriate arch tree with more careful review and testing.

Once everything's done, then we can apply something like the final
patch ("pci: Kill ARCH_GENERIC_PCI_MMAP_RESOURCE"). But that's mostly
just there for now as a demonstration of the intended end point.

This is in
 git://git.infradead.org/users/dwmw2/random-2.6.git pcimmap
 http://git.infradead.org/users/dwmw2/random-2.6.git/shortlog/refs/heads/pcimmap

David Woodhouse (27):
  pci: Fix pci_mmap_fits() for HAVE_PCI_RESOURCE_TO_USER platforms
  pci: Fix another sanity check bug in /proc/pci mmap
  pci: Only allow WC mmap on prefetchable resources
  xtensa: Do not mmap PCI BARs to userspace as write-through
  pci: Add arch_can_pci_mmap_wc() macro
  pci: Move multiple declarations of pci_mmap_page_range() to
    <linux/pci.h>
  pci: Add arch_can_pci_mmap_io() on architectures which can mmap() I/O
    space
  pci: Use BAR index in sysfs attr->private instead of resource pointer
  pci: Add BAR index argument to pci_mmap_page_range()
  pci: Add pci_mmap_resource_range() and use it for ARM64
  arm: Use generic pci_mmap_resource_range()
  cris: Use generic pci_mmap_resource_range()
  mips: Use generic pci_mmap_resource_range()
  mn10300: Use generic pci_mmap_resource_range()
  parisc: Use generic pci_mmap_resource_range()
  sh: Use generic pci_mmap_resource_range()
  unicore: Use generic pci_mmap_resource_range()
  x86: Use generic pci_mmap_resource_range()
  pci: Add I/O BAR support to generic pci_mmap_resource_range()
  powerpc: Use generic pci_mmap_resource_range()
  microblaze: Use generic pci_mmap_resource_range()
  xtensa: Use generic pci_mmap_resource_range()
  ia64: Remove redundant valid_mmap_phys_addr_range() from
    pci_mmap_page_range()
  ia64: Remove redundant checks for WC in pci_mmap_page_range()
  ia64: Use generic pci_mmap_resource_range()
  sparc: Use generic pci_mmap_resource_range()
  pci: Kill ARCH_GENERIC_PCI_MMAP_RESOURCE

 Documentation/filesystems/sysfs-pci.txt |  12 ++-
 arch/arm/include/asm/pci.h              |   2 -
 arch/arm/kernel/bios32.c                |  19 ----
 arch/cris/arch-v32/drivers/pci/bios.c   |  22 -----
 arch/cris/include/asm/pci.h             |   3 -
 arch/ia64/include/asm/pci.h             |   4 +-
 arch/ia64/pci/pci.c                     |  46 ----------
 arch/microblaze/include/asm/pci.h       |   8 +-
 arch/microblaze/pci/pci-common.c        |  99 ++------------------
 arch/mips/include/asm/pci.h             |   4 -
 arch/mips/pci/pci.c                     |  24 -----
 arch/mn10300/include/asm/pci.h          |   3 -
 arch/mn10300/unit-asb2305/pci-asb2305.c |  23 -----
 arch/parisc/include/asm/pci.h           |   3 -
 arch/parisc/kernel/pci.c                |  28 ------
 arch/powerpc/include/asm/pci.h          |   9 +-
 arch/powerpc/kernel/pci-common.c        | 105 +++-------------------
 arch/sh/drivers/pci/pci.c               |  21 -----
 arch/sh/include/asm/pci.h               |   3 +-
 arch/sparc/include/asm/pci_64.h         |   5 +-
 arch/sparc/kernel/pci.c                 | 155 --------------------------------
 arch/unicore32/include/asm/pci.h        |   2 -
 arch/unicore32/kernel/pci.c             |  23 -----
 arch/x86/include/asm/pci.h              |   6 +-
 arch/x86/pci/i386.c                     |  47 ----------
 arch/xtensa/include/asm/pci.h           |   9 +-
 arch/xtensa/kernel/pci.c                | 112 ++---------------------
 drivers/pci/Makefile                    |   1 +
 drivers/pci/mmap.c                      |  67 ++++++++++++++
 drivers/pci/pci-sysfs.c                 |  76 +++++++---------
 drivers/pci/pci.h                       |   4 +-
 drivers/pci/proc.c                      |  41 ++++++---
 include/linux/pci.h                     |  30 +++++++
 33 files changed, 211 insertions(+), 805 deletions(-)
 create mode 100644 drivers/pci/mmap.c

-- 
2.9.3

^ permalink raw reply	[flat|nested] 39+ messages in thread

end of thread, other threads:[~2017-04-19 18:38 UTC | newest]

Thread overview: 39+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-12 12:25 [PATCH v2 00/27] PCI resource mmap cleanup David Woodhouse
2017-04-12 12:25 ` [PATCH v2 01/27] pci: Fix pci_mmap_fits() for HAVE_PCI_RESOURCE_TO_USER platforms David Woodhouse
2017-04-12 12:25 ` [PATCH v2 02/27] pci: Fix another sanity check bug in /proc/pci mmap David Woodhouse
2017-04-12 12:25 ` [PATCH v2 03/27] pci: Only allow WC mmap on prefetchable resources David Woodhouse
2017-04-12 12:25 ` [PATCH v2 04/27] xtensa: Do not mmap PCI BARs to userspace as write-through David Woodhouse
2017-04-12 12:25 ` [PATCH v2 05/27] pci: Add arch_can_pci_mmap_wc() macro David Woodhouse
2017-04-12 12:25 ` [PATCH v2 06/27] pci: Move multiple declarations of pci_mmap_page_range() to <linux/pci.h> David Woodhouse
2017-04-12 12:25 ` [PATCH v2 07/27] pci: Add arch_can_pci_mmap_io() on architectures which can mmap() I/O space David Woodhouse
2017-04-12 12:25 ` [PATCH v2 08/27] pci: Use BAR index in sysfs attr->private instead of resource pointer David Woodhouse
2017-04-12 12:25 ` [PATCH v2 09/27] pci: Add BAR index argument to pci_mmap_page_range() David Woodhouse
2017-04-12 12:25 ` [PATCH v2 10/27] pci: Add pci_mmap_resource_range() and use it for ARM64 David Woodhouse
2017-04-12 12:26 ` [PATCH v2 11/27] arm: Use generic pci_mmap_resource_range() David Woodhouse
2017-04-12 12:26 ` [PATCH v2 12/27] cris: " David Woodhouse
2017-04-13  7:37   ` Jesper Nilsson
2017-04-13  8:39     ` David Woodhouse
2017-04-12 12:26 ` [PATCH v2 13/27] mips: " David Woodhouse
2017-04-12 12:26 ` [PATCH v2 14/27] mn10300: " David Woodhouse
2017-04-12 12:26 ` [PATCH v2 15/27] parisc: " David Woodhouse
2017-04-12 12:26 ` [PATCH v2 16/27] sh: " David Woodhouse
2017-04-12 12:26 ` [PATCH v2 17/27] unicore: " David Woodhouse
2017-04-12 12:26 ` [PATCH v2 18/27] x86: " David Woodhouse
2017-04-12 12:26 ` [PATCH v2 19/27] pci: Add I/O BAR support to " David Woodhouse
2017-04-12 12:26 ` [PATCH v2 20/27] powerpc: Use " David Woodhouse
2017-04-12 12:26 ` [PATCH v2 21/27] microblaze: " David Woodhouse
2017-04-12 12:26 ` [PATCH v2 22/27] xtensa: " David Woodhouse
2017-04-12 12:26 ` [PATCH v2 23/27] ia64: Remove redundant valid_mmap_phys_addr_range() from pci_mmap_page_range() David Woodhouse
2017-04-12 12:26 ` [PATCH v2 24/27] ia64: Remove redundant checks for WC in pci_mmap_page_range() David Woodhouse
2017-04-12 12:26 ` [PATCH v2 25/27] ia64: Use generic pci_mmap_resource_range() David Woodhouse
2017-04-12 21:47   ` Tony Luck
2017-04-12 21:53     ` Thomas Gleixner
2017-04-13  8:39     ` David Woodhouse
2017-04-12 12:26 ` [PATCH v2 26/27] sparc: " David Woodhouse
2017-04-12 12:26 ` [PATCH v2 27/27] pci: Kill ARCH_GENERIC_PCI_MMAP_RESOURCE David Woodhouse
2017-04-13  9:22 ` [PATCH v2 14/27] mn10300: Use generic pci_mmap_resource_range() David Howells
2017-04-13  9:22 ` [PATCH v2 10/27] pci: Add pci_mmap_resource_range() and use it for ARM64 David Howells
2017-04-18 18:28 ` [PATCH v2 00/27] PCI resource mmap cleanup Bjorn Helgaas
2017-04-18 18:51   ` Bjorn Helgaas
2017-04-19  7:23   ` David Woodhouse
2017-04-19 18:37     ` Bjorn Helgaas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).