[PATCH] tg3: Fix INTx fallback when MSI fails

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Andre Detsch
Date: Friday, April 16, 2010 - 6:15 am

tg3: Fix INTx fallback when MSI fails

MSI setup changes the value of some key attributes of struct tg3 *tp.
These attributes must be taken into account and restored before
we try to do a new request_irq for INTx fallback.

In powerpc, the original code was leading to an EINVAL return within
request_irq, because the driver was trying to use the disabled MSI
virtual irq number instead of tp->pdev->irq.

Signed-off-by: Andre Detsch <adetsch@br.ibm.com>

---
Tested on powerpc, but should be safe for other architectures as well.

Index: linux-2.6.34-rc4/drivers/net/tg3.c
===================================================================
--- linux-2.6.34-rc4.orig/drivers/net/tg3.c	2010-04-12 21:41:35.000000000 -0400
+++ linux-2.6.34-rc4/drivers/net/tg3.c	2010-04-15 20:37:41.000000000 -0400
@@ -8633,6 +8633,9 @@ static int tg3_test_msi(struct tg3 *tp)
 	pci_disable_msi(tp->pdev);

 	tp->tg3_flags2 &= ~TG3_FLG2_USING_MSI;
+	tp->irq_cnt = 1;
+	tp->napi[0].irq_vec = tp->pdev->irq;
+	tp->dev->real_num_tx_queues = 1;

 	err = tg3_request_irq(tp, 0);
 	if (err)
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] tg3: Fix INTx fallback when MSI fails, Andre Detsch, (Fri Apr 16, 6:15 am)
Re: [PATCH] tg3: Fix INTx fallback when MSI fails, David Miller, (Wed Apr 21, 4:17 pm)
[PATCH v2] tg3: Fix INTx fallback when MSI fails, Andre Detsch, (Mon Apr 26, 10:27 am)
Re: [PATCH v2] tg3: Fix INTx fallback when MSI fails, Michael Chan, (Mon Apr 26, 11:01 am)
Re: [PATCH v2] tg3: Fix INTx fallback when MSI fails, David Miller, (Mon Apr 26, 11:10 am)
Re: [PATCH v2] tg3: Fix INTx fallback when MSI fails, David Miller, (Mon Apr 26, 11:15 am)