diff options
author | Matthew Wilcox <matthew@wil.cx> | 2009-05-08 09:13:33 -0400 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2009-05-11 20:02:27 -0400 |
commit | 8d181018532dd709ec1f789e374cda92d7b01ce1 (patch) | |
tree | b693f6b993e7b324fe8cd3bee7d3e2d73c1c13bf /drivers/pci | |
parent | 029091df01116aff8dea89ce96a0a2534401803a (diff) |
PCI MSI: Fix MSI-X with NIU cards
The NIU device refuses to allow accesses to MSI-X registers before MSI-X
is enabled. This patch fixes the problem by moving the read of the mask
register to after MSI-X is enabled.
Reported-by: David S. Miller <davem@davemloft.net>
Tested-by: David S. Miller <davem@davemloft.net>
Reviewed-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/msi.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c index 6f2e6295e773..362773247fbf 100644 --- a/drivers/pci/msi.c +++ b/drivers/pci/msi.c | |||
@@ -455,8 +455,6 @@ static int msix_capability_init(struct pci_dev *dev, | |||
455 | entry->msi_attrib.default_irq = dev->irq; | 455 | entry->msi_attrib.default_irq = dev->irq; |
456 | entry->msi_attrib.pos = pos; | 456 | entry->msi_attrib.pos = pos; |
457 | entry->mask_base = base; | 457 | entry->mask_base = base; |
458 | entry->masked = readl(base + j * PCI_MSIX_ENTRY_SIZE + | ||
459 | PCI_MSIX_ENTRY_VECTOR_CTRL_OFFSET); | ||
460 | msix_mask_irq(entry, 1); | 458 | msix_mask_irq(entry, 1); |
461 | 459 | ||
462 | list_add_tail(&entry->list, &dev->msi_list); | 460 | list_add_tail(&entry->list, &dev->msi_list); |
@@ -493,6 +491,12 @@ static int msix_capability_init(struct pci_dev *dev, | |||
493 | msix_set_enable(dev, 1); | 491 | msix_set_enable(dev, 1); |
494 | dev->msix_enabled = 1; | 492 | dev->msix_enabled = 1; |
495 | 493 | ||
494 | list_for_each_entry(entry, &dev->msi_list, list) { | ||
495 | int vector = entry->msi_attrib.entry_nr; | ||
496 | entry->masked = readl(base + vector * PCI_MSIX_ENTRY_SIZE + | ||
497 | PCI_MSIX_ENTRY_VECTOR_CTRL_OFFSET); | ||
498 | } | ||
499 | |||
496 | return 0; | 500 | return 0; |
497 | } | 501 | } |
498 | 502 | ||