From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sudarsana Reddy Kalluru Subject: [PATCH net 2/3] qed: Fix possible race for the link state value. Date: Wed, 18 Jul 2018 22:50:03 -0700 Message-ID: <20180719055004.23556-3-sudarsana.kalluru@cavium.com> References: <20180719055004.23556-1-sudarsana.kalluru@cavium.com> Mime-Version: 1.0 Content-Type: text/plain Cc: , , To: Return-path: Received: from mail-bn3nam01on0080.outbound.protection.outlook.com ([104.47.33.80]:22014 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727386AbeGSGbh (ORCPT ); Thu, 19 Jul 2018 02:31:37 -0400 In-Reply-To: <20180719055004.23556-1-sudarsana.kalluru@cavium.com> Sender: netdev-owner@vger.kernel.org List-ID: 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: cc875c2e ("qed: Add link support") Signed-off-by: Sudarsana Reddy Kalluru Signed-off-by: Ariel Elior Signed-off-by: Michal Kalderon --- drivers/net/ethernet/qlogic/qed/qed_mcp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/qlogic/qed/qed_mcp.c b/drivers/net/ethernet/qlogic/qed/qed_mcp.c index fcd3466..1a12093 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_mcp.c +++ b/drivers/net/ethernet/qlogic/qed/qed_mcp.c @@ -1208,6 +1208,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) -- 1.8.3.1