Skip to content

Commit 557853f

Browse files
Marc ZyngierLorenzo Pieralisi
authored andcommitted
PCI: Refactor HT advertising of NO_MSI flag
The few quirks that deal with NO_MSI tend to be copy-paste heavy. Refactor them so that the hierarchy of conditions is slightly cleaner. Link: https://lore.kernel.org/r/20210330151145.997953-15-maz@kernel.org Signed-off-by: Marc Zyngier <maz@kernel.org> Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> Acked-by: Bjorn Helgaas <bhelgaas@google.com>
1 parent 61af692 commit 557853f

1 file changed

Lines changed: 4 additions & 11 deletions

File tree

drivers/pci/quirks.c

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2585,10 +2585,8 @@ static int msi_ht_cap_enabled(struct pci_dev *dev)
25852585
/* Check the HyperTransport MSI mapping to know whether MSI is enabled or not */
25862586
static void quirk_msi_ht_cap(struct pci_dev *dev)
25872587
{
2588-
if (dev->subordinate && !msi_ht_cap_enabled(dev)) {
2589-
pci_warn(dev, "MSI quirk detected; subordinate MSI disabled\n");
2590-
dev->subordinate->bus_flags |= PCI_BUS_FLAGS_NO_MSI;
2591-
}
2588+
if (!msi_ht_cap_enabled(dev))
2589+
quirk_disable_msi(dev);
25922590
}
25932591
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_HT2000_PCIE,
25942592
quirk_msi_ht_cap);
@@ -2601,20 +2599,15 @@ static void quirk_nvidia_ck804_msi_ht_cap(struct pci_dev *dev)
26012599
{
26022600
struct pci_dev *pdev;
26032601

2604-
if (!dev->subordinate)
2605-
return;
2606-
26072602
/*
26082603
* Check HT MSI cap on this chipset and the root one. A single one
26092604
* having MSI is enough to be sure that MSI is supported.
26102605
*/
26112606
pdev = pci_get_slot(dev->bus, 0);
26122607
if (!pdev)
26132608
return;
2614-
if (!msi_ht_cap_enabled(dev) && !msi_ht_cap_enabled(pdev)) {
2615-
pci_warn(dev, "MSI quirk detected; subordinate MSI disabled\n");
2616-
dev->subordinate->bus_flags |= PCI_BUS_FLAGS_NO_MSI;
2617-
}
2609+
if (!msi_ht_cap_enabled(pdev))
2610+
quirk_msi_ht_cap(dev);
26182611
pci_dev_put(pdev);
26192612
}
26202613
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_CK804_PCIE,

0 commit comments

Comments
 (0)