Skip to content

Commit 04f1077

Browse files
Benjamin LiJeff Garzik
authored andcommitted
qla3xxx: Fix deadlock issue on error paths
1) Fix deadlock issue when in QL_RESET_ACTIVE state and traversing through the Link State Machine 2) Fix deadlock issue when ethtool would call ql_get_settings() 3) Fix deadlock issue when adaptor is ifup'ed but adaptor fails to initialize Signed-off-by: Benjamin Li <benjamin.li@qlogic.com> Signed-off-by: Ron Mercer <ron.mercer@qlogic.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
1 parent cd238fa commit 04f1077

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

drivers/net/qla3xxx.c

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1388,6 +1388,8 @@ static void ql_link_state_machine(struct ql3_adapter *qdev)
13881388
printk(KERN_INFO PFX
13891389
"%s: Reset in progress, skip processing link "
13901390
"state.\n", qdev->ndev->name);
1391+
1392+
spin_unlock_irqrestore(&qdev->hw_lock, hw_flags);
13911393
return;
13921394
}
13931395

@@ -1519,8 +1521,10 @@ static int ql_get_auto_cfg_status(struct ql3_adapter *qdev)
15191521
spin_lock_irqsave(&qdev->hw_lock, hw_flags);
15201522
if(ql_sem_spinlock(qdev, QL_PHY_GIO_SEM_MASK,
15211523
(QL_RESOURCE_BITS_BASE_CODE | (qdev->mac_index) *
1522-
2) << 7))
1524+
2) << 7)) {
1525+
spin_unlock_irqrestore(&qdev->hw_lock, hw_flags);
15231526
return 0;
1527+
}
15241528
status = ql_is_auto_cfg(qdev);
15251529
ql_sem_unlock(qdev, QL_PHY_GIO_SEM_MASK);
15261530
spin_unlock_irqrestore(&qdev->hw_lock, hw_flags);
@@ -1534,8 +1538,10 @@ static u32 ql_get_speed(struct ql3_adapter *qdev)
15341538
spin_lock_irqsave(&qdev->hw_lock, hw_flags);
15351539
if(ql_sem_spinlock(qdev, QL_PHY_GIO_SEM_MASK,
15361540
(QL_RESOURCE_BITS_BASE_CODE | (qdev->mac_index) *
1537-
2) << 7))
1541+
2) << 7)) {
1542+
spin_unlock_irqrestore(&qdev->hw_lock, hw_flags);
15381543
return 0;
1544+
}
15391545
status = ql_get_link_speed(qdev);
15401546
ql_sem_unlock(qdev, QL_PHY_GIO_SEM_MASK);
15411547
spin_unlock_irqrestore(&qdev->hw_lock, hw_flags);
@@ -1549,8 +1555,10 @@ static int ql_get_full_dup(struct ql3_adapter *qdev)
15491555
spin_lock_irqsave(&qdev->hw_lock, hw_flags);
15501556
if(ql_sem_spinlock(qdev, QL_PHY_GIO_SEM_MASK,
15511557
(QL_RESOURCE_BITS_BASE_CODE | (qdev->mac_index) *
1552-
2) << 7))
1558+
2) << 7)) {
1559+
spin_unlock_irqrestore(&qdev->hw_lock, hw_flags);
15531560
return 0;
1561+
}
15541562
status = ql_is_link_full_dup(qdev);
15551563
ql_sem_unlock(qdev, QL_PHY_GIO_SEM_MASK);
15561564
spin_unlock_irqrestore(&qdev->hw_lock, hw_flags);
@@ -3294,6 +3302,7 @@ static int ql_adapter_up(struct ql3_adapter *qdev)
32943302
err_init:
32953303
ql_sem_unlock(qdev, QL_DRVR_SEM_MASK);
32963304
err_lock:
3305+
spin_unlock_irqrestore(&qdev->hw_lock, hw_flags);
32973306
free_irq(qdev->pdev->irq, ndev);
32983307
err_irq:
32993308
if (qdev->msi && test_bit(QL_MSI_ENABLED,&qdev->flags)) {

0 commit comments

Comments
 (0)