aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bna/bnad.c
diff options
context:
space:
mode:
authorRasesh Mody <rmody@brocade.com>2010-12-23 16:45:09 -0500
committerDavid S. Miller <davem@davemloft.net>2010-12-25 22:16:03 -0500
commit1d32f7696286eef9e5644eb57e79a36756274357 (patch)
treeb31e78cc2c72ae9893ac8dea1401cff2b94e104e /drivers/net/bna/bnad.c
parentaad75b66f1d3784514351f06bc589c55d5325bc8 (diff)
bna: IOC failure auto recovery fix
Change Details: - Made IOC auto_recovery synchronized and not timer based. - Only one PCI function will attempt to recover and reinitialize the ASIC on a failure, that too after all the active PCI functions acknowledge the IOC failure. Signed-off-by: Debashis Dutt <ddutt@brocade.com> Signed-off-by: Rasesh Mody <rmody@brocade.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bna/bnad.c')
-rw-r--r--drivers/net/bna/bnad.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/drivers/net/bna/bnad.c b/drivers/net/bna/bnad.c
index 140ea95b9150..fad912656fe4 100644
--- a/drivers/net/bna/bnad.c
+++ b/drivers/net/bna/bnad.c
@@ -1425,13 +1425,24 @@ bnad_ioc_hb_check(unsigned long data)
1425} 1425}
1426 1426
1427static void 1427static void
1428bnad_ioc_sem_timeout(unsigned long data) 1428bnad_iocpf_timeout(unsigned long data)
1429{ 1429{
1430 struct bnad *bnad = (struct bnad *)data; 1430 struct bnad *bnad = (struct bnad *)data;
1431 unsigned long flags; 1431 unsigned long flags;
1432 1432
1433 spin_lock_irqsave(&bnad->bna_lock, flags); 1433 spin_lock_irqsave(&bnad->bna_lock, flags);
1434 bfa_nw_ioc_sem_timeout((void *) &bnad->bna.device.ioc); 1434 bfa_nw_iocpf_timeout((void *) &bnad->bna.device.ioc);
1435 spin_unlock_irqrestore(&bnad->bna_lock, flags);
1436}
1437
1438static void
1439bnad_iocpf_sem_timeout(unsigned long data)
1440{
1441 struct bnad *bnad = (struct bnad *)data;
1442 unsigned long flags;
1443
1444 spin_lock_irqsave(&bnad->bna_lock, flags);
1445 bfa_nw_iocpf_sem_timeout((void *) &bnad->bna.device.ioc);
1435 spin_unlock_irqrestore(&bnad->bna_lock, flags); 1446 spin_unlock_irqrestore(&bnad->bna_lock, flags);
1436} 1447}
1437 1448
@@ -3132,11 +3143,13 @@ bnad_pci_probe(struct pci_dev *pdev,
3132 ((unsigned long)bnad)); 3143 ((unsigned long)bnad));
3133 setup_timer(&bnad->bna.device.ioc.hb_timer, bnad_ioc_hb_check, 3144 setup_timer(&bnad->bna.device.ioc.hb_timer, bnad_ioc_hb_check,
3134 ((unsigned long)bnad)); 3145 ((unsigned long)bnad));
3135 setup_timer(&bnad->bna.device.ioc.sem_timer, bnad_ioc_sem_timeout, 3146 setup_timer(&bnad->bna.device.ioc.iocpf_timer, bnad_iocpf_timeout,
3147 ((unsigned long)bnad));
3148 setup_timer(&bnad->bna.device.ioc.sem_timer, bnad_iocpf_sem_timeout,
3136 ((unsigned long)bnad)); 3149 ((unsigned long)bnad));
3137 3150
3138 /* Now start the timer before calling IOC */ 3151 /* Now start the timer before calling IOC */
3139 mod_timer(&bnad->bna.device.ioc.ioc_timer, 3152 mod_timer(&bnad->bna.device.ioc.iocpf_timer,
3140 jiffies + msecs_to_jiffies(BNA_IOC_TIMER_FREQ)); 3153 jiffies + msecs_to_jiffies(BNA_IOC_TIMER_FREQ));
3141 3154
3142 /* 3155 /*