PCI: Test INTx masking during enumeration, not at run-time
authorPiotr Gregor <piotrgregor@rsyncme.org>
Fri, 26 May 2017 21:02:25 +0000 (22:02 +0100)
committerBjorn Helgaas <bhelgaas@google.com>
Fri, 16 Jun 2017 21:12:37 +0000 (16:12 -0500)
commit99b3c58f7ba7fae801e501b45c5fcf6e08d9247f
tree092b76f6111502eb56c044bdb1fa173e4a91a737
parent2ea659a9ef488125eb46da6eb571de5eae5c43f6
PCI: Test INTx masking during enumeration, not at run-time

The test for INTx masking via PCI_COMMAND_INTX_DISABLE performed in
pci_intx_mask_supported() should be done before the device can be used.
This is to avoid writing PCI_COMMAND while the driver owns the device, in
case that has any effect on MSI/MSI-X interrupts.

Move the content of pci_intx_mask_supported() to pci_intx_mask_broken() and
call it from pci_setup_device().

The test result can be queried at any time later using the same
pci_intx_mask_supported() interface as before (though with changed
implementation), so callers (uio, vfio) should be unaffected.

Signed-off-by: Piotr Gregor <piotrgregor@rsyncme.org>
[bhelgaas: changelog, remove quirk check, remove locking, move
dev->broken_intx_masking assignment to caller]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Alex Williamson <alex.williamson@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
drivers/pci/pci.c
drivers/pci/probe.c
include/linux/pci.h