Received: by 10.223.185.116 with SMTP id b49csp269946wrg; Thu, 22 Feb 2018 21:30:10 -0800 (PST) X-Google-Smtp-Source: AH8x226jD9TEVCNIZNQUkPpq6nUcvhmKWTTAUAc/433cWilg3eSNQg16sVh+smWwg794x+UkMcQQ X-Received: by 10.101.77.195 with SMTP id q3mr229002pgt.283.1519363810108; Thu, 22 Feb 2018 21:30:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519363810; cv=none; d=google.com; s=arc-20160816; b=cSvx/24EWtsCJJRL4d5AhaaBul2FHlkVYEHgQLYQnoRZQeDXDnLdsF6Y5PonB0alar XbmyGvKrINPhzgiMX0rCWEOfdgTDZYXJO+zOqw3MJPMV+AsDzYJK5KCvzyO/BBOW6I2v usNi95JDDGAVkSbyySyJ1rG5V3eJpanllZaXhiSosYvDrKssPA4QB0XlTnOXxHdz9byP P/cNHKmpb39M0MYkE9Scp++On/JeQ0ZqNSj4qu677YkQL3Md0I3n9La9gl+8eujBVxwg YeUxrvA8ltzVMNUimEduraTgbtbT8S47zHy3+zs48tyMBdrVB9R1RsKMwY9h0O/Z+r2c pbNA== 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=oDfGhiuod3fkGEXpvxbQPFyJHZy9f9mvi3RbxktaXKo=; b=OtiVL1mIuhp4b18Uegp0JcbSBKjzX7Vycg76VU7NjKHqk+A6erLvIJj7G2j05QGG3S nKMFKqLVQWvTOJC4jOMBFnvCBqXfgbUbLRtZ1w8MEmf4OwSMLJJlerkA17dMUtTYe05l 3SWuI3Dt5r23qXSuRR/vKhd8znUpdpri4I6QTaCHMAbBvF423MLX410eDR5isDowN3+1 mxiLu/5KRDLadkE1UHFn5w07r/dsN4EGir4GiEhlagAhGvCQklK1ghHLt6Bsp9siebio YWsAXtwKPo2b+xB5yq3rqgpW78r/i8TPsD+d66S7jkw8UUyy83nYDxmAYCKu4dR7uh1W cKUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=H64eYVpJ; dkim=pass header.i=@codeaurora.org header.s=default header.b=PZ/pArLD; 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 u132si1038195pgc.802.2018.02.22.21.29.55; Thu, 22 Feb 2018 21:30:10 -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=pass header.i=@codeaurora.org header.s=default header.b=H64eYVpJ; dkim=pass header.i=@codeaurora.org header.s=default header.b=PZ/pArLD; 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 S1751480AbeBWF25 (ORCPT + 99 others); Fri, 23 Feb 2018 00:28:57 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:60308 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750872AbeBWF24 (ORCPT ); Fri, 23 Feb 2018 00:28:56 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id BCC4560F6C; Fri, 23 Feb 2018 05:28:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1519363735; bh=6+YHyBhLWtvqAZGD+bMTSd0sbHD34DNyqw6yyJrY6c0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=H64eYVpJ3OsHdLEuKWIZjfgPnkhmwS/Rl3LFlHqYFO85moonfW8n+MuH7aJyOtnOB SysQt0Nk9ZgWFljvPqYtpl1DHJ7uiWOwbMXrgFVxis6aJNOthOrftoV8W2t5Pj3RkC yJzseFFCjZGQrXZ1RCqLZACwJUG/9IWV4G8rtRqo= 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 A509960540; Fri, 23 Feb 2018 05:28:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1519363734; bh=6+YHyBhLWtvqAZGD+bMTSd0sbHD34DNyqw6yyJrY6c0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=PZ/pArLDDGKKlrPdtVUXwSTsPfWbnJyijMQgWlbB1kcpmN5/Syfa8Wro+DJmBpwio TyeU9lFozzYlHFQPcQ9eDnYie1pOYF2GWJ1TTRF9sRzcqv5AYcbFh2H1j9HH2QvqEs GDE6WF9eUUaDLlmz7OdZiPlF+wdpO9/OBz/VWOio= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Fri, 23 Feb 2018 10:58:54 +0530 From: poza@codeaurora.org To: Christoph Hellwig 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 v10 4/7] PCI/DPC: Unify and plumb error handling into DPC In-Reply-To: <20180222183954.GD6267@infradead.org> References: <1519315332-26852-1-git-send-email-poza@codeaurora.org> <1519315332-26852-5-git-send-email-poza@codeaurora.org> <20180222183954.GD6267@infradead.org> Message-ID: <29cde9310bb4977ab10c747d104dcb21@codeaurora.org> 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-02-23 00:09, Christoph Hellwig wrote: > 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. will take care of all these comments. > >> #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. will take care Thanks, Oza.