All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix MSI-X with NIU cards
@ 2009-05-08 13:13 Matthew Wilcox
  2009-05-11  1:21 ` Michael Ellerman
                   ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Matthew Wilcox @ 2009-05-08 13:13 UTC (permalink / raw)
  To: Jesse Barnes; +Cc: David S. Miller, linux-pci, linux-kernel


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>

diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index 6f2e629..3627732 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -455,8 +455,6 @@ static int msix_capability_init(struct pci_dev *dev,
 		entry->msi_attrib.default_irq = dev->irq;
 		entry->msi_attrib.pos = pos;
 		entry->mask_base = base;
-		entry->masked = readl(base + j * PCI_MSIX_ENTRY_SIZE +
-					PCI_MSIX_ENTRY_VECTOR_CTRL_OFFSET);
 		msix_mask_irq(entry, 1);
 
 		list_add_tail(&entry->list, &dev->msi_list);
@@ -493,6 +491,12 @@ static int msix_capability_init(struct pci_dev *dev,
 	msix_set_enable(dev, 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;
 }
 

-- 
Matthew Wilcox				Intel Open Source Technology Centre
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours.  We can't possibly take such
a retrograde step."

^ permalink raw reply related	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2009-05-14  6:23 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-08 13:13 [PATCH] Fix MSI-X with NIU cards Matthew Wilcox
2009-05-11  1:21 ` Michael Ellerman
2009-05-11  5:36   ` David Miller
2009-05-11 14:30     ` Michael Ellerman
2009-05-11 23:40       ` David Miller
2009-05-11 23:59         ` Jesse Barnes
2009-05-12  2:21         ` Michael Ellerman
2009-05-13 10:07           ` Matthew Wilcox
2009-05-13  4:06   ` Hidetoshi Seto
2009-05-13  4:40     ` Hidetoshi Seto
2009-05-13  4:49       ` Michael Ellerman
2009-05-13  4:10 ` [PATCH] PCI MSI: Yet another fix for " Hidetoshi Seto
2009-05-13  5:13   ` David Miller
2009-05-13  4:54 ` [PATCH] PCI MSI: Yet another fix for MSI-X with NIU cards, v2 Hidetoshi Seto
2009-05-13  5:06   ` Hidetoshi Seto
2009-05-13  6:31     ` Michael Ellerman
2009-05-13 18:43     ` Matthew Wilcox
2009-05-14  6:22       ` Hidetoshi Seto

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.