Skip to content

Commit

Permalink
qed: Fix possible race for the link state value.
Browse files Browse the repository at this point in the history
There's a possible race where driver can read link status in mid-transition
and see that virtual-link is up yet speed is 0. Since in this
mid-transition we're guaranteed to see a mailbox from MFW soon, we can
afford to treat this as link down.

Fixes: cc875c2 ("qed: Add link support")
Signed-off-by: Sudarsana Reddy Kalluru <[email protected]>
Signed-off-by: Ariel Elior <[email protected]>
Signed-off-by: Michal Kalderon <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Sudarsana Reddy Kalluru authored and davem330 committed Jul 21, 2018
1 parent 4ad95a9 commit 58874c7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/net/ethernet/qlogic/qed/qed_mcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1211,6 +1211,7 @@ static void qed_mcp_handle_link_change(struct qed_hwfn *p_hwfn,
break;
default:
p_link->speed = 0;
p_link->link_up = 0;
}

if (p_link->link_up && p_link->speed)
Expand Down

0 comments on commit 58874c7

Please sign in to comment.