Skip to content

PCI: Rework config space locking, add INTx masking services

Jan Kiszka kvm linux-pci lkml 2 versions – Applied

Status from this message: Applied this series to linux-next, thanks.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest3 patches 3 repliesApplied
  2. v13 patches 6 repliesSuperseded

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/3pci: Rework config space blocking servicesdrivers/pci/access.c drivers/pci/iov.c drivers/pci/pci.c +4 more+131 -501 reply
2/3pci: Introduce INTx check & mask APIdrivers/pci/access.c drivers/pci/pci.c drivers/pci/pci.h +1 more+116 -10 replies
3/3uio: Convert uio_generic_pci to new intx masking APIdrivers/uio/uio_pci_generic.c+7 -720 replies

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchMichael S. TsirkinBrian King
1/3A-b A-b
2/3A-b
3/3A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/3] PCI: Rework config space locking, add INTx masking services

[ Rebase of v1 over yesterday's linux-next ]

This series tries to heal the currently broken locking scheme around PCI config space accesses.

We have an interface lock out access via sysfs, but that service wrongly assumes it is only called by one instance at a time for some device. So two loops doing

echo 1 > /sys/bus/pci/devices/<some-device>/reset

in parallel will trigger a kernel BUG at the moment.

Besides synchronizing with user space, we also need to manage config space access of generic PCI drivers. They need to mask legacy interrupt lines while the specific driver runs in user space or a guest OS.

The approach taken here is provide mutex-like locking for general access - which still requires a special mechanism due to requirements of the IBM Power RAID SCSI driver. Furthermore, INTx masking is now available via the PCI core and synchronized via the internal pci_lock.

Jan Kiszka (3):
pci: Rework config space blocking services
pci: Introduce INTx check & mask API
uio: Convert uio_generic_pci to new intx masking API

 drivers/pci/access.c          |   76 +++++++++++++++++----------
 drivers/pci/iov.c             |   12 ++--
 drivers/pci/pci.c             |  114 ++++++++++++++++++++++++++++++++++++++++-
 drivers/pci/pci.h             |    2 +
 drivers/scsi/ipr.c            |   67 +++++++++++++++++++++---
 drivers/scsi/ipr.h            |    1 +
 drivers/uio/uio_pci_generic.c |   76 ++-------------------------
 include/linux/pci.h           |   17 ++++--
 8 files changed, 248 insertions(+), 117 deletions(-)
Signature · 1 line
1.7.3.4