Skip to content

Commit 91bed55

Browse files
justin-hedavem330
authored andcommitted
Revert "qed: fix possible unpaired spin_{un}lock_bh in _qed_mcp_cmd_and_union()"
This reverts commit 6206b79. That patch added additional spin_{un}lock_bh(), which was harmless but pointless. The orginal code path has guaranteed the pair of spin_{un}lock_bh(). We'd better revert it before we find the exact root cause of the bug_on mentioned in that patch. Fixes: 6206b79 ("qed: fix possible unpaired spin_{un}lock_bh in _qed_mcp_cmd_and_union()") Cc: David S. Miller <[email protected]> Cc: Prabhakar Kushwaha <[email protected]> Signed-off-by: Jia He <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 8fb4792 commit 91bed55

File tree

1 file changed

+6
-17
lines changed

1 file changed

+6
-17
lines changed

drivers/net/ethernet/qlogic/qed/qed_mcp.c

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -474,18 +474,14 @@ _qed_mcp_cmd_and_union(struct qed_hwfn *p_hwfn,
474474

475475
spin_lock_bh(&p_hwfn->mcp_info->cmd_lock);
476476

477-
if (!qed_mcp_has_pending_cmd(p_hwfn)) {
478-
spin_unlock_bh(&p_hwfn->mcp_info->cmd_lock);
477+
if (!qed_mcp_has_pending_cmd(p_hwfn))
479478
break;
480-
}
481479

482480
rc = qed_mcp_update_pending_cmd(p_hwfn, p_ptt);
483-
if (!rc) {
484-
spin_unlock_bh(&p_hwfn->mcp_info->cmd_lock);
481+
if (!rc)
485482
break;
486-
} else if (rc != -EAGAIN) {
483+
else if (rc != -EAGAIN)
487484
goto err;
488-
}
489485

490486
spin_unlock_bh(&p_hwfn->mcp_info->cmd_lock);
491487

@@ -502,8 +498,6 @@ _qed_mcp_cmd_and_union(struct qed_hwfn *p_hwfn,
502498
return -EAGAIN;
503499
}
504500

505-
spin_lock_bh(&p_hwfn->mcp_info->cmd_lock);
506-
507501
/* Send the mailbox command */
508502
qed_mcp_reread_offsets(p_hwfn, p_ptt);
509503
seq_num = ++p_hwfn->mcp_info->drv_mb_seq;
@@ -530,18 +524,14 @@ _qed_mcp_cmd_and_union(struct qed_hwfn *p_hwfn,
530524

531525
spin_lock_bh(&p_hwfn->mcp_info->cmd_lock);
532526

533-
if (p_cmd_elem->b_is_completed) {
534-
spin_unlock_bh(&p_hwfn->mcp_info->cmd_lock);
527+
if (p_cmd_elem->b_is_completed)
535528
break;
536-
}
537529

538530
rc = qed_mcp_update_pending_cmd(p_hwfn, p_ptt);
539-
if (!rc) {
540-
spin_unlock_bh(&p_hwfn->mcp_info->cmd_lock);
531+
if (!rc)
541532
break;
542-
} else if (rc != -EAGAIN) {
533+
else if (rc != -EAGAIN)
543534
goto err;
544-
}
545535

546536
spin_unlock_bh(&p_hwfn->mcp_info->cmd_lock);
547537
} while (++cnt < max_retries);
@@ -564,7 +554,6 @@ _qed_mcp_cmd_and_union(struct qed_hwfn *p_hwfn,
564554
return -EAGAIN;
565555
}
566556

567-
spin_lock_bh(&p_hwfn->mcp_info->cmd_lock);
568557
qed_mcp_cmd_del_elem(p_hwfn, p_cmd_elem);
569558
spin_unlock_bh(&p_hwfn->mcp_info->cmd_lock);
570559

0 commit comments

Comments
 (0)