Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp4141277pxk; Tue, 8 Sep 2020 11:42:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzKbOdadd7eNX87cWRKOaj2LlJFYm80Ej7fO5+6jXAAefRdiHk3xrPvnR368P9E+qNfoA/g X-Received: by 2002:a17:906:d045:: with SMTP id bo5mr4369652ejb.320.1599590527109; Tue, 08 Sep 2020 11:42:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599590527; cv=none; d=google.com; s=arc-20160816; b=Pstw3GPOZ3YxjCnAVtRLvxU8KEf3HqBQPMTmYHR7xrBB/XT1SqQZjpZF9MIonzp3R9 gLZj8iu2KeerErQwVRzwPVuaXTexHDbAACqfuO2LWE2aIli6HLtvdmGs5AaPU0tb0MAs PeqFZp6oAkB5HianxrvkbpIZ8hzlvHEBwNaHLQnHIi/0smju99WAOwRlDTIsPyNN9yEI HnjW4QPX1XxK61ca2kfHSahVSIdNrze6IxHLdE9lm+lnrggfQMINohtPYLxI+RbP3RsJ pCrnk2JYTucf0EJnsY19C2W0X1PPiDWPgH9TTL3qcmW710hAxtF63zRhaMnKlWppEUta HZkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=n8FSA6KRJ04smf280Xu2r2QnbqIf+/dCP/7ADNTDGz8=; b=eiA5neMfWtFgobc1lHDTHBN34YsIPTOpRZY3sUgkactGXLCP75DZPEf/SVGJOVmISi sdtYn7Y2ODCf3KRemuC4Tid5lEI+wPMuZ4c1MaY47jMAuGhxA/+0ZvmOmJx+wJc98uL7 cImyVf2RI3T90P8cBE0BiEiIJ9w4u3p2bbEsFIzbYYEqtz+T0BvDYvd+9LwwxPJLVaph Sl5NktPqSRbTUin2JBVlVxYDxCcfgcOmq0TF8O3ALtDddeDBmujvdRMDlex0BTRIfMJI 5YZdn8RIAl2kbgC/kyaU6tIo4Ym5wBQRxo4+pSzyUDwK836RDibLSFCk0AY/3DWgigMi VFMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=oZ5vSft4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id mc3si12063572ejb.404.2020.09.08.11.41.44; Tue, 08 Sep 2020 11:42:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=oZ5vSft4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731591AbgIHSjA (ORCPT + 99 others); Tue, 8 Sep 2020 14:39:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:55370 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731325AbgIHQJA (ORCPT ); Tue, 8 Sep 2020 12:09:00 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DDA902404F; Tue, 8 Sep 2020 15:48:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599580101; bh=X+pkzHAY+45DpjnBBnmun/XbamZy5ZEupPKNeiUbPqc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oZ5vSft4YlAR5RskaKNShZKuZ/zQ0Eoisxw+9nTLplzyWcSCF6jOr8hYxYQX20ccj I/DEawDCl8JCLM0zoYu9cctAGPRyKv+G9CjxtGHNlFd989uLuzPQVMyULZI3E/I4lG KERXZVH9M/Dny/GzIb/lYRuoei1PR0huKb7au6LI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Pavan Chebbi , Michael Chan , "David S. Miller" , Sasha Levin Subject: [PATCH 4.19 31/88] bnxt_en: Dont query FW when netif_running() is false. Date: Tue, 8 Sep 2020 17:25:32 +0200 Message-Id: <20200908152222.628631668@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200908152221.082184905@linuxfoundation.org> References: <20200908152221.082184905@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Pavan Chebbi [ Upstream commit c1c2d77408022a398a1a7c51cf20488c922629de ] In rare conditions like two stage OS installation, the ethtool's get_channels function may be called when the device is in D3 state, leading to uncorrectable PCI error. Check netif_running() first before making any query to FW which involves writing to BAR. Fixes: db4723b3cd2d ("bnxt_en: Check max_tx_scheduler_inputs value from firmware.") Signed-off-by: Pavan Chebbi Signed-off-by: Michael Chan Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c index 63730e449e088..14fe4f9f24b88 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c @@ -471,7 +471,7 @@ static void bnxt_get_channels(struct net_device *dev, int max_tx_sch_inputs; /* Get the most up-to-date max_tx_sch_inputs. */ - if (BNXT_NEW_RM(bp)) + if (netif_running(dev) && BNXT_NEW_RM(bp)) bnxt_hwrm_func_resc_qcaps(bp, false); max_tx_sch_inputs = hw_resc->max_tx_sch_inputs; -- 2.25.1