Commit 8d181018 authored by Matthew Wilcox's avatar Matthew Wilcox Committed by Jesse Barnes

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: default avatarDavid S. Miller <davem@davemloft.net>
Tested-by: default avatarDavid S. Miller <davem@davemloft.net>
Reviewed-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarMatthew Wilcox <willy@linux.intel.com>
Signed-off-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
parent 029091df
...@@ -455,8 +455,6 @@ static int msix_capability_init(struct pci_dev *dev, ...@@ -455,8 +455,6 @@ static int msix_capability_init(struct pci_dev *dev,
entry->msi_attrib.default_irq = dev->irq; entry->msi_attrib.default_irq = dev->irq;
entry->msi_attrib.pos = pos; entry->msi_attrib.pos = pos;
entry->mask_base = base; entry->mask_base = base;
entry->masked = readl(base + j * PCI_MSIX_ENTRY_SIZE +
PCI_MSIX_ENTRY_VECTOR_CTRL_OFFSET);
msix_mask_irq(entry, 1); msix_mask_irq(entry, 1);
list_add_tail(&entry->list, &dev->msi_list); list_add_tail(&entry->list, &dev->msi_list);
...@@ -493,6 +491,12 @@ static int msix_capability_init(struct pci_dev *dev, ...@@ -493,6 +491,12 @@ static int msix_capability_init(struct pci_dev *dev,
msix_set_enable(dev, 1); msix_set_enable(dev, 1);
dev->msix_enabled = 1; dev->msix_enabled = 1;
list_for_each_entry(entry, &dev->msi_list, list) {
int vector = entry->msi_attrib.entry_nr;
entry->masked = readl(base + vector * PCI_MSIX_ENTRY_SIZE +
PCI_MSIX_ENTRY_VECTOR_CTRL_OFFSET);
}
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment