Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp95404pxk; Tue, 22 Sep 2020 20:07:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzEhS5gOm1Yjlfzemzdl2OSVs8NkGKa6w6UD1Bt3DHitVKbffQ3fQ0kJMjjESj47FR8kt4t X-Received: by 2002:a17:906:f1cf:: with SMTP id gx15mr7943055ejb.241.1600830435276; Tue, 22 Sep 2020 20:07:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600830435; cv=none; d=google.com; s=arc-20160816; b=kL5IZyTsdfnZhvPOaLuBOUwUX/GctXS2FcB722Tl3V/tPMRNwjcr7+bAwz9i4IM03r YxNGk7ShWpFnKZWVzw3FL195ufUVcItuCDmmxqkQBDY1VqASG4znb7WeLo8C+tLkqsTF EnYQ4r6L4kjf0DDpT1AfftR5B8TOOXu5PvG8Vxqu1+3tw+1GJpllmTO9OqlV5N8Hpz9H t/gpJzxLhaUTbj1XQMAkMR6wnLslMFz9wJNJygkET+jjkkePSi+KB8W4lNUsUiNgKWg3 EkAvCfDeePXbb6T0f5YHrZs+D2MZooUxeYC6yI9idvsPnbfZKsyPaxb4p64qIhO7zGQ2 /X8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature:dkim-signature; bh=HRaAmkRs0dCQ9ZoZ9oxJwplIRQkT3KE8sP5m13Unpho=; b=KvDRvIbAMv5DVUm+J36Czl3/D9bvaJR8V+AojUky+9aZsAEXcWNMY769qooTQt37Q+ dwYAH8xc5gG3HeSROjfJUSEZCEMPuhQB8eOkWRQNF7fS0QBl6vnG5kXuzDT5p+gqZQ9D vudueW0YeVOaIxEVdk0BZok1RiHhnefKsLIb6mJr5hVJnEQZVyNQ0bgwDtLnqhKG4Ys2 DD4GTjojVgar7Cqb3am+3kjn/DijoMA8aMSHfH9nz35OAdAFrFApFxt45CKj7n+gPeuw gZQc1fOL8ZMPdnkAvnHfiNk8oT6whrAzr7+BFuL8pLiQTgjHENDI7d8JaJJ21pnmMaoZ AxMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oregontracks.org header.s=fm1 header.b=SvFbur9P; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=ssXoi1Aa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bu5si12488976ejb.750.2020.09.22.20.06.52; Tue, 22 Sep 2020 20:07:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@oregontracks.org header.s=fm1 header.b=SvFbur9P; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=ssXoi1Aa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727351AbgIWCtX (ORCPT + 99 others); Tue, 22 Sep 2020 22:49:23 -0400 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]:60523 "EHLO wout1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726873AbgIWCtW (ORCPT ); Tue, 22 Sep 2020 22:49:22 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 742AE12B2; Tue, 22 Sep 2020 22:49:21 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Tue, 22 Sep 2020 22:49:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= oregontracks.org; h=mime-version:references:in-reply-to:from :date:message-id:subject:to:cc:content-type; s=fm1; bh=HRaAmkRs0 dCQ9ZoZ9oxJwplIRQkT3KE8sP5m13Unpho=; b=SvFbur9P1C2s4t20I2Kub2dc6 4brhXV8sRNeOOrTnvYrfAdW0FSv8NwgrYLJsZL7bJFm3bqHz8l+JJzVFqlth2uNL riUUjW+4ZvN7koHUNJGB00StOO9ZWJ9tDDJgoonQfHBahyYkapJbAFQYEA8yDioy q7X0yygf2tR2nyTXCP1Mc0AMBy/zCnUfD0a0Yh6JTKW3qVRe696ec1jxRcJjwRdJ dItWj/GNhNyvX9laHTPQO0ZU1gEUvmiw0CSeCMvyS8sgLoAmAudnoRhhX6tMfODp ZROiqr829pMMrq+7xDN2KKpVOmWySyCTBWDlQZRZe6fF55oOjVcIlsdLyYRgg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=HRaAmk Rs0dCQ9ZoZ9oxJwplIRQkT3KE8sP5m13Unpho=; b=ssXoi1AaSRKeGoatrY9M3A Wy48OAy3EeZX6dS3NCZmWsUtCd3Yd6ANzVMbC+Vb2kFe79ON26xjad3juIwg7TeV AOOvfDB28Q0f5OQxgBIz2q6tw9+iY0YTx+AKlHgLiU9IDW/Iqv/E8ox+xYxGT20v pisikCMOpq2gEj+70UAd7d+BU5RapJ7vyBkwiY+KGPpPzhfGdutL81znulc0Z7yB pL0MFeoBwICYXreLJSsNGexlHipGHny5/7PqAKuTgUXMhGMnAWmaNuw31mTFny7J gaduUnOsqxRVqFkeZ2076eERKqXt82qgJdzDKi2LkUuNJBTK8g5qCtuIFFSCh7IQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrudehgdeifecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeggfhgjhfffkffuvfgtsehttdertddttdejnecuhfhrohhmpefuvggrnhcuggcu mfgvlhhlvgihuceoshgvrghnvhhkrdguvghvsehorhgvghhonhhtrhgrtghkshdrohhrgh eqnecuggftrfgrthhtvghrnhepieelhfetgefhvdetkeejieefteffveekgefgheekieeg iefhvedtuddtkefhleejnecukfhppedvtdelrdekhedrvdduledrgedunecuvehluhhsth gvrhfuihiivgepvdenucfrrghrrghmpehmrghilhhfrhhomhepshgvrghnvhhkrdguvghv sehorhgvghhonhhtrhgrtghkshdrohhrgh X-ME-Proxy: Received: from mail-qv1-f41.google.com (mail-qv1-f41.google.com [209.85.219.41]) by mail.messagingengine.com (Postfix) with ESMTPA id CEF45328006A; Tue, 22 Sep 2020 22:49:20 -0400 (EDT) Received: by mail-qv1-f41.google.com with SMTP id p15so10623545qvk.5; Tue, 22 Sep 2020 19:49:20 -0700 (PDT) X-Gm-Message-State: AOAM5328Z5OkEv5xeq129YeaMUgHtVlg+xpmqmVbRlcnSSuM+SxcOCZg HKCGL6Cqth9lQnO8nK5aopN7Liv5HFvoOLYLEnQ= X-Received: by 2002:a0c:b202:: with SMTP id x2mr9169067qvd.49.1600829360477; Tue, 22 Sep 2020 19:49:20 -0700 (PDT) MIME-Version: 1.0 References: <20200918204603.62100-1-sean.v.kelley@intel.com> <20200918204603.62100-6-sean.v.kelley@intel.com> <20200921121355.00002b77@Huawei.com> In-Reply-To: <20200921121355.00002b77@Huawei.com> From: Sean V Kelley Date: Tue, 22 Sep 2020 19:49:09 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v5 05/10] PCI/AER: Apply function level reset to RCiEP on fatal error To: Jonathan Cameron Cc: Sean V Kelley , Bjorn Helgaas , rafael.j.wysocki@intel.com, ashok.raj@intel.com, tony.luck@intel.com, sathyanarayanan.kuppuswamy@intel.com, qiuxu.zhuo@intel.com, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 21, 2020 at 4:15 AM Jonathan Cameron wrote: > > On Fri, 18 Sep 2020 13:45:58 -0700 > Sean V Kelley wrote: > > > From: Qiuxu Zhuo > > > > Attempt to do function level reset for an RCiEP associated with an > > RCEC device on fatal error. > > I'm not sure the description is correct. Looks like it will do > the reset even if not associated with an RCEC. > I'd just cut this down to: > > "Attempt to do a function level reset for an RCiEP on fatal error." Agree. Will change. > > I'm not 100% sure doing an flr will actually help in most cass if you've > reported a fatal error, but I suppose it does no harm! > > So with description changed. > Reviewed-by: Jonathan Cameron Will do, thanks. Sean > > > > > Signed-off-by: Qiuxu Zhuo > > --- > > drivers/pci/pcie/err.c | 31 ++++++++++++++++++++++--------- > > 1 file changed, 22 insertions(+), 9 deletions(-) > > > > diff --git a/drivers/pci/pcie/err.c b/drivers/pci/pcie/err.c > > index e575fa6cee63..5380ecc41506 100644 > > --- a/drivers/pci/pcie/err.c > > +++ b/drivers/pci/pcie/err.c > > @@ -169,6 +169,17 @@ static void pci_bridge_walk(struct pci_dev *bridge, int (*cb)(struct pci_dev *, > > cb(bridge, userdata); > > } > > > > +static pci_ers_result_t flr_on_rciep(struct pci_dev *dev) > > +{ > > + if (!pcie_has_flr(dev)) > > + return PCI_ERS_RESULT_NONE; > > + > > + if (pcie_flr(dev)) > > + return PCI_ERS_RESULT_DISCONNECT; > > + > > + return PCI_ERS_RESULT_RECOVERED; > > +} > > + > > pci_ers_result_t pcie_do_recovery(struct pci_dev *dev, > > pci_channel_state_t state, > > pci_ers_result_t (*reset_subordinate_devices)(struct pci_dev *pdev)) > > @@ -195,15 +206,17 @@ pci_ers_result_t pcie_do_recovery(struct pci_dev *dev, > > if (state == pci_channel_io_frozen) { > > pci_bridge_walk(bridge, report_frozen_detected, &status); > > if (type == PCI_EXP_TYPE_RC_END) { > > - pci_warn(dev, "link reset not possible for RCiEP\n"); > > - status = PCI_ERS_RESULT_NONE; > > - goto failed; > > - } > > - > > - status = reset_subordinate_devices(bridge); > > - if (status != PCI_ERS_RESULT_RECOVERED) { > > - pci_warn(dev, "subordinate device reset failed\n"); > > - goto failed; > > + status = flr_on_rciep(dev); > > + if (status != PCI_ERS_RESULT_RECOVERED) { > > + pci_warn(dev, "function level reset failed\n"); > > + goto failed; > > + } > > + } else { > > + status = reset_subordinate_devices(bridge); > > + if (status != PCI_ERS_RESULT_RECOVERED) { > > + pci_warn(dev, "subordinate device reset failed\n"); > > + goto failed; > > + } > > } > > } else { > > pci_bridge_walk(bridge, report_normal_detected, &status); > >