Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp1631245ybg; Thu, 4 Jun 2020 15:02:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzoghv/3U1AGIMZFnJ6tzryt9TgcNp+o06iiMsTMOxrPriJ0J4ZA/FgqCuwy/LTCwwwUc4u X-Received: by 2002:a17:906:4d04:: with SMTP id r4mr5587728eju.317.1591308168983; Thu, 04 Jun 2020 15:02:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591308168; cv=none; d=google.com; s=arc-20160816; b=iDiBJq25BQ6UjDqDHhczUsVWL/eDBekh68V5FA6tWJ9933tiDZOAZ6IiqZrPKdfPjc kn/IEIeejtk71NOJQzWATKufrqN6bZH2WClIxBey2PKns06boYCnfY/t5+OtBg4npEml cnyRjFLJIl9VMUxk45m4NItDXTWdHVtW+t2hVXwYJd747ulIh+LMmz7E4WJyHkNdPu1E +lu343YoiVqiWbU+l188tIoR4Zx/KRHLoA6TzJznCPkVhMJVpokL3CXtp4n7eYz+hxnf 8TVCvUgVK5hqI9uVCBwTRlBUK4unTR5oUgl/ONe8FvRNvvl3ZkewTjRxzPT5ICOFqxZ1 i+nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:ironport-sdr:ironport-sdr; bh=A7NiiQo0vTU5EEHOMchaNoc+/ZE8QWfDe24FG7UUPUg=; b=SvmbjVbSCfmmuvYgGlr78Y6sSQzkCuUSMemTBo4hSnHJVecQXUb7RMzwHxvs+o+sgB H+o5Um7ckzb9Ol7oSkfkpFia4ksCIjhDOmqjxrwIW/IVFxbzJGRPGx6P4snmiEQQcefp eddn2eXLGDt8kzpwCKTROsKa7EqT09FGOIBJW/97uHRolqE/4EAQAl0UhZ0fuF7KUrnG rlQrkoELcDtcXVaXEwm+HIxfBLnTeNGt1CEdjxGVDDDb5FeloJ2hexXGMPaAl9Os5GSQ x5UAhwXxZSSQzLycRVEAaSvr1shBB/DXsihSryIw+KKQPlNr+7R0MbX3f9+976evu5BD NClQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id rh3si2333155ejb.539.2020.06.04.15.02.24; Thu, 04 Jun 2020 15:02:48 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728316AbgFDVuS (ORCPT + 99 others); Thu, 4 Jun 2020 17:50:18 -0400 Received: from mga06.intel.com ([134.134.136.31]:51375 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725943AbgFDVuQ (ORCPT ); Thu, 4 Jun 2020 17:50:16 -0400 IronPort-SDR: /j1t3sHS4vz4aksmJx4kPCcGx76S2x1C5xFSAD6P4tV9EsDAWHxS5qm1OYe/rVa2VXHQN+uOf9 Fv+mNVn+p6kQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jun 2020 14:50:15 -0700 IronPort-SDR: Ugz5LZYBjpvfRGCIR4ijK/ILuN55zOSwrie98TaKaVI++HwJ9SGaajqx1cTr+2HNMNdArRSJaD VnVUMUQVrFRA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,472,1583222400"; d="scan'208";a="313018643" Received: from unknown (HELO localhost.localdomain) ([10.254.105.50]) by FMSMGA003.fm.intel.com with ESMTP; 04 Jun 2020 14:50:15 -0700 From: sathyanarayanan.kuppuswamy@linux.intel.com To: bhelgaas@google.com Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, ashok.raj@intel.com, sathyanarayanan.kuppuswamy@linux.intel.com Subject: [PATCH v2 2/2] PCI/ERR: Add reset support for non fatal errors Date: Thu, 4 Jun 2020 14:50:02 -0700 Message-Id: <18ab6cc7b34dab7630978195248ea031540ba9f1.1591307288.git.sathyanarayanan.kuppuswamy@linux.intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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); + status = PCI_ERS_RESULT_RECOVERED; pci_dbg(dev, "broadcast slot_reset message\n"); pci_walk_bus(bus, report_slot_reset, &status); -- 2.17.1