From patchwork Wed Dec 13 01:55:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Levin, Alexander \(Sasha Levin\)" X-Patchwork-Id: 121719 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp4929873qgn; Tue, 12 Dec 2017 18:58:03 -0800 (PST) X-Google-Smtp-Source: ACJfBot/Fny40cbE2/fXrKO11o8bkujfUdCwq3vmpTKDVDjODZCXdaiBfbD7upOTdNMbM1eWqsYX X-Received: by 10.159.253.144 with SMTP id q16mr4525204pls.104.1513133883900; Tue, 12 Dec 2017 18:58:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513133883; cv=none; d=google.com; s=arc-20160816; b=tC0WF2USfSn58PaLtxqqii8W1yNnQ0mBiX9XU/d1u2GaZmcReULCwXrqbqrMs8NncL Zff3GGoZcP7q/kx+TQwa2o6USIb/qvs+FogYq9pVkKbAdCLL4kgC0JI80UoTZegd9Cya 6i0vZLMY7bc+Dm1Elfp2TMs5GCL2/i79li14EuQMTbU0O9llUS6KnRi4rWxTeJcoWr1l B5zdqzzeZRSC2Nh3rY0RG7KMkRQt7b7MEwQKwEMzIfYQddPQQT1Bjj5PneU+nT/7pkX/ IT8ByVKoSppelQZdyMMtG9Wzdy6KENv8sFIkUhPcXaGGpJJ+Y2gjN06fhr5yS7m/G9tt saSg== 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 :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:to:cc:from:dkim-signature :dkim-signature:dkim-signature:arc-authentication-results; bh=mzZCzPdPevRK3oSPkOGgnn2lKJjavgTg1WfuJUMdq2Q=; b=eqbxZeoU8Wm06haNI2j1nEYLKHH8Y+sdyvt/R1y97RlDWdN4CIsr6JOjfKmWM+8YrX Sma5SZKIh/sGx6TZjJaVomXOpm9iN9B01XetwTmRDMmhFSwj8Zo9FQkn/CtnappIlcN6 Xn9ZrMvyYjTvUADoLCtO+NHyOgaSxBRiuByd6LKHmeUGPZHxTD8KmH8A/Yez7pt0xrDl zO7I4MRRDjzM16VdrMAjhX4pJz+DQ0INH/UihdV/7aJgQi4mj9zFlOsLRXkvHbb1brzC 8dSftuu1m0z8nld8iI0ISx9KfHqVIed+tFJwEoCoEJk+WfEYwXiAZdQIXqM8jwN92LIK pcXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@verizon.com header.s=corp header.b=JicgXF4u; dkim=fail header.i=@verizon.com header.s=corp header.b=dwXxOVNN; dkim=fail header.i=@verizon.com header.s=corp header.b=uDsDtaR4; 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; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=verizon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x8si489829plv.554.2017.12.12.18.58.03; Tue, 12 Dec 2017 18:58:03 -0800 (PST) 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; dkim=fail header.i=@verizon.com header.s=corp header.b=JicgXF4u; dkim=fail header.i=@verizon.com header.s=corp header.b=dwXxOVNN; dkim=fail header.i=@verizon.com header.s=corp header.b=uDsDtaR4; 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; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=verizon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753291AbdLMC56 (ORCPT + 10 others); Tue, 12 Dec 2017 21:57:58 -0500 Received: from omzsmtpe02.verizonbusiness.com ([199.249.25.209]:25672 "EHLO omzsmtpe02.verizonbusiness.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752610AbdLMB4T (ORCPT ); Tue, 12 Dec 2017 20:56:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1513130179; x=1544666179; h=from:cc:to:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=bnaBazaVWZ34FZz6+IPo8dyrirPK/Xkugl+ynQXdH3c=; b=JicgXF4u6yH7zKTaVEsVblkx+AlPqiXbhQ7Yy1FL0OJz9YYrfw17aZP6 mBFAAr/ZMwNPVLnLM4Kq5IKgEWaKSugk/z9VyxHW2AxxBpBgRao7ZMlMA Hjc6M7l0Y564gJ/yhTOk+wiLz3zg17LX8hGcN4nLAKQO9BOfSUPdIbHaB s=; Received: from unknown (HELO fldsmtpi01.verizon.com) ([166.68.71.143]) by omzsmtpe02.verizonbusiness.com with ESMTP; 13 Dec 2017 01:56:17 +0000 Received: from rogue-10-255-192-101.rogue.vzwcorp.com (HELO apollo.verizonwireless.com) ([10.255.192.101]) by fldsmtpi01.verizon.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 13 Dec 2017 01:56:02 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1513130163; x=1544666163; h=from:cc:to:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=bnaBazaVWZ34FZz6+IPo8dyrirPK/Xkugl+ynQXdH3c=; b=dwXxOVNN2sstXEjBMfHzGcsyHtR0k3cmjR2KGmAygp0TnJoKjNo7K/Bd bVqeEPKW7vgAoc7/1HbojUC9FeTidD1nSmd5oW26SD6h3YpX8HQQ9tQW2 C0QzIHWd16my7SKb5PnAYPR2WHP8WhYRDIgS8jLDib3N6JzBA3kKaJh/J M=; Received: from mariner.tdc.vzwcorp.com (HELO eris.verizonwireless.com) ([10.254.88.84]) by apollo.verizonwireless.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 12 Dec 2017 20:56:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1513130162; x=1544666162; h=to:subject:date:message-id:references:in-reply-to: content-transfer-encoding:mime-version:from:cc; bh=bnaBazaVWZ34FZz6+IPo8dyrirPK/Xkugl+ynQXdH3c=; b=uDsDtaR4O6dtg6JMnDiYL4PvMQNbdnbtUuJaocPA5/7eMtE1ns1rCbpK AohCqE8Z9ROcrd/ae7pORPrnxrEpuNEqm878iSnrX9eGz1w/MCYXsnD0+ TT1jsA7X0DUB4lSY5+NHC9hbIL88Hh3UTZzxKHtYW6PAOJmmrI2U2Qbq0 8=; From: alexander.levin@verizon.com Cc: Gabriele Paoloni , Dongdong Liu , Bjorn Helgaas , alexander.levin@verizon.com X-Host: mariner.tdc.vzwcorp.com Received: from ohtwi1exh002.uswin.ad.vzwcorp.com ([10.144.218.44]) by eris.verizonwireless.com with ESMTP/TLS/AES128-SHA256; 13 Dec 2017 01:56:02 +0000 Received: from tbwexch20apd.uswin.ad.vzwcorp.com (153.114.162.44) by OHTWI1EXH002.uswin.ad.vzwcorp.com (10.144.218.44) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 12 Dec 2017 20:56:02 -0500 Received: from OMZP1LUMXCA13.uswin.ad.vzwcorp.com (144.8.22.188) by tbwexch20apd.uswin.ad.vzwcorp.com (153.114.162.44) with Microsoft SMTP Server (TLS) id 15.0.1263.5; Tue, 12 Dec 2017 20:56:01 -0500 Received: from OMZP1LUMXCA17.uswin.ad.vzwcorp.com (144.8.22.195) by OMZP1LUMXCA13.uswin.ad.vzwcorp.com (144.8.22.188) with Microsoft SMTP Server (TLS) id 15.0.1263.5; Tue, 12 Dec 2017 19:56:00 -0600 Received: from OMZP1LUMXCA17.uswin.ad.vzwcorp.com ([144.8.22.195]) by OMZP1LUMXCA17.uswin.ad.vzwcorp.com ([144.8.22.195]) with mapi id 15.00.1263.000; Tue, 12 Dec 2017 19:56:00 -0600 To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" Subject: [PATCH AUTOSEL for 4.14 33/60] PCI/AER: Report non-fatal errors only to the affected endpoint Thread-Topic: [PATCH AUTOSEL for 4.14 33/60] PCI/AER: Report non-fatal errors only to the affected endpoint Thread-Index: AQHTc7Vt+LIKqBVQ4EKl6iFjOab7QQ== Date: Wed, 13 Dec 2017 01:55:19 +0000 Message-ID: <20171213015455.6455-33-alexander.levin@verizon.com> References: <20171213015455.6455-1-alexander.levin@verizon.com> In-Reply-To: <20171213015455.6455-1-alexander.levin@verizon.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.144.60.250] MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Gabriele Paoloni [ 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(-) -- 2.11.0 diff --git a/drivers/pci/pcie/aer/aerdrv_core.c b/drivers/pci/pcie/aer/aerdrv_core.c index 890efcc574cb..744805232155 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;