Patchwork [1/1,2.6.28] cxgb3 - add one check in interrupt routine

login
register
mail settings
Submitter wendy xiong
Date Oct. 10, 2008, 8:48 p.m.
Message ID <1223671728.2614.13.camel@wendyx.austin.ibm.com>
Download mbox | patch
Permalink /patch/3860/
State Rejected
Delegated to: David Miller
Headers show

Comments

wendy xiong - Oct. 10, 2008, 8:48 p.m.
Hi Jeff,

We are submitting a patch to do the test before accessing A_PL_CLI register in interrupt routine for inclusion in 2.6.28, 
as follows:



Thanks,
Wendy




--
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
David Miller - Oct. 11, 2008, 7:29 p.m.
From: wendy xiong <wendyx@us.ibm.com>
Date: Fri, 10 Oct 2008 15:48:48 -0500

> Hi Jeff,
> 
> We are submitting a patch to do the test before accessing A_PL_CLI register in interrupt routine for inclusion in 2.6.28, 
> as follows:

First, missing Signed-off-by:

Second, this is recidulious.

Every single interrupt we're going to check this error state value.  That's excessive,
and this is a performance critical fast path.

I do not want to see this begin to be a trend in the drivers, so I'm rejecting this
right now before it starts to spread.

If you want to handle this case, do something like quiesce the interrupt handler and
disable it when an error is detected.  That kind of scheme, at worst, will have the
same kinds of races that this silly test does.

--
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

Patch

diff -Nuarp linux-2.6.27-rc9/drivers/net/cxgb3/sge.c linux-2.6.27-rc9.cxgb3/drivers/net/cxgb3/sge.c
--- linux-2.6.27-rc9/drivers/net/cxgb3/sge.c    2008-10-10 15:09:31.000000000 -0500
+++ linux-2.6.27-rc9.cxgb3/drivers/net/cxgb3/sge.c      2008-10-10 15:11:44.000000000 -0500
@@ -2691,6 +2691,9 @@  static irqreturn_t t3b_intr_napi(int irq
        t3_write_reg(adap, A_PL_CLI, 0);
        map = t3_read_reg(adap, A_SG_DATA_INTR);

+       if (unlikely(pci_channel_offline(adap->pdev)))
+               return IRQ_NONE;
+
        if (unlikely(!map))     /* shared interrupt, most likely */
                return IRQ_NONE;