Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp4647860pxu; Tue, 13 Oct 2020 03:54:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJypuTxAaT9sBDNnwnXn7rVqO5QtpdMxts6bpoHVkWlAcmYuIlShhbnT8KlepxvTLGbzWT+j X-Received: by 2002:a17:906:3cc:: with SMTP id c12mr31851308eja.216.1602586477700; Tue, 13 Oct 2020 03:54:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602586477; cv=none; d=google.com; s=arc-20160816; b=nL79qI6elugUMnPtRM2+Nalg6V3wmpcb48JDeZcqhPBGWQIcZx0PxOIrOcbqxkqDr4 TPV8I0uyqh6/z1U/gprl+g/qbLrvdI8RXMaA3XxsHkdfL9z86eTj4ktILs7cf30cxB7l q8iujCuP/bpH4KcvRCgK+NAr2+e1QPf/20ETv75pOllT6NcGWyOojXu9i73anZemwbNg AUDmRvgEKBRdLLs3tuiyJyPOhneygyvpjbY1lK69AEfWCBsSfIwlVSFL2IRYRXC7vr8f yUSObCVJprGwiZdGSXQ3dwr/QPxz3A+c3tIF2/PwA8mLXPgOzETgtv2yA1tchEQPhZmW v5Bw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:ironport-sdr:ironport-sdr; bh=MHu4q7oGxlLCzCFW0I0upWtckGJotVVgdodB3pWBbeU=; b=YrgS7zyDMxxdXXGeEzSqIbZ1l4JxYCMstqu0vjC3MiVJk5tXH87IeH0+xiTA5T9esH dGJgEcziEEqSVwsSdmV1HWPS+N64ORzDDD2ylLB1PUXkcpfzBoGJ8eMm0o7y/KiJJD2y A8TsmICmWEcShdT6V0UUsVxcmMe0Gzdrq9TQml4gA7iL4IKM8qFEH09eBo2lMGqon1qO tr+6vrme/l/gD2QCRc/Dt1JobbC6sL9h41AkNi4AEs5IPGRxtiz9x6T1AQGprkD+bHOy j4tkqOVzI8AKZgvCgK0y5cVZSK8ZzshbZKk1lsU1lD7sTXaWMihm0QcfTUxXHMy2yd5u Wfjw== 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 65si14083380edc.222.2020.10.13.03.54.15; Tue, 13 Oct 2020 03:54:37 -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 S1731014AbgJLVrM (ORCPT + 99 others); Mon, 12 Oct 2020 17:47:12 -0400 Received: from mga14.intel.com ([192.55.52.115]:50849 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730022AbgJLVrI (ORCPT ); Mon, 12 Oct 2020 17:47:08 -0400 IronPort-SDR: SBcJ0iUAvZ80zTueggJMoz8SeKJXoa0pABu9b9k/VQDwCEgNEIlAkLJgLmk6AQAMp3tRv/FvSa f+IM66gNAS7g== X-IronPort-AV: E=McAfee;i="6000,8403,9772"; a="165022939" X-IronPort-AV: E=Sophos;i="5.77,368,1596524400"; d="scan'208";a="165022939" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Oct 2020 14:47:06 -0700 IronPort-SDR: IyiTXSkDr02AxtMYOLxxjIFBHGMwRarKUuo+sI0w/4DmzYEfZlXR0uboX7tL+eLoSwjhc3062C rKyO2J6Z7TOA== X-IronPort-AV: E=Sophos;i="5.77,368,1596524400"; d="scan'208";a="345038868" Received: from smaleki-mobl.amr.corp.intel.com (HELO [10.252.132.156]) ([10.252.132.156]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Oct 2020 14:47:05 -0700 Subject: Re: [PATCH v4 1/2] PCI/ERR: Call pci_bus_reset() before calling ->slot_reset() callback To: "Raj, Ashok" , sathyanarayanan.nkuppuswamy@gmail.com Cc: bhelgaas@google.com, okaya@kernel.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org References: <5c5bca0bdb958e456176fe6ede10ba8f838fbafc.1602263264.git.sathyanarayanan.kuppuswamy@linux.intel.com> <20201012210522.GA86612@otc-nc-03> From: "Kuppuswamy, Sathyanarayanan" Message-ID: <9b7db59d-832c-1c21-90b6-1676ea9058ce@linux.intel.com> Date: Mon, 12 Oct 2020 14:47:03 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20201012210522.GA86612@otc-nc-03> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/12/20 2:05 PM, Raj, Ashok wrote: > 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? Good point. I will fix this in next version. > >> status = PCI_ERS_RESULT_RECOVERED; >> pci_dbg(dev, "broadcast slot_reset message\n"); >> pci_walk_bus(bus, report_slot_reset, &status); >> -- >> 2.17.1 >> -- Sathyanarayanan Kuppuswamy Linux Kernel Developer