From patchwork Fri Aug 18 11:02:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gabriele Paoloni X-Patchwork-Id: 110370 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp754239qge; Fri, 18 Aug 2017 04:02:26 -0700 (PDT) X-Received: by 10.99.48.7 with SMTP id w7mr8440058pgw.244.1503054146766; Fri, 18 Aug 2017 04:02:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503054146; cv=none; d=google.com; s=arc-20160816; b=kzOj2g5sGyRzhf/km8ArTBKrk5u9c/Q7AUBscyWED/IVzEBWoIOIDFI9Ws6SZa5nf6 kck1QcwmDr3loEmpmsiTHn5xADu8c5hpboPkKdQxOl+4Wso4mDkiVKKZ0/TRS6wBy9Rg L8sBLoGpZNI0snr0L5Ifh7aj5+WnCxoZk3oiA9qsFSPafxMXnR+/lJVyamZEeAcJ2z7K 0igy6952wHZTs9s2M0+zJKrXof2gijxrFU5BGpZ6ntL9kRk4ttfFxlB5tOC23lWf5XZJ 5BEX7E7wnXkRNS5J3INilyWWV92Z5Az8iKt7tUNtKzNRr54nrAQlq5XUmv55D6gTnJ9I dwow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:arc-authentication-results; bh=x32xCw7k9O0CEALM4tt6ThtZYVuhs839r5nd8+5oTY8=; b=RzqC/+Ai1uCcmtT3zKwYusVOLm9GAhWfJMx+sso6smacPiTv8wtyPVN/maCHeyZkC7 EVclrIOpFYYwQ9ub4nWekjTtAcKCbMdr4r4I/zBJRwDknY10iL+rEqA3GjicGk6VCxo+ +8ndRR8VrT1TlRmyUzouAzlzCpDW7kLy3UHp5VHsYg1c4nLftdusGPDLa94pFrUP0aSE yYggchYq7p55AotxaoH7iJHp5uvyRKYDAp0Xy+I6kpXGsGXA+x90xKKBHkUrypQ0OfXV SP4hJWFz9zWYcUTfjsR+LadyO7Aj+VhWXO6oclNdGNI7bGcrb/2o1G610fI1itnBMlMm YyyA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a97si1920076pli.875.2017.08.18.04.02.26; Fri, 18 Aug 2017 04:02:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750969AbdHRLCX (ORCPT + 26 others); Fri, 18 Aug 2017 07:02:23 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:4069 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750807AbdHRLCW (ORCPT ); Fri, 18 Aug 2017 07:02:22 -0400 Received: from 172.30.72.60 (EHLO DGGEMS405-HUB.china.huawei.com) ([172.30.72.60]) by dggrg05-dlp.huawei.com (MOS 4.4.6-GA FastPath queued) with ESMTP id DFM54164; Fri, 18 Aug 2017 19:02:20 +0800 (CST) Received: from G00308965-DELL1.china.huawei.com (10.220.132.168) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.301.0; Fri, 18 Aug 2017 19:02:13 +0800 From: Gabriele Paoloni To: CC: , , , , Subject: [PATCH v2] PCIe AER: report uncorrectable errors only to the functions that logged the errors Date: Fri, 18 Aug 2017 12:02:21 +0100 Message-ID: <1503054141-80272-1-git-send-email-gabriele.paoloni@huawei.com> X-Mailer: git-send-email 2.7.1.windows.1 MIME-Version: 1.0 X-Originating-IP: [10.220.132.168] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020206.5996C93C.0166, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 0284263e1a7c069d10395a71c7b25731 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 2.7.4 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;