aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
diff options
context:
space:
mode:
authorMichael Chan <mchan@broadcom.com>2013-01-22 22:21:52 -0500
committerDavid S. Miller <davem@davemloft.net>2013-01-23 13:58:29 -0500
commitad9b4359c7839d4d87aad2c0d50c8a2ef3bcddb3 (patch)
treef64349d80b54c58cd85f5f6e8fcb756c07c1d322 /drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
parent580d9d081341aad5341884f9e6b070c01512e94c (diff)
cnic, bnx2x: Add CNIC_DRV_STATE_HANDLES_IRQ to ethdev->drv_state
In INTA mode, cnic and bnx2x share the same IRQ. During chip reset, for example, cnic will stop servicing IRQs after it has shutdown the cnic hardware resources. However, the shared IRQ is still active as bnx2x needs to finish the reset. There is a window when bnx2x does not know that cnic is no longer handling IRQ and things don't always work properly. Add a flag to tell bnx2x that cnic is handling IRQ. The flag is set before the first cnic IRQ is expected and cleared when no more cnic IRQs are expected, so there should be no race conditions. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com> Signed-off-by: Ariel Elior <ariele@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c')
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
index ac00ddcd32fa..c4daee1b7286 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
@@ -1875,14 +1875,12 @@ irqreturn_t bnx2x_interrupt(int irq, void *dev_instance)
1875 if (status & (mask | 0x1)) { 1875 if (status & (mask | 0x1)) {
1876 struct cnic_ops *c_ops = NULL; 1876 struct cnic_ops *c_ops = NULL;
1877 1877
1878 if (likely(bp->state == BNX2X_STATE_OPEN)) { 1878 rcu_read_lock();
1879 rcu_read_lock(); 1879 c_ops = rcu_dereference(bp->cnic_ops);
1880 c_ops = rcu_dereference(bp->cnic_ops); 1880 if (c_ops && (bp->cnic_eth_dev.drv_state &
1881 if (c_ops) 1881 CNIC_DRV_STATE_HANDLES_IRQ))
1882 c_ops->cnic_handler(bp->cnic_data, 1882 c_ops->cnic_handler(bp->cnic_data, NULL);
1883 NULL); 1883 rcu_read_unlock();
1884 rcu_read_unlock();
1885 }
1886 1884
1887 status &= ~mask; 1885 status &= ~mask;
1888 } 1886 }