From mboxrd@z Thu Jan 1 00:00:00 1970 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=-6.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham 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 79177CA90AF for ; Wed, 13 May 2020 09:49:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 578DB20740 for ; Wed, 13 May 2020 09:49:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1589363344; bh=r+JP3xxzpaAOKW2E6JRFN18/pSj2M/sFLWWmAZPHAkE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=wntm6z/aCAFG3mIXUzEG+RydsFa3rtyLtv0/McvpO35ObYmREreoKJK78C+njl+9Q ZfUWv4woFJkis+0BYjiSu5+YlloPFTitYqYweumHx01gXkcAV47KyvUxUf+C1V4iUv CzjdnT8rIFpuKsEn1S2gxLcoLSIwMLwOr4aWCrgY= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733168AbgEMJtD (ORCPT ); Wed, 13 May 2020 05:49:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:47736 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730822AbgEMJtB (ORCPT ); Wed, 13 May 2020 05:49:01 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 27EEE20575; Wed, 13 May 2020 09:49:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1589363340; bh=r+JP3xxzpaAOKW2E6JRFN18/pSj2M/sFLWWmAZPHAkE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Hv8oO4Eop+5/yl4WoxJPUiVcy2VnxwaQljU4fbTAyvmAlBTZfXR3+YoYQPnNLbz0n RsIuHlt5bMGcCAllpOCtwCJJOcZ/5hU1gTpi52mgYYbbrrhV5xBZ/UTl7Xc4cpEbuN IUjlRqRt+CpkAGDOrHY6kLuvKDm6UDO2JhXh1754= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Michael Chan , "David S. Miller" Subject: [PATCH 5.4 33/90] bnxt_en: Improve AER slot reset. Date: Wed, 13 May 2020 11:44:29 +0200 Message-Id: <20200513094412.011192060@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200513094408.810028856@linuxfoundation.org> References: <20200513094408.810028856@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: Michael Chan [ Upstream commit bae361c54fb6ac6eba3b4762f49ce14beb73ef13 ] Improve the slot reset sequence by disabling the device to prevent bad DMAs if slot reset fails. Return the proper result instead of always PCI_ERS_RESULT_RECOVERED to the caller. Fixes: 6316ea6db93d ("bnxt_en: Enable AER support.") Signed-off-by: Michael Chan Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -12066,12 +12066,15 @@ static pci_ers_result_t bnxt_io_slot_res } } - if (result != PCI_ERS_RESULT_RECOVERED && netif_running(netdev)) - dev_close(netdev); + if (result != PCI_ERS_RESULT_RECOVERED) { + if (netif_running(netdev)) + dev_close(netdev); + pci_disable_device(pdev); + } rtnl_unlock(); - return PCI_ERS_RESULT_RECOVERED; + return result; } /**