Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp99933imm; Thu, 7 Jun 2018 14:35:34 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLPl24mFIbTuYmDVT5ziuA+XDmzwA+1UvObtkXZmH9QCpyp7flLLzX4i99sAKmFc9cdkFxI X-Received: by 2002:a63:bd51:: with SMTP id d17-v6mr3006676pgp.42.1528407333958; Thu, 07 Jun 2018 14:35:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528407333; cv=none; d=google.com; s=arc-20160816; b=iBPIiO6wFz0U17GFkeA+K3pKCzdP4+9bZF15nCQdCvlOzoQQb70ipRu8RqwJw7GY5C 1qs6Ph5CrwRKKLb2NDRMGxS69oSkJy+/xco1cHNgGyqISGelWqsxV2Wdet7P/3YbUZJP ooeXTR5w5eayJgd/L5fbyOYytbZiDuhZVWCGKS6z7un4DPWwj8696mT9miamfuzHR1uE nWy9DZHOP5VaDykYeckaukEFmT1n3UoV1UsJLywGPD7Uf0MveDFQ3L5ELD3ZRDidJsWg 9fVi+HdedliQwFgmL//fGC7/MTZkUaWwpO8UTWqNe26OWA49woCwLNT8afhQOw3SE1iS 9LQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=CraVeuxvF68isvt137P8Yk3IvWANjNwmGxOV/lZT4bE=; b=GGmBHDc8Q54COYTmEDpB76oNRTzEcvF5htozAwZy1EiHI2FreHKrUuIGWCv8rASdvZ rmBItAurwiS4TrSNVZqK4IJdwzz7ydgjqkjiOeMz2a6FVdt4cKpmVWIAf4FzHxkigNci 5gmn4X9NRnQa1qJb9HgFc9OvaeQCPswkrPGxV/M+mwKymc/MQ9VXgDVbgDi2AZn9NIl2 oZ4wNwtEuAQ4otlGKqtGA8AaPXFVVJQ/S0RP5UjmV6Sqv1NblA8I/8hmuqhAyUfjzNyz UsGAl5tTPo+jW2Qg09kI7S4CRybjMbc7CAuQ5sRqe63LQxALS4/f5co3aqsPI75336sP byow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=R3kWqkog; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z67-v6si8680838pfb.67.2018.06.07.14.35.19; Thu, 07 Jun 2018 14:35:33 -0700 (PDT) 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=pass header.i=@kernel.org header.s=default header.b=R3kWqkog; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752540AbeFGVew (ORCPT + 99 others); Thu, 7 Jun 2018 17:34:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:46078 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751641AbeFGVeu (ORCPT ); Thu, 7 Jun 2018 17:34:50 -0400 Received: from localhost (unknown [69.71.4.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 12C0B2088F; Thu, 7 Jun 2018 21:34:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1528407290; bh=tXZ/fSSuXRG51JQpHHmW/7oPaQtBiRD1t+jtkgPsm4Y=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=R3kWqkogtCbTRtixdzZOwa8d9nMcQDmVMW6AUKvjv9kSsCSU3e7/A+IpjbWw/P/eG bqmMVaprkvrIvSrjY4V/V+a2LEQlScT5J2T8+39k2Lw/FjWNOy02Xm+x2bz1C5Xh0G Ay7lX/hseQaU8uIn0ye2pk1ZW5wcujYxyx99UalE= Date: Thu, 7 Jun 2018 16:34:48 -0500 From: Bjorn Helgaas To: poza@codeaurora.org Cc: Bjorn Helgaas , Philippe Ombredanne , Thomas Gleixner , Greg Kroah-Hartman , Kate Stewart , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Dongdong Liu , Keith Busch , Wei Zhang , Sinan Kaya , Timur Tabi Subject: Re: [PATCH NEXT 6/6] PCI/PORTDRV: Remove ERR_FATAL handling from pcie_portdrv_slot_reset() Message-ID: <20180607213448.GB37077@bhelgaas-glaptop.roam.corp.google.com> References: <1528351234-26914-1-git-send-email-poza@codeaurora.org> <1528351234-26914-6-git-send-email-poza@codeaurora.org> <94661add3e71e3694aa22c2a9cabf503@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <94661add3e71e3694aa22c2a9cabf503@codeaurora.org> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 07, 2018 at 07:18:03PM +0530, poza@codeaurora.org wrote: > On 2018-06-07 11:30, Oza Pawandeep wrote: > > We are handling ERR_FATAL by resetting the Link in software,skipping the > > driver pci_error_handlers callbacks, removing the devices from the PCI > > subsystem, and re-enumerating, as a result of that, no more calling > > pcie_portdrv_slot_reset in ERR_FATAL case. > > > > Signed-off-by: Oza Pawandeep > > > > diff --git a/drivers/pci/pcie/portdrv_pci.c > > b/drivers/pci/pcie/portdrv_pci.c > > index 973f1b8..92f5d330 100644 > > --- a/drivers/pci/pcie/portdrv_pci.c > > +++ b/drivers/pci/pcie/portdrv_pci.c > > @@ -42,17 +42,6 @@ __setup("pcie_ports=", pcie_port_setup); > > > > /* global data */ > > > > -static int pcie_portdrv_restore_config(struct pci_dev *dev) > > -{ > > - int retval; > > - > > - retval = pci_enable_device(dev); > > - if (retval) > > - return retval; > > - pci_set_master(dev); > > - return 0; > > -} > > - > > #ifdef CONFIG_PM > > static int pcie_port_runtime_suspend(struct device *dev) > > { > > @@ -162,14 +151,6 @@ static pci_ers_result_t > > pcie_portdrv_mmio_enabled(struct pci_dev *dev) > > > > static pci_ers_result_t pcie_portdrv_slot_reset(struct pci_dev *dev) > > { > > - /* If fatal, restore cfg space for possible link reset at upstream */ > > - if (dev->error_state == pci_channel_io_frozen) { > > - dev->state_saved = true; > > - pci_restore_state(dev); > > - pcie_portdrv_restore_config(dev); > > - pci_enable_pcie_error_reporting(dev); > > - } > > - > > return PCI_ERS_RESULT_RECOVERED; > > } > > > Hi Bjorn, > > the above patch removes ERR_FATAL handling from pcie_portdrv_slot_reset() > because now we are handling ERR_FATAL differently than before. > > I tried to dig into pcie_portdrv_slot_reset() handling for ERR_FATAL case > where it > restores the config space, enable device, set master and enable error > reporting.... > and as far as I understand this is being done for upstream link (bridges > etc..) > > why was it done at the first point (I checked the commit description, but > could not really get it) > and do we need to handle the same thing in ERR_FATAL now ? You mean 4bf3392e0bf5 ("PCI-Express AER implemetation: pcie_portdrv error handler"), which added pcie_portdrv_slot_reset()? I agree, that commit log has no useful information. I don't know any of the history behind it.