From patchwork Thu Mar 1 15:22:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 130244 Delivered-To: patch@linaro.org Received: by 10.80.172.228 with SMTP id x91csp2934558edc; Thu, 1 Mar 2018 07:24:50 -0800 (PST) X-Google-Smtp-Source: AG47ELvWl4gTU3bm1zoQf0JzGLmTIvxaL3VYuClzNvdbVSSx90PYGPLn7lLCP2MGDqr/VbC8ZhRs X-Received: by 10.101.97.139 with SMTP id c11mr1819491pgv.433.1519917890024; Thu, 01 Mar 2018 07:24:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519917890; cv=none; d=google.com; s=arc-20160816; b=yNoHcnR2oqgqkAtfYRGWsplAtAuclq1yx7a/9Oy0zYxMWOEX9cco6or4nns/vqWLxt 7AGnuQqUO5axX5NT70JYiSpzUempfBnclwTrU//5+7Pe9+2vQNhCjVj2LChUwrgxOhPa SkUfBYZ119w2PArcvgSBHRkz68h16v1gX/tjnhOn5YdrqzAZTl7OPc9fh8px9JIhynOG Zb2WDRc45mMeFQMi0CQL1VMnOBTzwBaMQaeM1OSroJ8bQsrQmbkZs7bU/WIR5y0Gww5c x8+3Y1b+xaesx2/xAuK6yq4DFTnKczzuaxvIc+TMUO4+Zukn4HsQjyrBQlq+JXVaHGxL FvVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=O8YqcnlvpdPZ4EwINZ7XiPALFCkisA2W5jIafnQ/0Us=; b=yc0jaFEKgFaNQ78dRBvWswtFUAuphd1TJwghl8+DWC75pTQZ/zI9QUjNU/SQ6X5WEE APJvbjpeDUAvEp6VPgeX3qmpLnV+7TXbVL4eoPvOOC45NhN6RRK9hnsUypuPx6sdXS+E hPtWqp1k9Lv/vDh4f7qgQ6OS+X3SR55ggxIlNm10GniSmewgKNY6efF5y7f671QmZiUs 4OAX+VfuPh+2wiLo3ae7IXOBmOU3axDOzw1lDdePiwSv5cUzT02PaAV9ukDhnFwzvE56 wcApkSIm0k7tTn4gMpEA3jBRoZULDd5neNOJcq+zf1jlsM7iIrwsa45+AgyBSRH/WsFB ug9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=iND4SnEh; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b72si3177910pfk.10.2018.03.01.07.24.49; Thu, 01 Mar 2018 07:24:50 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=iND4SnEh; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031979AbeCAPYp (ORCPT + 10 others); Thu, 1 Mar 2018 10:24:45 -0500 Received: from mail-sn1nam01on0094.outbound.protection.outlook.com ([104.47.32.94]:45235 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1031846AbeCAPY1 (ORCPT ); Thu, 1 Mar 2018 10:24:27 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=O8YqcnlvpdPZ4EwINZ7XiPALFCkisA2W5jIafnQ/0Us=; b=iND4SnEh8u2oBC1uqoiWOXTXSuSYYMw0isTrjiHLli7SlLFLcXqWlVDkjJICOCCSL34hu0zRl3XukOlVnw1tZngvflONwXMMW7wuJcNpgpbwZP+3rgXmd4aAnRS7h9CnxdNhstImAAUkckRJkbQi9GFuG3fU7h4M5Ls9/gL58S0= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB1096.namprd21.prod.outlook.com (52.132.130.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.567.2; Thu, 1 Mar 2018 15:24:21 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8063:c68a:b210:7446]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8063:c68a:b210:7446%2]) with mapi id 15.20.0567.006; Thu, 1 Mar 2018 15:24:21 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "stable-commits@vger.kernel.org" CC: Gabriele Paoloni , Dongdong Liu , Bjorn Helgaas , Sasha Levin Subject: [added to the 4.1 stable tree] PCI/AER: Report non-fatal errors only to the affected endpoint Thread-Topic: [added to the 4.1 stable tree] PCI/AER: Report non-fatal errors only to the affected endpoint Thread-Index: AQHTsXEuqm5kP7nc9EefWCcbNVU3Aw== Date: Thu, 1 Mar 2018 15:22:58 +0000 Message-ID: <20180301152116.1486-52-alexander.levin@microsoft.com> References: <20180301152116.1486-1-alexander.levin@microsoft.com> In-Reply-To: <20180301152116.1486-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DM5PR2101MB1096; 7:upAAarIRu1nNot8fWafTuhqnNkk0Bt2GKLiQs4n8HKbHesL3b4LNuSafdR5oL/yoABU56K40mY6u4/Q/lBeR6jFgWrtL+fCON4BqJoSVsSlvYqfXwWpKuFC3PBM3ZayiavJk2/Nxg+l+oawtbffjhXdpTci8NbQtxqEsJlWQmXjTEAK3J6NqqduxXCu/6cUXhxlN5EjiOISbsCmDZ1/RxFmJ13eOTG99en9/yimHkmMkAEZM3M89pbNyMOR5MAuP x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 9a7c7fe9-0628-41d6-51d9-08d57f88822b x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(48565401081)(5600026)(4604075)(3008032)(2017052603307)(7193020); SRVR:DM5PR2101MB1096; x-ms-traffictypediagnostic: DM5PR2101MB1096: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(50582790962513)(211936372134217)(153496737603132); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(61425038)(6040501)(2401047)(8121501046)(5005006)(3002001)(93006095)(93001095)(3231220)(944501227)(52105095)(10201501046)(6055026)(61426038)(61427038)(6041288)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(6072148)(201708071742011); SRVR:DM5PR2101MB1096; BCL:0; PCL:0; RULEID:; SRVR:DM5PR2101MB1096; x-forefront-prvs: 05986C03E0 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(366004)(346002)(376002)(39860400002)(396003)(39380400002)(54534003)(199004)(189003)(966005)(4326008)(6666003)(110136005)(72206003)(97736004)(3280700002)(25786009)(8676002)(81156014)(81166006)(36756003)(8936002)(53936002)(99286004)(22452003)(6346003)(86612001)(26005)(76176011)(5660300001)(2950100002)(86362001)(186003)(54906003)(68736007)(102836004)(59450400001)(316002)(66066001)(10090500001)(551934003)(6436002)(6486002)(3660700001)(105586002)(478600001)(2906002)(6506007)(6306002)(6512007)(5250100002)(2501003)(2900100001)(106356001)(305945005)(7736002)(3846002)(6116002)(1076002)(14454004)(107886003)(10290500003)(22906009); DIR:OUT; SFP:1102; SCL:1; SRVR:DM5PR2101MB1096; H:DM5PR2101MB1032.namprd21.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-message-info: 4xYDZ9P+ThJVMtOfCpOqlg2omIZqywuwhmO/wJJYxumI8ElEeiTlE3eE4AAD9Pg4dUo1wK/ys2zTQlrTz0d+ebTaGJFGmyO61OAUCQ/sTVYNO/UTS0mvEOydor86cMrgi7ypOvJJ1SysqI8NSstbryfwMSVz/G1WoytQ5ChRMIs= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9a7c7fe9-0628-41d6-51d9-08d57f88822b X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Mar 2018 15:22:58.6429 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB1096 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Gabriele Paoloni This patch has been added to the 4.1 stable tree. If you have any objections, please let us know. -- 2.14.1 =============== [ Upstream commit 86acc790717fb60fb51ea3095084e331d8711c74 ] Previously, if an non-fatal error was reported by an endpoint, we called report_error_detected() for the endpoint, every sibling on the bus, and their descendents. If any of them did not implement the .error_detected() method, do_recovery() failed, leaving all these devices unrecovered. For example, the system described in the bugzilla below has two devices: 0000:74:02.0 [19e5:a230] SAS controller, driver has .error_detected() 0000:74:03.0 [19e5:a235] SATA controller, driver lacks .error_detected() When a device such as 74:02.0 reported a non-fatal error, do_recovery() failed because 74:03.0 lacked an .error_detected() method. But per PCIe r3.1, sec 6.2.2.2.2, such an error does not compromise the Link and does not affect 74:03.0: Non-fatal errors are uncorrectable errors which cause a particular transaction to be unreliable but the Link is otherwise fully functional. Isolating Non-fatal from Fatal errors provides Requester/Receiver logic in a device or system management software the opportunity to recover from the error without resetting the components on the Link and disturbing other transactions in progress. Devices not associated with the transaction in error are not impacted by the error. Report non-fatal errors only to the endpoint that reported them. We really want to check for AER_NONFATAL here, but the current code structure doesn't allow that. Looking for pci_channel_io_normal is the best we can do now. Link: https://bugzilla.kernel.org/show_bug.cgi?id=197055 Fixes: 6c2b374d7485 ("PCI-Express AER implemetation: AER core and aerdriver") Signed-off-by: Gabriele Paoloni Signed-off-by: Dongdong Liu [bhelgaas: changelog] Signed-off-by: Bjorn Helgaas Signed-off-by: Sasha Levin --- 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 b60a325234c5..cca4b4789ac4 100644 --- a/drivers/pci/pcie/aer/aerdrv_core.c +++ b/drivers/pci/pcie/aer/aerdrv_core.c @@ -360,7 +360,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;