public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Disable INTx when enabling MSI in forcedeth
@ 2006-11-22  2:28 Daniel Barkalow
  2006-11-22  2:42 ` Linus Torvalds
  0 siblings, 1 reply; 7+ messages in thread
From: Daniel Barkalow @ 2006-11-22  2:28 UTC (permalink / raw)
  To: linux-kernel
  Cc: Jeff Garzik, David Miller, Roland Dreier, Linus Torvalds,
	Ayaz Abdulla

My nVidia ethernet card doesn't disable its own INTx when MSI is
enabled. This causes a steady stream of spurious interrupts that
eventually kills my SATA IRQ if MSI is used with forcedeth, which is
true by default. Simply disabling the INTx interrupt takes care of it.

This is against -stable, and would be suitable once someone who knows the 
code verifies that it's correct.

Works for me, but I've obviously only tested the codepath where using
MSI succeeds.

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
---

(cc:s to people who were talking about the existance of devices 
that misbehave like this)

The device in question is:
00:07.0 Bridge: nVidia Corporation MCP61 Ethernet (rev a2)
        Subsystem: ASUSTeK Computer Inc. Unknown device 8234
        Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
        Status: Cap+ 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR-
        Latency: 0 (250ns min, 5000ns max)
        Interrupt: pin A routed to IRQ 209
        Region 0: Memory at dff7d000 (32-bit, non-prefetchable) [size=4K]
        Region 1: I/O ports at e480 [size=8]
        Capabilities: [44] Power Management version 2
                Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA PME(D0+,D1+,D2+,D3hot+,D3cold+)
                Status: D0 PME-Enable+ DSel=0 DScale=0 PME-
        Capabilities: [50] Message Signalled Interrupts: 64bit+ Queue=0/3 Enable-
                Address: 00000000fee00000  Data: 4032
        Capabilities: [6c] HyperTransport: MSI Mapping

 drivers/net/forcedeth.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c
index 11b8f1b..97087d2 100644
--- a/drivers/net/forcedeth.c
+++ b/drivers/net/forcedeth.c
@@ -2691,12 +2691,14 @@ static int nv_request_irq(struct net_dev
 		}
 	}
 	if (ret != 0 && np->msi_flags & NV_MSI_CAPABLE) {
+		pci_intx(np->pci_dev, 0);
 		if ((ret = pci_enable_msi(np->pci_dev)) == 0) {
 			np->msi_flags |= NV_MSI_ENABLED;
 			if ((!intr_test && request_irq(np->pci_dev->irq, &nv_nic_irq, IRQF_SHARED, dev->name, dev) != 0) ||
 			    (intr_test && request_irq(np->pci_dev->irq, &nv_nic_irq_test, IRQF_SHARED, dev->name, dev) != 0)) {
 				printk(KERN_INFO "forcedeth: request_irq failed %d\n", ret);
 				pci_disable_msi(np->pci_dev);
+				pci_intx(np->pci_dev, 1);
 				np->msi_flags &= ~NV_MSI_ENABLED;
 				goto out_err;
 			}
@@ -2706,6 +2708,8 @@ static int nv_request_irq(struct net_dev
 			writel(0, base + NvRegMSIMap1);
 			/* enable msi vector 0 */
 			writel(NVREG_MSI_VECTOR_0_ENABLED, base + NvRegMSIIrqMask);
+		} else {
+			pci_intx(np->pci_dev, 1);
 		}
 	}
 	if (ret != 0) {
-- 
1.4.2.4


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

end of thread, other threads:[~2006-12-01  1:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-22  2:28 [PATCH] Disable INTx when enabling MSI in forcedeth Daniel Barkalow
2006-11-22  2:42 ` Linus Torvalds
2006-11-22  2:53   ` Daniel Barkalow
2006-11-22  3:43   ` Jeff Garzik
2006-11-22  7:36     ` Yinghai Lu
2006-11-22  7:09   ` Benjamin Herrenschmidt
2006-12-01  1:16   ` Chris Wright

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox