Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp795182pxk; Thu, 1 Oct 2020 14:08:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyqyK047+708eew7j/RRnlM1ffKUrxsd5o1JyjbZDvKuPIiOeiNl9Pk8QBfZGBZ/bFwpBbK X-Received: by 2002:a17:906:f205:: with SMTP id gt5mr3984192ejb.48.1601586485789; Thu, 01 Oct 2020 14:08:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601586485; cv=none; d=google.com; s=arc-20160816; b=XvGFHdLv9cQpXui5O0tiAaHywdYIG28+YkziZjj3tME5Poq6QxCDYA4Itum6gACqBS 0uLgSZJnzUFZlEPE6o9IslxCig7S4QCxY+5KByJWMLgDaochpNzuTFTg6WwqDJih1dAg NXwmy8i0sAe66FlTLmy+fpmu18P5IeEU1vVbEWOldjzN8Z2k+HF/SfruVMH5L/Y+rNEM +v2onzmOXFWNYW101C9yNDFOlUrcS59/yYmz7FK3VBKxoojXULKTM+mxzD7wgiy97kcE mvBvnHuHGoZdLHuZcQeMl41CvgrlL5alyiqOPP6qwu7BWlRulsISsczC4JwqfIWTr4U/ PU8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=qMDdCoXmVxPGL1MIQRMRxSzQilrBeZApA2UrgN5504U=; b=AsczHNLOih2WP+Zo5PAmyo2RWY4ceYIg0m2kADBoUrY0vfL1JSbjNEXHjF/76eyvSI o6PDLq/EZ7xlVg2D5TASvbcFDzN6Vz9dcnJnWUdKjTRNtOFKvkhC4xPdkZzuJJJ/Badl 7QSgJScESNx1IXQ+9XJO0rdDfJ+epFh7kX4niVOHhgFR4u/KgPkZC4PVYo3iuu27run8 67B/vDmK4rzpnO0nTzEnm+70KaZeuMm3EJEH5Qeqx1mI4nRsaq7OvIFM2mHsnoyJZ4YA Yw9GQIhqpz1GJS4XwncDvePixNBThnnuu4ZhFiGv6D9iy3+OPY5x8Uq5/3kRRzSMaqHm zNmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=Laol488f; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i7si4260054edj.22.2020.10.01.14.07.42; Thu, 01 Oct 2020 14:08:05 -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=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=Laol488f; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728090AbgJAVEw (ORCPT + 99 others); Thu, 1 Oct 2020 17:04:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34282 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726731AbgJAVEv (ORCPT ); Thu, 1 Oct 2020 17:04:51 -0400 Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D79CEC0613D0 for ; Thu, 1 Oct 2020 14:04:51 -0700 (PDT) Received: by mail-pg1-x543.google.com with SMTP id t14so5001963pgl.10 for ; Thu, 01 Oct 2020 14:04:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version; bh=qMDdCoXmVxPGL1MIQRMRxSzQilrBeZApA2UrgN5504U=; b=Laol488fCirweoFUf+rIXyFRLdXl0N/2TH+PXIZw0FKrGU1FDY8c7PVavF2CC6zdoG mLqqZau+JOG2bfwR65S1rsrrKJfQH7jKixEAVovfZUoprc30bx0NzeCYE2yF+8q2srXh LVXdxVJksfHTjXKwccCVVjJFz5pGdPscost7380YlOOq8WwR/BBBBQLe7J/yl6qIhxIM fvtxtci+BcLekH0FrAGR3SDPy6Ypb+hl2xlCYGA03rgWau/8VSSuHJb6rA0+2g88Hc8o 2H7UwFTFCc1Ena/mumD/yZIjRCrv/qf3pUSxuY20AdWrGzDYeaZnxUkPnFZcFfw/+YpL ru/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version; bh=qMDdCoXmVxPGL1MIQRMRxSzQilrBeZApA2UrgN5504U=; b=eyYhaX/ocpcCDPtF1yDAPWMwgD/BalAKqIlbUWRfcL25dJuKDeMAGzWNpeK4Ck+C6O Vi6yhsVJlLTM1DkN6GN1qVqxIt6ZKttD6hsEPVez1gh4d9W9+t2g5MQ4ywREYWGg+J/N +mz8GWhFmY/STggo68uQ4CfKwhnbIAQxhFjO9LoCld6nPoSPZTxX4byL+mLnCLlSB0ry AddcSDa4tkNPfyU7c68IKgKGH6lopw+MT4tzNLywBjOwremADmj9BV2pD/I2jzZgRsBF AwojEcblyB97jAsNjbLf610FrHoBlj1VBH4rEf5nJg1RZIvM2D8ZLBcgPBYpDTCwwPrG 7lJg== X-Gm-Message-State: AOAM532caQBf8wsL7yv1HPyU5yfJfW8SWkvmprKnFT9XhTGKwIqAd7Gg mQSc4fY2TVhHauiWN+5sH/ku6w== X-Received: by 2002:a62:7fcf:0:b029:151:15e0:ab82 with SMTP id a198-20020a627fcf0000b029015115e0ab82mr4534380pfd.80.1601586291427; Thu, 01 Oct 2020 14:04:51 -0700 (PDT) Received: from [192.168.1.102] (c-24-20-148-49.hsd1.or.comcast.net. [24.20.148.49]) by smtp.gmail.com with ESMTPSA id q81sm1810186pfc.36.2020.10.01.14.04.50 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Oct 2020 14:04:50 -0700 (PDT) From: "Sean V Kelley" To: "Jonathan Cameron" Cc: "Sean V Kelley" , bhelgaas@google.com, 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 Subject: Re: [PATCH v7 05/13] PCI/ERR: Use "bridge" for clarity in pcie_do_recovery() Date: Thu, 01 Oct 2020 14:04:49 -0700 X-Mailer: MailMate (1.13.2r5673) Message-ID: <42394E6B-6BD6-4628-BF1F-E1F14F6A86F1@intel.com> In-Reply-To: <20201001090657.00003fe4@Huawei.com> References: <20200930215820.1113353-1-seanvk.dev@oregontracks.org> <20200930215820.1113353-6-seanvk.dev@oregontracks.org> <20201001090657.00003fe4@Huawei.com> MIME-Version: 1.0 Content-Type: text/plain; format=flowed Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1 Oct 2020, at 2:06, Jonathan Cameron wrote: > On Wed, 30 Sep 2020 14:58:12 -0700 > Sean V Kelley wrote: > >> From: Sean V Kelley >> >> The term "dev" is being applied to root ports, switch >> upstream ports, switch downstream ports, and the upstream >> ports on endpoints. While endpoint upstream ports don't have >> subordinate buses, a generic term such as "bridge" may be used > > This sentence is a bit confusing. The bit before the comma > seems only slightly connected. Perhaps 2 sentences? I agree. Will reword. > >> for something with a subordinate bus. The current conditional >> logic in pcie_do_recovery() would also benefit from some >> simplification with use of pci_upstream_bridge() in place of >> dev->bus->self. Reverse the pcie_do_recovery() conditional logic >> and replace use of "dev" with "bridge" for greater clarity. >> >> Suggested-by: Bjorn Helgaas >> Signed-off-by: Sean V Kelley > > Acked-by: Jonathan Cameron Thanks, Sean > >> --- >> drivers/pci/pcie/err.c | 20 +++++++++++++------- >> 1 file changed, 13 insertions(+), 7 deletions(-) >> >> diff --git a/drivers/pci/pcie/err.c b/drivers/pci/pcie/err.c >> index 950612342f1c..c6922c099c76 100644 >> --- a/drivers/pci/pcie/err.c >> +++ b/drivers/pci/pcie/err.c >> @@ -152,16 +152,22 @@ pci_ers_result_t pcie_do_recovery(struct >> pci_dev *dev, >> { >> pci_ers_result_t status = PCI_ERS_RESULT_CAN_RECOVER; >> struct pci_bus *bus; >> + struct pci_dev *bridge; >> + int type; >> >> /* >> - * Error recovery runs on all subordinates of the first downstream >> port. >> - * If the downstream port detected the error, it is cleared at the >> end. >> + * Error recovery runs on all subordinates of the first downstream >> + * bridge. If the downstream bridge detected the error, it is >> + * cleared at the end. >> */ >> - if (!(pci_pcie_type(dev) == PCI_EXP_TYPE_ROOT_PORT || >> - pci_pcie_type(dev) == PCI_EXP_TYPE_DOWNSTREAM)) >> - dev = dev->bus->self; >> - bus = dev->subordinate; >> - >> + type = pci_pcie_type(dev); >> + if (type == PCI_EXP_TYPE_ROOT_PORT || >> + type == PCI_EXP_TYPE_DOWNSTREAM) >> + bridge = dev; >> + else >> + bridge = pci_upstream_bridge(dev); >> + >> + bus = bridge->subordinate; >> pci_dbg(dev, "broadcast error_detected message\n"); >> if (state == pci_channel_io_frozen) { >> pci_walk_bus(bus, report_frozen_detected, &status);