* [PATCH] tg3: Fix INTx fallback when MSI fails
@ 2010-04-16 13:15 Andre Detsch
2010-04-21 23:17 ` David Miller
0 siblings, 1 reply; 6+ messages in thread
From: Andre Detsch @ 2010-04-16 13:15 UTC (permalink / raw)
To: netdev, Matt Carlson
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)
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] tg3: Fix INTx fallback when MSI fails
2010-04-16 13:15 [PATCH] tg3: Fix INTx fallback when MSI fails Andre Detsch
@ 2010-04-21 23:17 ` David Miller
2010-04-26 17:27 ` [PATCH v2] " Andre Detsch
0 siblings, 1 reply; 6+ messages in thread
From: David Miller @ 2010-04-21 23:17 UTC (permalink / raw)
To: adetsch; +Cc: netdev, mcarlson
From: Andre Detsch <adetsch@br.ibm.com>
Date: Fri, 16 Apr 2010 10:15:11 -0300
> 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>
Broadcom folks, please review, thanks.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2] tg3: Fix INTx fallback when MSI fails
2010-04-21 23:17 ` David Miller
@ 2010-04-26 17:27 ` Andre Detsch
2010-04-26 18:10 ` David Miller
0 siblings, 1 reply; 6+ messages in thread
From: Andre Detsch @ 2010-04-26 17:27 UTC (permalink / raw)
To: netdev, mcarlson, Michael Chan
tg3: Fix INTx fallback when MSI fails
MSI setup changes the value of irq_vec in struct tg3 *tp.
This attribute 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.
v2: removed unnecessary changes
Index: linux-2.6.34-rc5/drivers/net/tg3.c
===================================================================
--- linux-2.6.34-rc5.orig/drivers/net/tg3.c 2010-04-19 20:29:56.000000000 -0300
+++ linux-2.6.34-rc5/drivers/net/tg3.c 2010-04-26 14:10:42.000000000 -0300
@@ -8633,6 +8633,7 @@ static int tg3_test_msi(struct tg3 *tp)
pci_disable_msi(tp->pdev);
tp->tg3_flags2 &= ~TG3_FLG2_USING_MSI;
+ tp->napi[0].irq_vec = tp->pdev->irq;
err = tg3_request_irq(tp, 0);
if (err)
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] tg3: Fix INTx fallback when MSI fails
2010-04-26 18:10 ` David Miller
@ 2010-04-26 18:01 ` Michael Chan
2010-04-26 18:15 ` David Miller
0 siblings, 1 reply; 6+ messages in thread
From: Michael Chan @ 2010-04-26 18:01 UTC (permalink / raw)
To: David Miller; +Cc: adetsch@br.ibm.com, netdev@vger.kernel.org, Matthew Carlson
On Mon, 2010-04-26 at 11:10 -0700, David Miller wrote:
> From: Andre Detsch <adetsch@br.ibm.com>
> Date: Mon, 26 Apr 2010 14:27:07 -0300
>
> > tg3: Fix INTx fallback when MSI fails
> >
> > MSI setup changes the value of irq_vec in struct tg3 *tp.
> > This attribute 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>
>
> Broadcom folks, I've already asked you to review Andre's original patch.
>
> If you can't be bothered to look at and ACK/NACK a simple fix like
> this for 10 days, then I'm just going to apply Andre's patch as-is
> since it looks right to me.
>
> If the idea was to bundle this up into a set of 15 patches you guys
> already have ready to bomb at me, I absolutely do not want you guys to
> operate that way. It doesn't work. You should be able to ACK a
> simple patch like this as soon as possible so it can be integrated
> upstream in the most expediant manner possible.
>
> Thanks.
>
Sorry, Matt just got back from vacation. I discussed with Andre earlier
today to come up with the new v2 patch. So this patch has my:
Acked-by: Michael Chan <mchan@broadcom.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] tg3: Fix INTx fallback when MSI fails
2010-04-26 17:27 ` [PATCH v2] " Andre Detsch
@ 2010-04-26 18:10 ` David Miller
2010-04-26 18:01 ` Michael Chan
0 siblings, 1 reply; 6+ messages in thread
From: David Miller @ 2010-04-26 18:10 UTC (permalink / raw)
To: adetsch; +Cc: netdev, mcarlson, mchan
From: Andre Detsch <adetsch@br.ibm.com>
Date: Mon, 26 Apr 2010 14:27:07 -0300
> tg3: Fix INTx fallback when MSI fails
>
> MSI setup changes the value of irq_vec in struct tg3 *tp.
> This attribute 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>
Broadcom folks, I've already asked you to review Andre's original patch.
If you can't be bothered to look at and ACK/NACK a simple fix like
this for 10 days, then I'm just going to apply Andre's patch as-is
since it looks right to me.
If the idea was to bundle this up into a set of 15 patches you guys
already have ready to bomb at me, I absolutely do not want you guys to
operate that way. It doesn't work. You should be able to ACK a
simple patch like this as soon as possible so it can be integrated
upstream in the most expediant manner possible.
Thanks.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] tg3: Fix INTx fallback when MSI fails
2010-04-26 18:01 ` Michael Chan
@ 2010-04-26 18:15 ` David Miller
0 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2010-04-26 18:15 UTC (permalink / raw)
To: mchan; +Cc: adetsch, netdev, mcarlson
From: "Michael Chan" <mchan@broadcom.com>
Date: Mon, 26 Apr 2010 11:01:21 -0700
> Sorry, Matt just got back from vacation. I discussed with Andre earlier
> today to come up with the new v2 patch. So this patch has my:
>
> Acked-by: Michael Chan <mchan@broadcom.com>
>
Thanks a lot, applied.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2010-04-26 18:15 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-16 13:15 [PATCH] tg3: Fix INTx fallback when MSI fails Andre Detsch
2010-04-21 23:17 ` David Miller
2010-04-26 17:27 ` [PATCH v2] " Andre Detsch
2010-04-26 18:10 ` David Miller
2010-04-26 18:01 ` Michael Chan
2010-04-26 18:15 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).