summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/broadcom/cnic.c
diff options
context:
space:
mode:
authorMichael Chan <mchan@broadcom.com>2012-12-05 14:10:14 +0400
committerDavid S. Miller <davem@davemloft.net>2012-12-06 01:01:28 +0400
commitcaa9e931fe40c9ffad4d951555675417ab074ea5 (patch)
tree5aa9d6099db3b5a28f525dac74bdcf40be33284e /drivers/net/ethernet/broadcom/cnic.c
parent0e1efe9d5e10921f1e2152b108e013605fca3c9f (diff)
downloadlinux-caa9e931fe40c9ffad4d951555675417ab074ea5.tar.xz
cnic: Reset iSCSI EQ during shutdown.
Without the reset, reloading the cnic driver can cause the iSCSI Event Queue to be out of sync with the driver and cause intermittent crash. Signed-off-by: Michael Chan <mchan@broadcom.com> Acked-by: Ariel Elior <ariele@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/broadcom/cnic.c')
-rw-r--r--drivers/net/ethernet/broadcom/cnic.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/net/ethernet/broadcom/cnic.c b/drivers/net/ethernet/broadcom/cnic.c
index 3b825f422090..5437e2aa97b5 100644
--- a/drivers/net/ethernet/broadcom/cnic.c
+++ b/drivers/net/ethernet/broadcom/cnic.c
@@ -5344,8 +5344,27 @@ static void cnic_stop_bnx2_hw(struct cnic_dev *dev)
static void cnic_stop_bnx2x_hw(struct cnic_dev *dev)
{
struct cnic_local *cp = dev->cnic_priv;
+ u32 hc_index = HC_INDEX_ISCSI_EQ_CONS;
+ u32 sb_id = cp->status_blk_num;
+ u32 idx_off, syn_off;
cnic_free_irq(dev);
+
+ if (BNX2X_CHIP_IS_E2_PLUS(cp->chip_id)) {
+ idx_off = offsetof(struct hc_status_block_e2, index_values) +
+ (hc_index * sizeof(u16));
+
+ syn_off = CSTORM_HC_SYNC_LINE_INDEX_E2_OFFSET(hc_index, sb_id);
+ } else {
+ idx_off = offsetof(struct hc_status_block_e1x, index_values) +
+ (hc_index * sizeof(u16));
+
+ syn_off = CSTORM_HC_SYNC_LINE_INDEX_E1X_OFFSET(hc_index, sb_id);
+ }
+ CNIC_WR16(dev, BAR_CSTRORM_INTMEM + syn_off, 0);
+ CNIC_WR16(dev, BAR_CSTRORM_INTMEM + CSTORM_STATUS_BLOCK_OFFSET(sb_id) +
+ idx_off, 0);
+
*cp->kcq1.hw_prod_idx_ptr = 0;
CNIC_WR(dev, BAR_CSTRORM_INTMEM +
CSTORM_ISCSI_EQ_CONS_OFFSET(cp->pfid, 0), 0);