From patchwork Tue Sep 8 15:23:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 309931 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0E112C433E2 for ; Tue, 8 Sep 2020 19:16:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BE34C2087D for ; Tue, 8 Sep 2020 19:16:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599592582; bh=eWXvw12jKk2fVfZJ6GFWhus/h0ADtQcj6KHW9wEg1eo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=kB5SPVsOz+MD+LpwEaeuHo/znSrG7Frwdi01ex13o8k9bHbuiNnYJlHi4F3BnzDYY DFI0r2BiHbt4FZxs4kIflQJ+a2JXMbyEoRLt/hxJeme0udEfPKxNmyx0kRh4N51BVb //rikVSOhEvZcgjnse+IoPhJ7pMchsaUJdrNlFOE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731590AbgIHTPy (ORCPT ); Tue, 8 Sep 2020 15:15:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:52180 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731176AbgIHQEk (ORCPT ); Tue, 8 Sep 2020 12:04:40 -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 AB20C23CD3; Tue, 8 Sep 2020 15:36:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599579413; bh=eWXvw12jKk2fVfZJ6GFWhus/h0ADtQcj6KHW9wEg1eo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MW3WLTghdqifSltS/70TCBQqVsUQdfCRPef8GO3+ix6ScXetJLMx8BtOiDAg19Iaa TdS4FFsVSvq8D2KEg0CMx91gLYnk/96UKmWlju1MoIR8/8lRhDFsUtyMIAC5gcqwqG 5KEdTFU2qo9avZEuX2tlvgYCl4ySoPpb8rzSGTQU= 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 5.8 067/186] bnxt_en: Dont query FW when netif_running() is false. Date: Tue, 8 Sep 2020 17:23:29 +0200 Message-Id: <20200908152244.906154725@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200908152241.646390211@linuxfoundation.org> References: <20200908152241.646390211@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@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 b4aa56dc4f9fb..dcb3f61af7ab0 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c @@ -847,7 +847,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;