Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 139395
b: refs/heads/master
c: eeafda7
h: refs/heads/master
i:
  139393: bfee5c4
  139391: 0254053
v: v3
  • Loading branch information
Yinghai Lu authored and Jesse Barnes committed Mar 30, 2009
1 parent 37e9c3e commit 4fb6eb7
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 3 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: de7453065d5d5243686467998f1fcc58d20e0a7c
refs/heads/master: eeafda70bf2807544e96fa4e52b2433cd470ff46
32 changes: 30 additions & 2 deletions trunk/drivers/pci/quirks.c
Original file line number Diff line number Diff line change
Expand Up @@ -2206,6 +2206,33 @@ static int __devinit host_bridge_with_leaf(struct pci_dev *host_bridge)
return found;
}

#define PCI_HT_CAP_SLAVE_CTRL0 4 /* link control */
#define PCI_HT_CAP_SLAVE_CTRL1 8 /* link control to */

static int __devinit is_end_of_ht_chain(struct pci_dev *dev)
{
int pos, ctrl_off;
int end = 0;
u16 flags, ctrl;

pos = pci_find_ht_capability(dev, HT_CAPTYPE_SLAVE);

if (!pos)
goto out;

pci_read_config_word(dev, pos + PCI_CAP_FLAGS, &flags);

ctrl_off = ((flags >> 10) & 1) ?
PCI_HT_CAP_SLAVE_CTRL0 : PCI_HT_CAP_SLAVE_CTRL1;
pci_read_config_word(dev, pos + ctrl_off, &ctrl);

if (ctrl & (1 << 6))
end = 1;

out:
return end;
}

static void __devinit nv_ht_enable_msi_mapping(struct pci_dev *dev)
{
struct pci_dev *host_bridge;
Expand All @@ -2230,8 +2257,9 @@ static void __devinit nv_ht_enable_msi_mapping(struct pci_dev *dev)
if (!found)
return;

/* don't enable host_bridge with leaf directly here */
if (host_bridge == dev && host_bridge_with_leaf(host_bridge))
/* don't enable end_device/host_bridge with leaf directly here */
if (host_bridge == dev && is_end_of_ht_chain(host_bridge) &&
host_bridge_with_leaf(host_bridge))
goto out;

/* root did that ! */
Expand Down

0 comments on commit 4fb6eb7

Please sign in to comment.