Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1335330imm; Thu, 23 Aug 2018 01:01:57 -0700 (PDT) X-Google-Smtp-Source: AA+uWPzHz0ABtRtuRGI/3xXzR39fL0ZbzdIX1wQkgkA2Z1tkwgPY5Of0SGa5u846THYSBMfsGFot X-Received: by 2002:a62:ac12:: with SMTP id v18-v6mr61501712pfe.126.1535011317513; Thu, 23 Aug 2018 01:01:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535011317; cv=none; d=google.com; s=arc-20160816; b=Qel5hGznte59VbTk42JwmTgbqSce+3vgPg5+Zls1sgksJQCeb04vOTW/CH2IuMGbmm a3oumYZH4A+UHV6EqyYHG2dNHL3/qey6wvaL4dfUF8u+SFDefq93wll8tEK/RjucUhAz d//56ORS9E5guaWgOc56AI8s2oNhcTguIXb4xJ88zb3LlKvXdmwCrXSDRp9Th/TMTH1V ke8BPu5Ns3lqXanhlLomBNE7cgXiHYPPUbU5KcwSEZ8kAs8bs/j44foRGuH0NXn+kx1A PLfcu4SkXZT1YSdVh8nq65iHgp1JVVcfbzme8njajqaaL0643t4Cjrxn6kWRqxyYh68A 3Amw== 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=UEjqUKDvxUv3OXJCbFqOTYLf2e2ftiUjGrJPFNPDvcE=; b=z7QpmAanN4mS9yeabhs5Ywb/19/iSg8nHJ4iHIge/1T5RaUJuG0WjRm6RPJG9LxDTc TOdeY3jTleSLbYaWNfHLXiHjiER3egFEn8FZbogdjlJVZ6qHJwal/0tPUcEOjIFNOCXT 8bTIUZhdo52EFpTh+jqFNroxVheQEfW09n7e2bZBQv5CGO9P8oMD9q1lAKTzAK6MXXFW Mgr8gIekEN+HZ4PGvpmkNhyY21EX5ClbUoAyFtejRnwD61htAbIo89VivVqMVhOuKwve DQw3QQHjQx4j6idR7yQWCVZ2EnzW03Y7GsKnd7AbpUcXQei2pmarwpqiZdoJhmOJ176L ZVVg== 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 f186-v6si3156575pfa.336.2018.08.23.01.01.42; Thu, 23 Aug 2018 01:01:57 -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 S1728621AbeHWL2T (ORCPT + 99 others); Thu, 23 Aug 2018 07:28:19 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:42110 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726836AbeHWL2S (ORCPT ); Thu, 23 Aug 2018 07:28:18 -0400 Received: from localhost (5355525A.cm-6-6b.dynamic.ziggo.nl [83.85.82.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 222A89D2; Thu, 23 Aug 2018 07:59:54 +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 , "David S. Miller" , Sasha Levin Subject: [PATCH 4.4 37/79] bnx2x: Fix receiving tx-timeout in error or recovery state. Date: Thu, 23 Aug 2018 09:53:13 +0200 Message-Id: <20180823074921.381339038@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180823074918.641878835@linuxfoundation.org> References: <20180823074918.641878835@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.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Sudarsana Reddy Kalluru [ Upstream commit 484c016d9392786ce5c74017c206c706f29f823d ] Driver performs the internal reload when it receives tx-timeout event from the OS. Internal reload might fail in some scenarios e.g., fatal HW issues. In such cases OS still see the link, which would result in undesirable functionalities such as re-generation of tx-timeouts. The patch addresses this issue by indicating the link-down to OS when tx-timeout is detected, and keeping the link in down state till the internal reload is successful. Please consider applying it to 'net' branch. Signed-off-by: Sudarsana Reddy Kalluru Signed-off-by: Ariel Elior Signed-off-by: David S. Miller Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/broadcom/bnx2x/bnx2x.h | 1 + drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 6 ++++++ drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 6 ++++++ 3 files changed, 13 insertions(+) --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h @@ -1634,6 +1634,7 @@ struct bnx2x { struct link_vars link_vars; u32 link_cnt; struct bnx2x_link_report_data last_reported_link; + bool force_link_down; struct mdio_if_info mdio; --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c @@ -1277,6 +1277,11 @@ void __bnx2x_link_report(struct bnx2x *b { struct bnx2x_link_report_data cur_data; + if (bp->force_link_down) { + bp->link_vars.link_up = 0; + return; + } + /* reread mf_cfg */ if (IS_PF(bp) && !CHIP_IS_E1(bp)) bnx2x_read_mf_cfg(bp); @@ -2840,6 +2845,7 @@ int bnx2x_nic_load(struct bnx2x *bp, int bp->pending_max = 0; } + bp->force_link_down = false; if (bp->port.pmf) { rc = bnx2x_initial_phy_init(bp, load_mode); if (rc) --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c @@ -10222,6 +10222,12 @@ static void bnx2x_sp_rtnl_task(struct wo bp->sp_rtnl_state = 0; smp_mb(); + /* Immediately indicate link as down */ + bp->link_vars.link_up = 0; + bp->force_link_down = true; + netif_carrier_off(bp->dev); + BNX2X_ERR("Indicating link is down due to Tx-timeout\n"); + bnx2x_nic_unload(bp, UNLOAD_NORMAL, true); bnx2x_nic_load(bp, LOAD_NORMAL);