[DIFF] 2.6.10 add MSI to tg3

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dave,
Commit Log:
	Patch to enable tg3 to use MSI instead of line based interrupts.
	Tested on ia64 with BCM5701 (PCI mode) and it works fine there.

Signed-off-by: Grant Grundler (grundler@xxxxxxxxxxxxxxxx)


I thought at first I should add a runtime driver parameter like mthca
(Infiniband) driver does (e.g. msi=1). But I would prefer if tg3 left
(a new) TG3_FLG2_USE_MSI flag unset for bcm5xxx chips with MSI bugs.

And if the platform claims MSI support but doesn't work right,
then pci_enable_msi() will cause problems with any device whose
driver attempts to enable MSI. A kernel "command line" parameter
could turn off MSI and/or MSIX support for all devices on that platform.
(I know this is going to be a problem on parisc...I'll propose something
more concrete when I get there).

BTW, adding MSI support will enable tg3 to drop one MMIO read
in tg3_interrupt. Once this patch is accepted/rejected I'll work
on a tg3_msi_interrupt() routine and investigate status_tag implementation.

thanks,
grant


===== drivers/net/tg3.c 1.222 vs edited =====
--- 1.222/drivers/net/tg3.c	2004-11-15 15:53:08 -08:00
+++ edited/drivers/net/tg3.c	2005-01-15 11:43:51 -08:00
@@ -5679,10 +5679,19 @@
 	if (err)
 		return err;
 
-	err = request_irq(dev->irq, tg3_interrupt,
-			  SA_SHIRQ, dev->name, dev);
+	if (pci_enable_msi(tp->pdev))
+		printk(KERN_WARNING PFX "MSI NOT enabled for %s\n",
+				tp->pdev->slot_name);
+	else {
+		tw32(MSGINT_MODE, MSGINT_MODE_ENABLE);
+		printk(KERN_INFO PFX "MSI enabled on %s\n",
+				tp->pdev->slot_name);
+	}
+
+	err = request_irq(dev->irq, tg3_interrupt, SA_SHIRQ, dev->name, dev);
 
 	if (err) {
+		pci_disable_msi(tp->pdev);
 		tg3_free_consistent(tp);
 		return err;
 	}
@@ -5713,6 +5722,7 @@
 
 	if (err) {
 		free_irq(dev->irq, dev);
+		pci_disable_msi(tp->pdev);
 		tg3_free_consistent(tp);
 		return err;
 	}
@@ -5988,6 +5998,7 @@
 	spin_unlock_irq(&tp->lock);
 
 	free_irq(dev->irq, dev);
+	pci_disable_msi(tp->pdev);
 
 	memcpy(&tp->net_stats_prev, tg3_get_stats(tp->dev),
 	       sizeof(tp->net_stats_prev));
-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux