Skip to content

pci: fix unhandled interrupt on shutdown

Michael S. Tsirkin linux-pci lkml virtualization 5 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest10 patches 11 repliesIn review
  2. v410 patches 1 replySuperseded
  3. v310 patches 4 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v24 patches5 repliesSuperseded
v1 RFC4 patches1 replySuperseded

Changes in v5 from the cover letter

Yijing Wang <[email protected]> noted that early fixups rely on pci_msi_off.
Split out the functionality and move off the required part to run early during pci_device_setup.

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/10pci: export functions for msi/msix ctrldrivers/pci/msi.c drivers/pci/pci.h+33 -331 reply
2/10pci: move pci_msi_init_pci_dev to probe.cdrivers/pci/msi.c drivers/pci/probe.c+16 -122 replies
3/10pci: drop some duplicate codedrivers/pci/pci.c drivers/pci/probe.c+19 -351 reply
4/10pci: don't disable msi/msix at shutdowndrivers/pci/pci-driver.c+0 -23 replies
5/10pci: make msi/msix shutdown functions staticdrivers/pci/msi.c include/linux/pci.h+2 -61 reply
6/10virtio_pci: drop msi_off on probedrivers/virtio/virtio_pci_common.c+0 -32 replies
7/10ntb: drop pci_msi_off call on probedrivers/ntb/ntb_hw.c+0 -20 replies
8/10mic: drop pci_msi_off call on probedrivers/misc/mic/host/mic_intr.c+0 -20 replies
9/10pci: drop pci_msi_off calls from quirksdrivers/pci/quirks.c+0 -20 replies
10/10pci: unexport pci_msi_offdrivers/pci/pci.c drivers/pci/pci.h include/linux/pci.h+3 -20 replies

Reviews trailers per patch

5 of 10 patches have a Reviewed-by or Acked-by.

PatchFam ZhengEric W. Biederman
1/10R-b
2/10R-b A-b
3/10
4/10R-b T-b
5/10R-b
6/10R-b R-b
7/10
8/10
9/10
10/10

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

Read the v5 thread

Cover letter [PATCH v5 00/10] pci: fix unhandled interrupt on shutdown

Fam Zheng noticed that pci shutdown disables msi and msix of a device while device is still active. This was intended to fix kexec with fusion devices but had the unintended effect of breaking even regular shutdown when using virtio.

The same problem would affect any driver which doesn't register a level interrupt handler when using msix.

I think the fix is to avoid touching device on shutdown:
we clear bus master anyway, so we won't get any more msi interrupts, and bus reset will clear the msi/msix state eventually anyway.

Patches 1-6 work well for me.
Given they affect all pci devices, and the bug has been there since 2.6 times, I think there's no rush: we can merge them for 4.1.

At the same time, once merged, patches 1-4 will likely make a good stable
candidate: the problem was actually observed in the field, although the BZ in question isn't public yet.

Patches 7-10 compiled only, will need maintainer ack.

Please review, and consider at least 1-6 for 4.1.

changes from v4:
Yijing Wang <[email protected]> noted that early fixups rely on pci_msi_off.
Split out the functionality and move off the required part to run early during pci_device_setup.
Changes from v3:
fix a copy-and-paste error in
pci: drop some duplicate code
other patches are unchanged
drop Cc stable for now
Changes from v2:
move code from probe to device enumeration add patches to unexport pci_msi_off

Michael S. Tsirkin (10):
pci: export functions for msi/msix ctrl
pci: move pci_msi_init_pci_dev to pci.c
pci: drop some duplicate code
pci: don't disable msi/msix at shutdown
pci: make msi/msix shutdown functions static
virtio_pci: drop msi_off on probe
ntb: drop pci_msi_off call on probe
mic: drop pci_msi_off call on probe
pci: drop pci_msi_off calls from quirks
pci: unexport pci_msi_off

 drivers/pci/pci.h                  | 25 +++++++++++++++++
 include/linux/pci.h                |  5 ----
 drivers/misc/mic/host/mic_intr.c   |  2 --
 drivers/ntb/ntb_hw.c               |  2 --
 drivers/pci/msi.c                  | 57 ++++++++------------------------------
 drivers/pci/pci-driver.c           |  2 --
 drivers/pci/pci.c                  | 25 ++++-------------
 drivers/pci/probe.c                | 15 ++++++++++
 drivers/pci/quirks.c               |  2 --
 drivers/virtio/virtio_pci_common.c |  3 --
 10 files changed, 57 insertions(+), 81 deletions(-)
Signature · 1 line
MST