Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp4020705imm; Mon, 11 Jun 2018 05:51:18 -0700 (PDT) X-Google-Smtp-Source: ADUXVKL/pWdVLMtacvXjuDlLX/k9/igzsUncyhriIEazHO2B62uwBzkiizQaZrToqROOuTh+JleP X-Received: by 2002:a17:902:8486:: with SMTP id c6-v6mr18129150plo.283.1528721478808; Mon, 11 Jun 2018 05:51:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528721478; cv=none; d=google.com; s=arc-20160816; b=wOUxgHRQhpY14jkdpaFxBB2y634z3ahYZotcJB3GIZjjOlebbZhhqTE5LIaT1sjlf1 prmU2XNtN5m+Lo+YgIFW8qS3da98hygGPbByVYFd5ugkSGRvXZ4lU9yS88FNkzvhNqLL +bipDXnXju1pqNlw7RpREZX1jyQQt7S6Y4XVySwgSthf8FVztMOoWPNClTjWtFr4qGy2 y/fmGHLe77ACj76KFhmwVm856kcC/IPUPWi1lxqRp3MMQnwVLnWHO6MTcS6Mi0xSr6PE kdRu3/EOaTZj690UY/9N3tqpocSsfVlwyM0Ab7nk8A09wLt3Y/J/tQCsgGHh8ItrevBw 9ueA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version:dkim-signature:dkim-signature :arc-authentication-results; bh=eO2fN9WBNaSq6AimtyVtfu9qjBN+j8NEAjEYvdAceoU=; b=msiUQnUcXOUwRVQgujHoGrwoC7YzOPD5TLe5OGiEtCMjnbg5261hYVAAEQXKRrFvUY nja+BaTlSG/bATBO4t9LEK0keGqHfKUGLGSoJUDz7yGsknYh2lwl7JrwM9GNwQZ80KV/ 9fHuMTnXKKgOxyI+QiFnQnHcECsNf08TYKhQAmXsxruzc72zT6l1+3ZvQWVEypZtsVQn BN0T31vmeDCF4YYs+B3IJwG6UZSp6jS6IjwlGxrgohYYQbkU3+cv/wHKVDjoP2EIBtTh r2HHSxic3RUNIWtk3sIJAO2WlJ6toCqvz8mT03ezpQI+dHzJfHguHeFoZYkefDMA1+1l WUzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=POBBPTDT; dkim=pass header.i=@codeaurora.org header.s=default header.b=Mi3KHOu5; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k5-v6si20962435pgs.680.2018.06.11.05.51.04; Mon, 11 Jun 2018 05:51:18 -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=@codeaurora.org header.s=default header.b=POBBPTDT; dkim=pass header.i=@codeaurora.org header.s=default header.b=Mi3KHOu5; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932976AbeFKMuc (ORCPT + 99 others); Mon, 11 Jun 2018 08:50:32 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:50014 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932607AbeFKMub (ORCPT ); Mon, 11 Jun 2018 08:50:31 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id A0598601C3; Mon, 11 Jun 2018 12:50:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1528721430; bh=kUQlAqksyRS9MZRDyWvvPVJT9UNo8GREOZoL0LC6d/0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=POBBPTDTjU4/3BqEWkRAfFIPWKJL0okDdvdzEbq63i5v9NoS67r/RINQCWLutIGjg UeNrjpA72UDsVCDWnvaTsByupnAHLT71cCktBx+vsR2B8BhrwkT8xYFOqbBsHeJb9n x1IiGD7V+KDOnhhiMpTs9cf42xT3ppXe7/hCVq6g= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from mail.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.codeaurora.org (Postfix) with ESMTP id 47D89601C3; Mon, 11 Jun 2018 12:50:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1528721429; bh=kUQlAqksyRS9MZRDyWvvPVJT9UNo8GREOZoL0LC6d/0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Mi3KHOu5iYOU1XggVv5layjeH6nnJ/l8xG9qJI0ddjT5TzZgNMrPEXPezSVZtQRKl DFIy42utqmBILjmXZBZ3hYpzC9fkIW1syvnmszqmj/hnjNTNihFBTMuYq55g2QVBfO DIPGHnysyFIAJ4eRNOK2IN7Z9JnUbyvnxL839Zls= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 11 Jun 2018 18:20:29 +0530 From: poza@codeaurora.org To: Bjorn Helgaas 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 , linux-pci-owner@vger.kernel.org Subject: Re: [PATCH NEXT 6/6] PCI/PORTDRV: Remove ERR_FATAL handling from pcie_portdrv_slot_reset() In-Reply-To: <50f38cb058b29f84ca60a19825efd28a@codeaurora.org> References: <1528351234-26914-1-git-send-email-poza@codeaurora.org> <1528351234-26914-6-git-send-email-poza@codeaurora.org> <94661add3e71e3694aa22c2a9cabf503@codeaurora.org> <20180607213448.GB37077@bhelgaas-glaptop.roam.corp.google.com> <50f38cb058b29f84ca60a19825efd28a@codeaurora.org> Message-ID: X-Sender: poza@codeaurora.org User-Agent: Roundcube Webmail/1.2.5 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018-06-11 15:31, poza@codeaurora.org wrote: > On 2018-06-08 03:04, Bjorn Helgaas wrote: >> 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. > > Hi Bjorn and Keith, > > broadcast_error_message() > if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) { > ..... > pci_walk_bus(dev->subordinate, cb, &result_data); > > > so in case of ERR_FATAL, the walk bus is happening on subordinates, > and if I understand the walk right > then, pcie_portdrv_slot_reset() is called only on BRIDGES/Switches > > If is never called on Root-Ports > > having said that, now since we are removing the devices (compare to > previous error callback handling in ERR_FATAL) > I dont see the need of the above code anymore. > when I say above code, I meant this patch itself which removes ERR_FATAL handling out of pcie_portdrv_slot_reset > because there is nothing to restore to any more. as we are initiating > re-enumeration. > > Regards, > Oza.