From patchwork Thu Mar 1 15:20:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 130238 Delivered-To: patch@linaro.org Received: by 10.80.172.228 with SMTP id x91csp2932852edc; Thu, 1 Mar 2018 07:23:28 -0800 (PST) X-Google-Smtp-Source: AG47ELvztM6V4vvw3+qQTzntR5LNj/SdYYm66IE8Z4ccElyFpy07PQFBi3sqiAiQGVEipGNLGz/8 X-Received: by 10.98.147.27 with SMTP id b27mr2303569pfe.145.1519917808348; Thu, 01 Mar 2018 07:23:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519917808; cv=none; d=google.com; s=arc-20160816; b=HFctUqpIKTWlHTUKpMBKl+VYuihH4Z6iQ0bNVNwhuJCxjWjNLanI+TZ10N0FneHn4F V6lrp/TfC16MclHXDqgbssMGvQW1e4ZTAlFC98HU4aXpQKFTUmJy9WTAEJ7w3R+PrQRF ZxCu5wXYOUrp4xlFe/XQEFYMjobao1hLpmliaV4bcWH7VLuNwWo7LJBoMp4W7OAIjg+B nTLy+rxMLGBij2yoG7AtlWItudYiKb7s4avvO6UA6uuEl6kEwNcVT1vf4M8iR6WfWxj0 jEGRUgiIUfvqhfuLHl83qMu2yeh8BF9x5X9c8VvSVeY8ILXW4EE6+7VapxGfKI+d9J1H 2lBg== 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=2hhdgjmvLWNGRYv4qgHMW9aMhqkMWgBcKlimKbrTS0c=; b=VF7/aiimHKbSeqH/nC3CcnDrbThUvK0lAFgPmDykl+NIzIc6rkmsQjFO7xjOg0ZPov FfFHZtfAwVPmTg3sWRFz/MmRUkn6EXmyT9D05OZCM9SWSqezngHpt3mmQVS/uQr38GE1 /yRH7Cth2HeoOhz7WK6cPxWtgNx4+Lfc7CZcZm762sEAB7NsTq2Ku0BzzTqKVie8ba3p wcVrmMdVGCUXGRBxyWTuVDkk1selY9ijFvAgt5PW3rUglkRCabPXuB6xaEdnFUZupppI TOINe3zVtQK5nrDbHP7Hv78TrUIUbbgCh4zhBKZ/zdYsk/B+kogdqwLQGSlGwAbT2oau yznQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=SGyp1Mfl; 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 c22si3143541pfl.371.2018.03.01.07.23.28; Thu, 01 Mar 2018 07:23:28 -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=SGyp1Mfl; 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 S1031872AbeCAPX1 (ORCPT + 10 others); Thu, 1 Mar 2018 10:23:27 -0500 Received: from mail-bl2nam02on0116.outbound.protection.outlook.com ([104.47.38.116]:47424 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1031869AbeCAPXW (ORCPT ); Thu, 1 Mar 2018 10:23:22 -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=2hhdgjmvLWNGRYv4qgHMW9aMhqkMWgBcKlimKbrTS0c=; b=SGyp1MfluZ+MR27Jmma5m234e38JULK4PvlDb5Bjxj4mqLwINMjWNq4VB5M2ADETgT52QpEAQjPe4Hy7csT2bqDFAfB712Bqm14d9BIp9KJM7w5FaFgxASfOR9wVa5S8TKXiG9tYwlckL1fWFritQCNum8L1kUUsJWscv0e3aak= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB0901.namprd21.prod.outlook.com (52.132.132.158) 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:23:19 +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:23:19 +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 stable tree] PCI/AER: Report non-fatal errors only to the affected endpoint Thread-Topic: [added to the stable tree] PCI/AER: Report non-fatal errors only to the affected endpoint Thread-Index: AQHTsXDPgTM8c+DO6kaFAEva2gQCcw== Date: Thu, 1 Mar 2018 15:20:20 +0000 Message-ID: <20180301151857.721-52-alexander.levin@microsoft.com> References: <20180301151857.721-1-alexander.levin@microsoft.com> In-Reply-To: <20180301151857.721-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; DM5PR2101MB0901; 7:060JEg9fVpg9PkzMm7Jirfa6LVwYjCmhICaLRfB5oSWPE6jXfJHWBTPyigXawRzJXMe+jqPLxjkT6AD1a+YF5Enc4iI25ub2wkBR9pciqa07sqvSoLs8/vZWLuybrSXZCyZgl301hkikL+U6zuaqw8XD++0+sqQ/SMi32Xum2NybCecTUX9FrSRuuEN4WAR7MRvZ3eVlJubrdw0ju81hezIiXAqch8H96ItfGCpMJ31vy6fwbdxylOJOAPCYJISO x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: ad70b945-bef4-4ba7-7c27-08d57f885d18 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(48565401081)(5600026)(4604075)(3008032)(2017052603307)(7193020); SRVR:DM5PR2101MB0901; x-ms-traffictypediagnostic: DM5PR2101MB0901: 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)(5005006)(8121501046)(3002001)(3231220)(944501226)(52105095)(10201501046)(93006095)(93001095)(6055026)(61426038)(61427038)(6041288)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:DM5PR2101MB0901; BCL:0; PCL:0; RULEID:; SRVR:DM5PR2101MB0901; x-forefront-prvs: 05986C03E0 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(346002)(39380400002)(396003)(366004)(39860400002)(376002)(189003)(199004)(54534003)(478600001)(2906002)(6512007)(5250100002)(2501003)(6306002)(6486002)(6436002)(3660700001)(66066001)(10090500001)(551934003)(105586002)(7736002)(305945005)(6116002)(3846002)(2900100001)(107886003)(14454004)(10290500003)(106356001)(1076002)(3280700002)(97736004)(53936002)(8676002)(81156014)(81166006)(25786009)(36756003)(8936002)(966005)(4326008)(86362001)(186003)(6506007)(59450400001)(72206003)(102836004)(6666003)(76176011)(316002)(110136005)(54906003)(86612001)(99286004)(68736007)(5660300001)(6346003)(26005)(22452003)(2950100002)(22906009); DIR:OUT; SFP:1102; SCL:1; SRVR:DM5PR2101MB0901; H:DM5PR2101MB1032.namprd21.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A: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: Cf+0ZsC3II001SFg3CkLo+VrZ41Wi+68BVKM8+sDRO3Sw1ZhH2P6UAySgg2iiqMdXh5Wgs3TvarOnndFhCuwYy7WQkxma/jTOgEsQYFjFCxuOiJNFn/Bb4d7TwlKyQcsZp9ULrwJyvNvoizwxiTTv7f92an7M9AUdv6O9ekjsDg= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: ad70b945-bef4-4ba7-7c27-08d57f885d18 X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Mar 2018 15:20:20.8379 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0901 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 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;