Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1821737imm; Mon, 3 Sep 2018 10:18:33 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYsQD4qVNXPpRfp4DPq8VCwMh6OKxl0AvtYweZX5VgJBA2a9eq3uJXB8hDgecHQae+8PBBC X-Received: by 2002:a62:6283:: with SMTP id w125-v6mr30502446pfb.108.1535995112932; Mon, 03 Sep 2018 10:18:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535995112; cv=none; d=google.com; s=arc-20160816; b=DUM1W6bu/vQjuduKgJbvpJfp7Y52dQKspcMbC349QuIZ5Np7HnjPznWEhELkPi+Ooh 48CpkEiv3O4GQ205FgYm01ibJMtTCabrd+8+v7otG12/4w2MM8rO27kZm2uptURpm+sm v2SZrkoVPFlQJnZYt6arNYnalOPpUePcRxDg8VDP6UjMhWsBM5T0FGyzL2shBKquNTQL okXuPZScWHHth5+72xV+1F+hWIYvHkiC21ALl1E9EuhpLwi+plgfPCeRHHSIaUlhILcv p6pcl8bhJjZpYCRSdElH/282dmPXpY5YExEIhQrNd2gbObZlLtUfZ9yhbO3tn2yGrBqg tk7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=6FBIPYesfn16fMutmw+jFaauls960MOF1BsJmpdU0jo=; b=Sc9kQlX26FBLv4HIHrefG6xk6XmAHR0fygKXvRK7ePscoqDupxc8sRk0yRWI5vQKX7 fAMsbU/ZmuFpsryCeWehldhRbrfgOCO6WmB2CVdkWMPUyScSoBN+AlntWWfzG/ZLaT6X xysGG01fNyxQ6OhNlhXmtMUG/yDXDu+G+lVlh03O652KkqbAp2nPY0dnyQuMfzo4rXKL DZHXmRvddht0RABJekrUOsYFzSi9GzXI4E164c2CLOcLmLYYIs2Y4nqenL6+ACkSYB5E VydUpbIXBh771bZDHCNJfXzwhrQimMXvqBa2Zup488kwSun20nee2qHXAUSu1NK5VZ99 mjpQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m5-v6si2116941pgq.686.2018.09.03.10.18.18; Mon, 03 Sep 2018 10:18:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728036AbeICVh5 (ORCPT + 99 others); Mon, 3 Sep 2018 17:37:57 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:42660 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728207AbeICVh4 (ORCPT ); Mon, 3 Sep 2018 17:37:56 -0400 Received: from localhost (ip-213-127-74-90.ip.prioritytelecom.net [213.127.74.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id C525FD02; Mon, 3 Sep 2018 17:16:51 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sudarsana Reddy Kalluru , Ariel Elior , Michal Kalderon , "David S. Miller" , Sasha Levin Subject: [PATCH 4.14 035/165] qed: Fix possible race for the link state value. Date: Mon, 3 Sep 2018 18:55:21 +0200 Message-Id: <20180903165656.853713608@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180903165655.003605184@linuxfoundation.org> References: <20180903165655.003605184@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Sudarsana Reddy Kalluru [ Upstream commit 58874c7b246109d8efb2b0099d1aa296d6bfc3fa ] 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 Signed-off-by: David S. Miller Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/qlogic/qed/qed_mcp.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/net/ethernet/qlogic/qed/qed_mcp.c +++ b/drivers/net/ethernet/qlogic/qed/qed_mcp.c @@ -1182,6 +1182,7 @@ static void qed_mcp_handle_link_change(s break; default: p_link->speed = 0; + p_link->link_up = 0; } if (p_link->link_up && p_link->speed)