Received: by 10.223.185.116 with SMTP id b49csp265276wrg; Thu, 22 Feb 2018 21:23:49 -0800 (PST) X-Google-Smtp-Source: AH8x2279CjndhLkkAH5Clj20upL4RWld6+m1xphv15rt+PqEc9PkE2dQkrtjMtoUpM2BfcbPda9v X-Received: by 10.98.0.67 with SMTP id 64mr519510pfa.63.1519363429146; Thu, 22 Feb 2018 21:23:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519363429; cv=none; d=google.com; s=arc-20160816; b=tzIMimjBg5DOABgsrfZbS3+GT32S0aFfuBhPpnhe7tdY1Gr5j9FffjctZNDwdWTzjd Dc9P2VOZgaT/3j8zZqpMoqEOx4qPJRsUjU1xB2Qqvhwk1xcc1iUo+r9Udqe+ggdRclsV qYXH/7o/JqDjcEMAEwNRSmPtN+A/QDLxAt5vGsRgTmyfmSxxMBlD1L1SqS7JVDigACpl 5w7FnT+UGDtavqNctPKIJPo1+utJi3xNdz/P8RYSSAmdy3Fq991tuIOZDMdBNl/s6T/7 FuMFKGxAfFVr2mO19dmySLuOwQBqdugBTbx4kYD8NKcTC88t/U/qk+BuQN3RAFd5Ufbw YZyg== 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=0ir9cgn2M37Et+EDfAwu+fpzaZhAwaqcxzqctE47aCY=; b=WU3JopxAsd2PWabpIfDCaWNSj321Jc9QLd3MtYkMktV0eJg5zBShzr4zFClW6TO3u7 1bQS/Xq8JIe1yb9A/tmSKBs2x4HhRihe70RF3E4Zijl+kZl9nSoKCtt71ky99rZzwehX EtavhFgvxh4xNK+6GRqJsuV4P5PyOj2VBRPsWd2vt3Es2RKzenMurDP6vVys1tssUTHn zq8WaMiNs0Yo5HC6lO/R5ZzyVs61NMicBdq0WwDtPS1nScS5Daa+sba0La4u3+6rjfuQ IBXvaM5yipt7XeiS/CUcc6J+2WLqqMWQIDVyLLWlvSVWj762zsXCMlGQxfPRIimyjW1G HB7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=Y+tnyV1A; dkim=pass header.i=@codeaurora.org header.s=default header.b=nAHdDquY; 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 z62si1024620pgd.688.2018.02.22.21.23.33; Thu, 22 Feb 2018 21:23:49 -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=Y+tnyV1A; dkim=pass header.i=@codeaurora.org header.s=default header.b=nAHdDquY; 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 S1751444AbeBWFWu (ORCPT + 99 others); Fri, 23 Feb 2018 00:22:50 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:57732 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750949AbeBWFWt (ORCPT ); Fri, 23 Feb 2018 00:22:49 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id A7E4C60867; Fri, 23 Feb 2018 05:22:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1519363368; bh=jbdewrNM0XvtdQxycl0dp0RLj6Uroa2U0pIG1ALAmI4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Y+tnyV1AEmF8K4JKKgkcsQiLBXiiqMowN7hJbSmHqBQcgw4h+l7xmWajsUcxtGyQa 02KvlID1MwmHDq4h0ecSPLKEK0QvTTSXjdwt+VIo4YRavcmhmAm09lIyaBnhibZm2E g1maY2QiXhgMxCMZvnG69i1Q3Lz4n3C38If8deyE= 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 AB8DD60540; Fri, 23 Feb 2018 05:22:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1519363367; bh=jbdewrNM0XvtdQxycl0dp0RLj6Uroa2U0pIG1ALAmI4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=nAHdDquYUuN/RcUqAnfyCPJikhCyGsMAL1eLYlwByPYCdiBAqc7zaaNg91ojhs9Cv 4FC4Rh0pzn//D2gGJ78MOtAmQiY62kxEabeQpomTlaOE3g5z7mL0ZNum5IIT9WqyFB 8pXGIztGBKQBnZjqR++yqTH15m6enJmS9DBi0hZ0= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Fri, 23 Feb 2018 10:52:47 +0530 From: poza@codeaurora.org To: Randy Dunlap 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 v9 7/7] PCI/DPC: Enumerate the devices after DPC trigger event In-Reply-To: References: <1519285571-5634-1-git-send-email-poza@codeaurora.org> <1519285571-5634-8-git-send-email-poza@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-02-23 00:53, Randy Dunlap wrote: > On 02/21/2018 11:46 PM, Oza Pawandeep wrote: >> Implement error_resume callback in DPC so, after DPC trigger event >> enumerates the devices beneath. >> >> Signed-off-by: Oza Pawandeep >> >> diff --git a/drivers/pci/pcie/pcie-dpc.c b/drivers/pci/pcie/pcie-dpc.c >> index fce4518..59c01c7 100644 >> --- a/drivers/pci/pcie/pcie-dpc.c >> +++ b/drivers/pci/pcie/pcie-dpc.c >> @@ -129,6 +129,23 @@ static void dpc_wait_link_inactive(struct dpc_dev >> *dpc) >> } >> >> /** >> + * dpc_error_resume - enumerate the devices beneath >> + * @dev: pointer to Root Port's pci_dev data structure > > * @pdev: ... > >> + * >> + * Invoked by Port Bus driver during nonfatal recovery. >> + */ >> +static void dpc_error_resume(struct pci_dev *pdev) >> +{ >> + bool active = true; >> + >> + if (pci_wait_for_link(pdev, active)) { >> + pci_lock_rescan_remove(); >> + pci_rescan_bus(pdev->bus); >> + pci_unlock_rescan_remove(); >> + } >> +} >> + >> +/** >> * dpc_reset_link - reset link DPC routine >> * @dev: pointer to Root Port's pci_dev data structure >> * >> diff --git a/drivers/pci/pcie/pcie-err.c b/drivers/pci/pcie/pcie-err.c >> index 6844347..4950f49 100644 >> --- a/drivers/pci/pcie/pcie-err.c >> +++ b/drivers/pci/pcie/pcie-err.c >> @@ -256,6 +258,15 @@ static pci_ers_result_t >> broadcast_error_message(struct pci_dev *dev, >> result_data.result = PCI_ERS_RESULT_RECOVERED; >> >> if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) { >> + /* If DPC is triggered, call resume error hanlder > > handler > > Kernel multi-line comment style is: > /* > * Begin comment here. > * foo bar blah > */ > >> + * because, at this point we can safely assume that >> + * link recovery has happened. >> + */ >> + if ((severity == DPC_FATAL) && >> + (cb == report_resume)) { >> + cb(dev, NULL); >> + return PCI_ERS_RESULT_RECOVERED; >> + } >> /* >> * If the error is reported by a bridge, we think this error >> * is related to the downstream link of the bridge, so we > > thanks, Thanks for the comments, All your comments are taken care in v10, though I will post v11.