Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 117803
b: refs/heads/master
c: 8113587
h: refs/heads/master
i:
  117801: 7f0753c
  117799: 0938333
v: v3
  • Loading branch information
Zhao, Yu authored and Jesse Barnes committed Oct 23, 2008
1 parent 1e2adca commit 24294cb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d2174c3c07adad88dd9ba37a731e0b00b746822a
refs/heads/master: 8113587c2d14d3be2414190845b2e2617c0aa33b
21 changes: 13 additions & 8 deletions trunk/drivers/pci/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -1309,27 +1309,32 @@ void pci_enable_ari(struct pci_dev *dev)
int pos;
u32 cap;
u16 ctrl;
struct pci_dev *bridge;

if (!dev->is_pcie)
if (!dev->is_pcie || dev->devfn)
return;

if (dev->pcie_type != PCI_EXP_TYPE_ROOT_PORT &&
dev->pcie_type != PCI_EXP_TYPE_DOWNSTREAM)
pos = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ARI);
if (!pos)
return;

pos = pci_find_capability(dev, PCI_CAP_ID_EXP);
bridge = dev->bus->self;
if (!bridge || !bridge->is_pcie)
return;

pos = pci_find_capability(bridge, PCI_CAP_ID_EXP);
if (!pos)
return;

pci_read_config_dword(dev, pos + PCI_EXP_DEVCAP2, &cap);
pci_read_config_dword(bridge, pos + PCI_EXP_DEVCAP2, &cap);
if (!(cap & PCI_EXP_DEVCAP2_ARI))
return;

pci_read_config_word(dev, pos + PCI_EXP_DEVCTL2, &ctrl);
pci_read_config_word(bridge, pos + PCI_EXP_DEVCTL2, &ctrl);
ctrl |= PCI_EXP_DEVCTL2_ARI;
pci_write_config_word(dev, pos + PCI_EXP_DEVCTL2, ctrl);
pci_write_config_word(bridge, pos + PCI_EXP_DEVCTL2, ctrl);

dev->ari_enabled = 1;
bridge->ari_enabled = 1;
}

int
Expand Down

0 comments on commit 24294cb

Please sign in to comment.