Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2030699ybt; Sun, 28 Jun 2020 06:00:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwAQtp5V2/YOmQWlSWhw49aCMwpp/RscKE7At/Q/qoM/0N5a/1Q+QHD145updgb+19kf73l X-Received: by 2002:a17:906:fa9a:: with SMTP id lt26mr886310ejb.502.1593349235542; Sun, 28 Jun 2020 06:00:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593349235; cv=none; d=google.com; s=arc-20160816; b=lKothWJjaX1Y2Dh7iEkha1yJCMwxDO5MTRUW8WQbF8BdicLhIYNqmBBexyHf5/shCM i2tnhtnLeh/VsnU9ks5Q044wEIa0GGF/VrTDBkz7Y2/tHnLLVw5vHvKk7t/Y34fjM3Xw 1euPpakcgk3vSWwatcnPezTcGiXZBbfMnMvWPryCRRocTgo9DPSn06HtqSi8lsdWMVkA WnUGyKSXIaitrPwqRv0RYdUf6i1Z5d0SjnuZR89w9Uf91zgh/CpPt7v7lOL2iqcf1D7U uy5lK0ZAASXHLj2xaGDiJV6UjfJFliQEvEUzFkUpgWl7pXkN40HqVFtPd0GuxYI14sae GA6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject; bh=NNXzKdL8/SgioBJXDD07eYZPirr8GUf2pMXwWp0O5QE=; b=iErooEMrmPOwPTDn5r2hIwTxw3NGQyn0/Sy8nyKM6D5E0kNQWc6DDJ41v8XES0+LGP ZDCtQdc8WRPXsf2I1RMtegfhCWsPwf4h5kwLSXyXPbckgokLjJKI9Wx+5V+dQ9FzEhq9 ujG9fAIF26u3Yu38S2C1syW50gNYP0h2i+dxL2bEVAu01O0ZSPEwpTFfN/iZvze47hYz uYcoZM4lBm0gYfcWmGsNKFZvrMBG4OEr+H7U1f6l8QJ5ewBJumv77gOTbm9o+ezxoiNl rgC6GVD0ClOpoijilDQlNOcoNwfXAyqz8US8PPUYDfnGSNCMjxG9CYmx33TjZBusgagL X2tA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bf13si20118114edb.64.2020.06.28.06.00.13; Sun, 28 Jun 2020 06:00:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726397AbgF1M5J (ORCPT + 99 others); Sun, 28 Jun 2020 08:57:09 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:6325 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726316AbgF1M5J (ORCPT ); Sun, 28 Jun 2020 08:57:09 -0400 Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 93E6FCA98DCAF57D9E6B; Sun, 28 Jun 2020 20:57:06 +0800 (CST) Received: from [10.65.58.147] (10.65.58.147) by DGGEMS413-HUB.china.huawei.com (10.3.19.213) with Microsoft SMTP Server id 14.3.487.0; Sun, 28 Jun 2020 20:57:04 +0800 Subject: Re: [PATCH v2 2/2] PCI/ERR: Add reset support for non fatal errors To: , References: <18ab6cc7b34dab7630978195248ea031540ba9f1.1591307288.git.sathyanarayanan.kuppuswamy@linux.intel.com> CC: , , From: Yicong Yang Message-ID: <75280d1a-da68-10b8-de20-615e9243390e@hisilicon.com> Date: Sun, 28 Jun 2020 20:57:14 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: <18ab6cc7b34dab7630978195248ea031540ba9f1.1591307288.git.sathyanarayanan.kuppuswamy@linux.intel.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.65.58.147] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Sathy, one minor comments below. On 2020/6/5 5:50, sathyanarayanan.kuppuswamy@linux.intel.com wrote: > From: Kuppuswamy Sathyanarayanan > > PCI_ERS_RESULT_NEED_RESET error status implies the device is > requesting a slot reset and a notification about slot reset > completion via ->slot_reset() callback. > > But in non-fatal errors case, if report_error_detected() or > report_mmio_enabled() functions requests PCI_ERS_RESULT_NEED_RESET > then current pcie_do_recovery() implementation does not do the > requested explicit slot reset, instead just calls the ->slot_reset() > callback on all affected devices. Notifying about the slot reset > completion without resetting it incorrect. So add this support. > > Signed-off-by: Kuppuswamy Sathyanarayanan > --- > drivers/pci/pcie/err.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/pci/pcie/err.c b/drivers/pci/pcie/err.c > index 5fe8561c7185..94d1c2ff7b40 100644 > --- a/drivers/pci/pcie/err.c > +++ b/drivers/pci/pcie/err.c > @@ -206,6 +206,9 @@ pci_ers_result_t pcie_do_recovery(struct pci_dev *dev, > * functions to reset slot before calling > * drivers' slot_reset callbacks? > */ > + if (state != pci_channel_io_frozen) > + pci_reset_bus(dev); > + If it's the implementation to reset the slot, should we remove the TODO comments? JYI. Thanks, Yicong > status = PCI_ERS_RESULT_RECOVERED; > pci_dbg(dev, "broadcast slot_reset message\n"); > pci_walk_bus(bus, report_slot_reset, &status);