diff options
-rw-r--r-- | drivers/pci/pci.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index d08c0d8ec22e..a7f6dcea0d76 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -1984,10 +1984,6 @@ void pci_enable_ari(struct pci_dev *dev) if (pcie_ari_disabled || !pci_is_pcie(dev) || dev->devfn) return; - pos = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ARI); - if (!pos) - return; - bridge = dev->bus->self; if (!bridge || !pci_is_pcie(bridge)) return; @@ -2006,10 +2002,14 @@ void pci_enable_ari(struct pci_dev *dev) return; pci_read_config_word(bridge, pos + PCI_EXP_DEVCTL2, &ctrl); - ctrl |= PCI_EXP_DEVCTL2_ARI; + if (pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ARI)) { + ctrl |= PCI_EXP_DEVCTL2_ARI; + bridge->ari_enabled = 1; + } else { + ctrl &= ~PCI_EXP_DEVCTL2_ARI; + bridge->ari_enabled = 0; + } pci_write_config_word(bridge, pos + PCI_EXP_DEVCTL2, ctrl); - - bridge->ari_enabled = 1; } /** |