Received: by 10.223.185.116 with SMTP id b49csp2260373wrg; Thu, 22 Feb 2018 10:40:53 -0800 (PST) X-Google-Smtp-Source: AH8x226ftEhzAqbzyo7GNtZeqwtycJHvX2kaISQ2EGli4QmMPUGbJHRq+y0eN/0syqVwiMT/9V/b X-Received: by 2002:a17:902:5269:: with SMTP id z96-v6mr7455913plh.385.1519324853155; Thu, 22 Feb 2018 10:40:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519324853; cv=none; d=google.com; s=arc-20160816; b=uHgEi0M2JGLKbecHOugl06eS67sI82ktbxlK4HBReIphOQJDZ/C8A/+huLSEGp5f1f l+WaLnm2xeDjJPvQg5DkPumjLWS5CvDY60MnnqNUvOha//a2ciC78HESFeK+cRcteNXR PtNpThYF9VoDLT9UOEDlmij5TKxf1ZJzxb4tD0J4WeDcTKBqF/AFgEPP93FpkYyEHAJF 3zBd2LJbmBu624PvhEu2ktgTz12QZiUTNkO6rrdELG9ZdFCdA5ryRClsKvIzS2J1QyPK 11HHuQB16xmxDveANUIQRNs2W7730Mb1VPKQVbWhzI5WQhGzZ7KbnnxviWBd5skw066t yqFA== 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=KE6hqGOW/JqVQmwPivA52ePK84SGNU0eP8bcPU7aPiI=; b=s6Aih6NZw4zodb3Sh50RZlZhxDxz72Nq3tmLipSSSrJYHJTSBP2gQP5diRFDt5AA8h lkupCkqnoh7DAsZflcxWwtR28SgyC7tXZRPpzxoiZy8rKdch0/4oNPVTat/KBiHa0OT7 l10vlap8sJ24uaLm5el2O1w+v6uMlh/QX5V7vBAZ4Qjdxv7otjDkWp49CHBc2rnW8+et l46XY9V/f0XuSEIQrBUvtPFYhjeolV/SRFRYKZAdB58SOcRgYqtkrSioa5ni9l2s+uZX v0khluYTR0hJr2VV6f+t9O8P3rjYwfLTDu2sSoqgDLId9oDDsmKcB6998vfotj03i5DG a4Dg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=O4Nls3vD; 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 z8-v6si400662plo.762.2018.02.22.10.40.38; Thu, 22 Feb 2018 10:40:53 -0800 (PST) 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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=O4Nls3vD; 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 S1750844AbeBVSj7 (ORCPT + 99 others); Thu, 22 Feb 2018 13:39:59 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:52618 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750752AbeBVSj5 (ORCPT ); Thu, 22 Feb 2018 13:39:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=KE6hqGOW/JqVQmwPivA52ePK84SGNU0eP8bcPU7aPiI=; b=O4Nls3vDZUx3ewJaGnBiuEHTx W6wXXhq0ueGCUtwygen/mg1D+DxKHdD5K0Uppk9IYN40uH4AsCEtriAu02Tzp15J1gqf9iA2XjlK6 BuymO6Ezn4Tr0qO4qcT5URDj5ItaNnYA2ixPSxJQhGoHDDoQD9osm24+scW37N12NK1frcmxpizV8 p2x1pgCyagFySq90uLDL97DwrKeZRakf0zjgwwiExIOP4LihQA8J7a6BgMCVYcWDjbqFloi0IZ5gY T+iVe1A31IuXfWPuNw66xCvToVvoY7RU36tiK+cmAptJrF0FYaEibmP14CHYNjicI7ogVNnu9Bp5e BqZb/jRng==; Received: from hch by bombadil.infradead.org with local (Exim 4.89 #1 (Red Hat Linux)) id 1eovmc-00042I-ME; Thu, 22 Feb 2018 18:39:54 +0000 Date: Thu, 22 Feb 2018 10:39:54 -0800 From: Christoph Hellwig 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 v10 4/7] PCI/DPC: Unify and plumb error handling into DPC Message-ID: <20180222183954.GD6267@infradead.org> References: <1519315332-26852-1-git-send-email-poza@codeaurora.org> <1519315332-26852-5-git-send-email-poza@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1519315332-26852-5-git-send-email-poza@codeaurora.org> User-Agent: Mutt/1.9.2 (2017-12-15) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 22, 2018 at 09:32:09PM +0530, Oza Pawandeep wrote: > Current DPC driver does not do recovery, e.g. calling end-point's driver's > callbacks, which sanitize the sw. > > DPC driver implements link_reset callback, and calls pci_do_recovery. > > Signed-off-by: Oza Pawandeep > > diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h > index a5a79f0..124f42e 100644 > --- a/drivers/pci/pci.h > +++ b/drivers/pci/pci.h > @@ -343,6 +343,8 @@ static inline resource_size_t pci_resource_alignment(struct pci_dev *dev, > void pci_enable_acs(struct pci_dev *dev); > > /* PCI error reporting and recovery */ > +#define DPC_FATAL 4 > + > void pci_do_recovery(struct pci_dev *dev, int severity); > > #ifdef CONFIG_PCIEASPM > diff --git a/drivers/pci/pcie/pcie-dpc.c b/drivers/pci/pcie/pcie-dpc.c > index 38e40c6..208b427 100644 > --- a/drivers/pci/pcie/pcie-dpc.c > +++ b/drivers/pci/pcie/pcie-dpc.c > @@ -13,6 +13,7 @@ > #include > #include "../pci.h" > #include "aer/aerdrv.h" > +#include "portdrv.h" > > struct dpc_dev { > struct pcie_device *dev; > @@ -45,6 +46,60 @@ struct dpc_dev { > "Memory Request Completion Timeout", /* Bit Position 18 */ > }; > > +static int find_dpc_dev_iter(struct device *device, void *data) > +{ > + struct pcie_port_service_driver *service_driver; > + struct device **dev; > + > + dev = (struct device **) data; > + > + if (device->bus == &pcie_port_bus_type && device->driver) { > + service_driver = to_service_driver(device->driver); Please move the initial assignment to the declaration line to clean this up a bit: struct device **dev = (struct device **)data; Same thing happens a couple more times in this patch. > +EXPORT_SYMBOL(pci_find_dpc_service); EXPORT_SYMBOL_GPL for PCI layer internals again - and ditto for probably about everything in this series. > #if IS_ENABLED(CONFIG_PCIEAER) > - /* Use the aer driver of the component firstly */ > - driver = pci_find_aer_service(udev); > + if ((severity == AER_FATAL) || > + (severity == AER_NONFATAL) || > + (severity == AER_CORRECTABLE)) > + driver = pci_find_aer_service(udev); > #endif No need for the inner braces here. > - if (severity == AER_FATAL) > + if ((severity == AER_FATAL) || > + (severity == DPC_FATAL)) > state = pci_channel_io_frozen; > else > state = pci_channel_io_normal; Same here and a few more times below.