Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp310586pxk; Thu, 1 Oct 2020 03:04:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxQfDx3Jz6oOrRngVpMF49qrOii0nPsLkFA3DN4LEm0nuxv11cTD1ZZnxMtcAaaNVqq4T07 X-Received: by 2002:a17:906:3ad0:: with SMTP id z16mr7584318ejd.193.1601546677470; Thu, 01 Oct 2020 03:04:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601546677; cv=none; d=google.com; s=arc-20160816; b=kWyr7s3HCWrSkf8QfyRgAeY5Bz4Ou52R8kYiBB1FbhA4dy1okEFTWUsASRUo6mMUSb 5A+i5fQipuBTPSDtTyMUTfJGqzyPMFiB6afWbTZgufXvPwXDlAqXMfpl3alK2tSlVBe+ ht5+5PbVm7oxs8rUHQSWsD2Dz2IXGxsQyGGPpogXzKmCFpEHmeouX/U76UbjL60s6oaW 4OIlWHT7bmvSNEWlew05PRQF429//wwPTW6sC5bDg58RrMb2DSnhVcNRYoHnon2j+4gE 1pL6ccvvB6UCIJAUFX5mmf4piZZvti30EGJTZCX4YkHUBvI0t1oqa+yrpIdWKuzEnyD5 /V8w== 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 :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=+ZZ3fr7dP+IFPnCN2DhWg19iPPsf++dNbWaMjZ8wwGE=; b=tW+6FBYLNa/LUsNzDoXP/VruhueGyOrZcvafVa2bCaPFE8usF1tUY5Xa+JUQIH6ZSJ moN/WU6Z5hI2kw6h9FcY5PAd+gibJg8BEl0idA6qRcXg+F5DaOLGz7aDx7fTiDHVTzpN 1henAXWXB9n9qVZN9uXivXOLvTivcseodO5eirPk8J84ybaARCRIS1E7+EU0d4llNQDR YVl1o8TWzwZGjAceGp6n7enh1SCTWXDOBkliINtDWo+rJEyA702v8IyanIzSOHBuOOol gg0jAwcG5Qlm/Tl3cVShRErQnTvl3Lqr0wJ1N0kBK0lpz/ryvrslNd7KuwbcVJptqQ3v 1Drw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b19si3177191ejq.720.2020.10.01.03.04.12; Thu, 01 Oct 2020 03:04:37 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731134AbgJAKCh (ORCPT + 99 others); Thu, 1 Oct 2020 06:02:37 -0400 Received: from lhrrgout.huawei.com ([185.176.76.210]:2938 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725938AbgJAKCh (ORCPT ); Thu, 1 Oct 2020 06:02:37 -0400 Received: from lhreml710-chm.china.huawei.com (unknown [172.18.7.108]) by Forcepoint Email with ESMTP id A04EBA1DF8756758B9D4; Thu, 1 Oct 2020 11:02:35 +0100 (IST) Received: from localhost (10.52.127.250) by lhreml710-chm.china.huawei.com (10.201.108.61) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1913.5; Thu, 1 Oct 2020 11:02:35 +0100 Date: Thu, 1 Oct 2020 11:00:52 +0100 From: Jonathan Cameron To: Sean V Kelley CC: , , , , , , , , Sean V Kelley Subject: Re: [PATCH v7 06/13] PCI/ERR: Limit AER resets in pcie_do_recovery() Message-ID: <20201001100052.00004f86@Huawei.com> In-Reply-To: <20200930215820.1113353-7-seanvk.dev@oregontracks.org> References: <20200930215820.1113353-1-seanvk.dev@oregontracks.org> <20200930215820.1113353-7-seanvk.dev@oregontracks.org> Organization: Huawei Technologies Research and Development (UK) Ltd. X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; i686-w64-mingw32) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.52.127.250] X-ClientProxiedBy: lhreml754-chm.china.huawei.com (10.201.108.204) To lhreml710-chm.china.huawei.com (10.201.108.61) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 30 Sep 2020 14:58:13 -0700 Sean V Kelley wrote: > From: Sean V Kelley > > In some cases a bridge may not exist as the hardware > controlling may be handled only by firmware and so is > not visible to the OS. This scenario is also possible > in future use cases involving non-native use of RCECs > by firmware. So explicitly apply conditional logic > around these resets by limiting them to root ports and > downstream ports. > > Signed-off-by: Sean V Kelley Acked-by: Jonathan Cameron > --- > drivers/pci/pcie/err.c | 9 ++++++--- > 1 file changed, 6 insertions(+), 3 deletions(-) > > diff --git a/drivers/pci/pcie/err.c b/drivers/pci/pcie/err.c > index c6922c099c76..9e552330155b 100644 > --- a/drivers/pci/pcie/err.c > +++ b/drivers/pci/pcie/err.c > @@ -203,9 +203,12 @@ pci_ers_result_t pcie_do_recovery(struct pci_dev *dev, > pci_dbg(dev, "broadcast resume message\n"); > pci_walk_bus(bus, report_resume, &status); > > - if (pcie_aer_is_native(dev)) > - pcie_clear_device_status(dev); > - pci_aer_clear_nonfatal_status(dev); > + if (type == PCI_EXP_TYPE_ROOT_PORT || > + type == PCI_EXP_TYPE_DOWNSTREAM) { > + if (pcie_aer_is_native(bridge)) > + pcie_clear_device_status(bridge); > + pci_aer_clear_nonfatal_status(bridge); > + } > pci_info(dev, "device recovery successful\n"); > return status; >