Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751363AbdH3Iin convert rfc822-to-8bit (ORCPT ); Wed, 30 Aug 2017 04:38:43 -0400 Received: from lhrrgout.huawei.com ([194.213.3.17]:34091 "EHLO lhrrgout.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750835AbdH3Iim (ORCPT ); Wed, 30 Aug 2017 04:38:42 -0400 From: Gabriele Paoloni To: Gabriele Paoloni , "helgaas@kernel.org" CC: Linuxarm , "liudongdong (C)" , "linux-pci@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH v2] PCIe AER: report uncorrectable errors only to the functions that logged the errors Thread-Topic: [PATCH v2] PCIe AER: report uncorrectable errors only to the functions that logged the errors Thread-Index: AQHTGBF3WJMXhRzaQUO9cVH1BvWtXqKcpnEQ Date: Wed, 30 Aug 2017 08:38:31 +0000 Message-ID: References: <1503054141-80272-1-git-send-email-gabriele.paoloni@huawei.com> In-Reply-To: <1503054141-80272-1-git-send-email-gabriele.paoloni@huawei.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.203.181.161] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020206.59A6798F.0131,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=169.254.1.205, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 6727fba6665de806fb119991ba6dc092 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2245 Lines: 62 ping... > -----Original Message----- > From: Gabriele Paoloni > Sent: 18 August 2017 12:02 > To: helgaas@kernel.org > Cc: Gabriele Paoloni; Linuxarm; liudongdong (C); linux- > pci@vger.kernel.org; linux-kernel@vger.kernel.org > Subject: [PATCH v2] PCIe AER: report uncorrectable errors only to the > functions that logged the errors > > Currently if an uncorrectable error is reported by an EP the AER > driver walks over all the devices connected to the upstream port > bus and in turns call the report_error_detected() callback. > If any of the devices connected to the bus does not implement > dev->driver->err_handler->error_detected() do_recovery() will fail > leaving all the bus hierarchy devices unrecovered. > > However for non fatal errors the PCIe link should not be considered > compromised, therefore it makes sense to report the error only to > all the functions that logged an error. > This patch implements this new behaviour for non fatal errors. > > Signed-off-by: Gabriele Paoloni > Signed-off-by: Dongdong Liu > --- > Changes from v1: > - now errors are reported only to the fucntions that logged the > error > instead of all the functions in the same device. > - the patch subject has changed to match the new implementation > --- > drivers/pci/pcie/aer/aerdrv_core.c | 9 ++++++++- > 1 file changed, 8 insertions(+), 1 deletion(-) > > diff --git a/drivers/pci/pcie/aer/aerdrv_core.c > b/drivers/pci/pcie/aer/aerdrv_core.c > index b1303b3..057465ad 100644 > --- a/drivers/pci/pcie/aer/aerdrv_core.c > +++ b/drivers/pci/pcie/aer/aerdrv_core.c > @@ -390,7 +390,14 @@ static pci_ers_result_t > broadcast_error_message(struct pci_dev *dev, > * If the error is reported by an end point, we think this > * error is related to the upstream link of the end point. > */ > - pci_walk_bus(dev->bus, cb, &result_data); > + if (state == pci_channel_io_normal) > + /* > + * the error is non fatal so the bus is ok, just > invoke > + * the callback for the function that logged the > error. > + */ > + cb(dev, &result_data); > + else > + pci_walk_bus(dev->bus, cb, &result_data); > } > > return result_data.result; > -- > 2.7.4 >