Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3715516pxv; Mon, 26 Jul 2021 10:05:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx5sXvSfdb/FVEloaUHncV3MaPzVAFQhX353AojNNP+i/h14mwgcZdyXYciTkig6oINXzZx X-Received: by 2002:a17:906:4551:: with SMTP id s17mr17275492ejq.26.1627319124503; Mon, 26 Jul 2021 10:05:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627319124; cv=none; d=google.com; s=arc-20160816; b=W83KjOAnf5VVCynYw3Le+ZET/7QkPGbYQ9GiGAecbu7QCdh2UNiWHtOi1+64bycOyi w8THRPAk3fDWkDN08j4JHGeCgGrym8wCBsHY51OmnAUcbAHNcVK3uCrCGLqeUUKLgs6Z QPd15F0W0qU8ZWkiiooYuMitidpXdhkVwysxqQgRRiuHSApMojy4X/SBp8xfm/qNkNFC O6zJuplJerM0CzWvWnGfePd1nZc/vC6nrucYbOsOH1vBYjbmpO+W73UvEAW3A+hh/EPC qqEotAzsDN2U1PSRzcSYYS6oKGYrR71kbFp8kT1xjMYndUtP132IjyfKqI7Uqinwm2nh RaEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=lWx7GziV7ibSxcxvzBKnD7qDxlxM8owu3ohdFqsg/hY=; b=mIuDd34kBWBNlMdNm9dseRyz4/MyemP7RP49AN6k3GsZdNXG3FFGHmKrKQqhnxxHpT /d6SqXlslEC4nWssseJVUl5H4sWOOJmFu18+QYYzQOKFmspQfeCSzFF90i28HkuPbjcK LdSHIp5yUuUCWT5ejfjdiUPHfagcqh/0JcUlSeu/al7HNuigMSnO4zksjKr/6IuwCH79 qd3RL4r7IloyrVw7ki3AxHajC2kTc3VEoHrqqsKoYRHZA2m5hUGDt6PY0DC7mw244zF3 nUqcaTPacuU10KFjftO5z27On4xxq44feGVOCHkUCXLMaNculhdlS+Wa6Loz7j8GnugT R1mA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=EOV0I4BX; 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=pass (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 o5si449541edq.524.2021.07.26.10.05.01; Mon, 26 Jul 2021 10:05:24 -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=@linuxfoundation.org header.s=korg header.b=EOV0I4BX; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237285AbhGZPj6 (ORCPT + 99 others); Mon, 26 Jul 2021 11:39:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:37524 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236311AbhGZPWo (ORCPT ); Mon, 26 Jul 2021 11:22:44 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C2E2560E09; Mon, 26 Jul 2021 16:03:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1627315392; bh=Ml+v5mmUAfUMXtSAUxI4wpiAvp73LQMS1oak9jPsWXY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EOV0I4BXJihIEAdefH9e/XUrrURB0F/mdNPO9DFugLlKpVq4s8qBR7zLxSwls58iW V5V2QArlnBK+v8fIsM0iNuab3kiEpwC4ZX8m3nW5NAAIHekeK3yLVi8xatYes4ymKi uWziyfsq+0NdbHzKY3nuJ+ANWXZG+eMOlkp3LcgU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kalesh AP , Michael Chan , "David S. Miller" , Sasha Levin Subject: [PATCH 5.10 079/167] bnxt_en: dont disable an already disabled PCI device Date: Mon, 26 Jul 2021 17:38:32 +0200 Message-Id: <20210726153842.060021157@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210726153839.371771838@linuxfoundation.org> References: <20210726153839.371771838@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Kalesh AP [ Upstream commit c81cfb6256d90ea5ba4a6fb280ea3b171be4e05c ] If device is already disabled in reset path and PCI io error is detected before the device could be enabled, driver could call pci_disable_device() for already disabled device. Fix this problem by calling pci_disable_device() only if the device is already enabled. Fixes: 6316ea6db93d ("bnxt_en: Enable AER support.") Signed-off-by: Kalesh AP Signed-off-by: Michael Chan Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index db1b89f57079..f003f08de167 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -12901,7 +12901,8 @@ static pci_ers_result_t bnxt_io_error_detected(struct pci_dev *pdev, if (netif_running(netdev)) bnxt_close(netdev); - pci_disable_device(pdev); + if (pci_is_enabled(pdev)) + pci_disable_device(pdev); bnxt_free_ctx_mem(bp); kfree(bp->ctx); bp->ctx = NULL; -- 2.30.2