Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp873194imm; Wed, 18 Jul 2018 12:11:25 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdSBkOzVCIRgE9uiEpWAJQidMKm3LYDnzPgEPpS6ymhOp7omT/Nu29enzizbslk9PH50YtC X-Received: by 2002:a65:57c9:: with SMTP id q9-v6mr7048240pgr.128.1531941085865; Wed, 18 Jul 2018 12:11:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531941085; cv=none; d=google.com; s=arc-20160816; b=UktP4eaJjwEvK9an9YpZfLsb5WdAlKJ75KYTYEIeZMgT6im5iVLfstFXTwE0e5Tq7x J/exWkHfC4aASLH5kqszHnGEiVYYDqc3s+qR0WuJIedMrILHSH1wGH8btGrUE/mFmtf0 JxZ0fv1x/kss+mNbGJdYDfbbKgKs9Bh4lCtZgxNMr9M9CxfODdwBDKr927+6qEDCcWgv sZM9q6q7bhAy1YKFxjeEtTZEwcMFSuEsHN1ji/ChpaZ6eFaS5wCksaPAJG+qzaPlRh3y he9y/zkpwFw8TKSRiCsIERqLOnb6QCYpc5XlVb6UGkVfSEAmuDxEexXkU1JKhUcaCT5L Q8og== 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=6H8k+gnuAv0EXn4c3/jmJ1UIK6ybiJn0UjGqys6RD9A=; b=DFEKpUkY9/055wHHCEEHg+gy2s75LHEg/ymLOIp1bNJsu9EJapxW3pXQUIFFfbnQvm MixtwrhbCB7oFcDdT9jcXAN9+Y3J6zQMKP3ymvaXHTSpFTzuVj+GSSeJ0LfJkYHIMBzF kHXqK+f/R7zWZBXl0Btv8u9E4LpUTWlQHokg/79BLmGbiin1tpT5028w+szmwKVb8PZa q0whERMrxpIFGNzcMP9uq7hkE8G+YI3rYv/BWhOmgLeaA2gv/KhuViwVvOm0Yr1A5aur 5GffP+JBGS/pxoKo46O/bclnTcaQPLsidK4Zt5BBLEjxDP9Als248n347rEXMi2SaM9H vMaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="P/kBfia7"; 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 b6-v6si3620636pls.347.2018.07.18.12.11.10; Wed, 18 Jul 2018 12:11:25 -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="P/kBfia7"; 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 S1730058AbeGRTtp (ORCPT + 99 others); Wed, 18 Jul 2018 15:49:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:52902 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729126AbeGRTtp (ORCPT ); Wed, 18 Jul 2018 15:49:45 -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 3C2642084E; Wed, 18 Jul 2018 19:10:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1531941028; bh=hN/6bz4hAADHcbTzDk4PJlKGV5XTYsxhqXXCkQWfw+g=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=P/kBfia7L27X2tXfQ0jC+csFshLGXYDls0pQRogQiyQ9nfbAWK8G6hmKbhSwTNkml l2SCQvWsC+G2VMKev8od/GzwjnjZ3dtkR0u9/zCad7pDGL8uz0FePd0/fxyoEJbZqw XAR90BBUiNxRmSpHW5RONXxE+24go5OjPSA2LMyc= Date: Wed, 18 Jul 2018 14:10:24 -0500 From: Bjorn Helgaas To: Oza Pawandeep 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 v2 6/6] PCI/PORTDRV: Remove ERR_FATAL handling from pcie_portdrv_slot_reset() Message-ID: <20180718191024.GE128988@bhelgaas-glaptop.roam.corp.google.com> References: <1529661494-20936-1-git-send-email-poza@codeaurora.org> <1529661494-20936-7-git-send-email-poza@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1529661494-20936-7-git-send-email-poza@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 Fri, Jun 22, 2018 at 05:58:14AM -0400, 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, because of, no need to handle > pci_channel_io_frozen case anymore. > > Besides the walk on the bus is happening on subordinates, inside > broadcast_error_message(), which means that pcie_portdrv_slot_reset() > is never called for RP, and now since the all the devices are removed under > this downstream link, we can safely get rid of ERR_FATAL handling code > in pcie_portdrv_slot_reset(). portdrv only binds to bridges, and it looks like broadcast_error_message() only calls the pci_error_handlers callbacks for subordinate devices, never for the bridge itself: broadcast_error_message if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) pci_walk_bus(dev->subordinate, ...) If that's the case, why do we need pcie_portdrv_err_handler at all? We should remove it completely if we don't need it. ISTR some arcane call path for pcie_portdrv_err_resume(), but I don't remember the details. > Signed-off-by: Oza Pawandeep > > diff --git a/drivers/pci/pcie/portdrv_pci.c b/drivers/pci/pcie/portdrv_pci.c > index 973f1b8..b970a6d 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) > { > @@ -163,13 +152,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; > } > > -- > 2.7.4 >