Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp4639390pxu; Tue, 13 Oct 2020 03:38:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz0rn5UWzFs1tgo48wzPPWvU9oiu1qugYSZEmQtn9BGoIyydH8pkFowmQM0cDmJnhP5aBJv X-Received: by 2002:a05:6402:2076:: with SMTP id bd22mr19817376edb.197.1602585511214; Tue, 13 Oct 2020 03:38:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602585511; cv=none; d=google.com; s=arc-20160816; b=g6IGITf7YgKn89d9PK+XtC7CPnfVECpLvsRoEwmiUAEHcQdSpFR+iPax1T7B09f4K5 tj/c5RYMamRgqwoH2yXTirfvNHINOELosUqmb5cTr/kmo3rwPyCGpxoPflO+35Hcs8W5 Xvg+6pOXN3kI7lZHYT7YUE/AQyMna1bsQckbTsXxSJXpHEnK76ZacF7KvEIL7Q7DwQHc il6p3vL7C/aiX6Q2ZereKBWUNpSS/VceVDzwusiQLUmCqt0ysYGW02tfQkzwt+b/0wXg BLYna7iiQKIo7uVbqJDOCZKLrLf1vmdefls6m1rmGS1DuqHIjGGEXOjAf9f4gBtFrfGQ 5nvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :ironport-sdr:ironport-sdr; bh=H2UQ6aFHY3Olnwvevzk24+4uO/U7MzhmHy/oatUp7fM=; b=S7mhtG81hNQuoyBkUehqjYJQVw1RBd8eRHhzGIPclrvlvfPKLdSj0DH4NYuVeXkZMJ WDb4uQuG2ZklAjYG3V7hOcp8/JNXT8PP8aZ/txk55WKOiGw2WXAoAP5JwqhsmqlX077i eNFAiikKocgZCEo/NMqtJwj2JWS0vCKgfaiusDV5YUFWtdvz+oYexwIFQKkWqgfraAeZ /ZiCdYCLsfmqODDilfeczUVKXV3yMbhVLCRummGR4KSlXdj8EzyHBejkcMmAPYoNxu5I bZt9R91XOXLY/jvYRGC2UXLRsQGGZktDMhNSqJSSDaKO3FwFf4s75v4wenP+cLAadAQg QITQ== 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 cy11si14963978edb.227.2020.10.13.03.38.09; Tue, 13 Oct 2020 03:38:31 -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 S1732086AbgJLVFY (ORCPT + 99 others); Mon, 12 Oct 2020 17:05:24 -0400 Received: from mga09.intel.com ([134.134.136.24]:36633 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729366AbgJLVFY (ORCPT ); Mon, 12 Oct 2020 17:05:24 -0400 IronPort-SDR: EgjpjWzFDE1nt5bSfVRt3jeibG0fMCjUCPP9GTXZmMJwWhKNeeob/0wwMuA/oq2kWv/KpC2fku cOD0sVHwzqbQ== X-IronPort-AV: E=McAfee;i="6000,8403,9772"; a="165916815" X-IronPort-AV: E=Sophos;i="5.77,368,1596524400"; d="scan'208";a="165916815" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Oct 2020 14:05:23 -0700 IronPort-SDR: tl18dfCNh77rDtbSe15IjWECAv5xjENNuRSZYXqTINQRazyM5o6iN3KRpOuz6ze7e16cupjpBI wmsDyZLv0OQw== X-IronPort-AV: E=Sophos;i="5.77,368,1596524400"; d="scan'208";a="530119031" Received: from otc-nc-03.jf.intel.com (HELO otc-nc-03) ([10.54.39.36]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Oct 2020 14:05:23 -0700 Date: Mon, 12 Oct 2020 14:05:22 -0700 From: "Raj, Ashok" To: sathyanarayanan.nkuppuswamy@gmail.com Cc: bhelgaas@google.com, okaya@kernel.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, sathyanarayanan.kuppuswamy@linux.intel.com, Ashok Raj Subject: Re: [PATCH v4 1/2] PCI/ERR: Call pci_bus_reset() before calling ->slot_reset() callback Message-ID: <20201012210522.GA86612@otc-nc-03> References: <5c5bca0bdb958e456176fe6ede10ba8f838fbafc.1602263264.git.sathyanarayanan.kuppuswamy@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5c5bca0bdb958e456176fe6ede10ba8f838fbafc.1602263264.git.sathyanarayanan.kuppuswamy@linux.intel.com> User-Agent: Mutt/1.5.24 (2015-08-30) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Oct 11, 2020 at 10:03:40PM -0700, sathyanarayanan.nkuppuswamy@gmail.com wrote: > From: Kuppuswamy Sathyanarayanan > > Currently if report_error_detected() or report_mmio_enabled() > functions requests PCI_ERS_RESULT_NEED_RESET, current > pcie_do_recovery() implementation does not do the requested > explicit device reset, but instead just calls the > report_slot_reset() on all affected devices. Notifying about the > reset via report_slot_reset() without doing the actual device > reset is incorrect. So call pci_bus_reset() before triggering > ->slot_reset() callback. > > Signed-off-by: Kuppuswamy Sathyanarayanan > --- > drivers/pci/pcie/err.c | 6 +----- > 1 file changed, 1 insertion(+), 5 deletions(-) > > diff --git a/drivers/pci/pcie/err.c b/drivers/pci/pcie/err.c > index c543f419d8f9..067c58728b88 100644 > --- a/drivers/pci/pcie/err.c > +++ b/drivers/pci/pcie/err.c > @@ -181,11 +181,7 @@ pci_ers_result_t pcie_do_recovery(struct pci_dev *dev, > } > > if (status == PCI_ERS_RESULT_NEED_RESET) { > - /* > - * TODO: Should call platform-specific > - * functions to reset slot before calling > - * drivers' slot_reset callbacks? > - */ > + pci_reset_bus(dev); pci_reset_bus() returns an error, do you need to consult that before unconditionally setting PCI_ERS_RESULT_RECOVERED? > status = PCI_ERS_RESULT_RECOVERED; > pci_dbg(dev, "broadcast slot_reset message\n"); > pci_walk_bus(bus, report_slot_reset, &status); > -- > 2.17.1 >