Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1530139pxk; Fri, 2 Oct 2020 11:52:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwgJcD0MqNFtEIwaCZ7o/G8t5pDsWsHUybEB3HmJOWNhrwGTUC0yGXL2Juy8sXx2nugcPR1 X-Received: by 2002:a50:fb98:: with SMTP id e24mr3928639edq.130.1601664748024; Fri, 02 Oct 2020 11:52:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601664748; cv=none; d=google.com; s=arc-20160816; b=vzwcvvL3g8xLFD0UecknQLVeZLNkoaB6nhuDxdgBocwkRTuLBDul+38qjZMKbGJDIh 90Fz+cqkHMu1QYu4Xqy1ILV86c88ud7ebx1TeHoEiLDWnt75p1lDx1BLqkg6eNvsdD/h y++eVA9GKe2rLhJ1QnzicRnmnV14kwmpSqH0CLYHzO7MVMOc7oRx8FRgno0Ftvb6fALZ XawGoKisjcEThc8E1YFbZ66O0MtDWkH5LiQSOcIwqfiamEQ85E+w2OTpocm9Jt4urnwR sDoOCpj6QaFtR6Yxs4JhVfzOJTcrBh0sMGXgK7ISCx/e3fB6WApIWMG6PckI2bG5Gn5y A35A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=k17DVN24cWKAsiO1uGgbkyxB3+DEX3Kdzvq1wfhTv0E=; b=OQstbDWBuRcwNO7XDHUx8N45S/unb02pWvXaUkcPdabGOuRTVDv9RyYmimHiyDbBQz XspWBkvBhvfreE0ImdERCxTvf8E+ICTrsR9akdxz3NrHGYEEl4+Vkn7oj+hPlGMuRqX7 UJMR2w/2O+SAKNHh3f9QUJtnombDqohwId2FNiIbfA0Z4fA8Lf/tmE7HTgE3+O9xD+DL 2r0uE377f/tX6fs+zZihPy6Rvhh6KcQOW09udVGlinLbOueo8irVN2nIC71yQ2MLCAOj qHo8jkE5B85kwqxiih3a1i7d0Syt0a7iGfqy0W8sLwQl3MQWWRWM1qbLvA3HdFJsJ/my Tsjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oregontracks.org header.s=fm1 header.b="YoEBG/5i"; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=Z5EFOgT3; 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 z24si1165755edq.365.2020.10.02.11.52.05; Fri, 02 Oct 2020 11:52:28 -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="YoEBG/5i"; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=Z5EFOgT3; 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 S2388423AbgJBSsT (ORCPT + 99 others); Fri, 2 Oct 2020 14:48:19 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:39797 "EHLO out1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388369AbgJBSsI (ORCPT ); Fri, 2 Oct 2020 14:48:08 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 31C4D5C014E; Fri, 2 Oct 2020 14:48:06 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Fri, 02 Oct 2020 14:48:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= oregontracks.org; h=from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; s=fm1; bh=k17DVN24cWKAsiO1uGgbkyxB3+DEX3Kdzvq1wfhTv0E=; b=YoEBG /5ihulEgAY2/+8kczm/4/3Wa1YdgV7zkbU8CSRsfTp4rYoJaytl3v/BB8tpJneIJ mzPI1B63MuR1GAi2fdEFgk5dL6PoZ6vz8iKpnSLF5TaEGRuEqStIGmlMrS8odlSB vh1Rhcnx6WpzoRMkBB2iaJ1ymnIDJzW/GKgw/ZCx8mcK5nvqzAMGB3NoUWAfZ78/ J7roeQlmB7BHXFYKKHFrdvXhGrkfwtgu9lBFKleMcy8jiR+8bXxUAPy0KFDSuvLG 2pwiGFrpGAldnuAGoBP+IZUQdZ+wj27SyyGPbpO61S7QWp/UX/ia1LaBQZf6CJsc 8a1/aBwU4PJBCQnJQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding: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=k17DVN24cWKAsiO1uGgbkyxB3+DEX3Kdzvq1wfhTv0E=; b=Z5EFOgT3 WjSOJXLFWB6LUrYpP4pIDQzi9b3ReIwbwFRyKkq+fKq3y8PSGIaMh5YwpWwvqqpK +WakIRBc1qkjFTadd9lhu3qiqk4HqZVT0S+6zrkTN4jJ1qt6nwxiXD6cM4xovfhQ hvF1JkEVfDUzIwh3VSJID50gXp4Jfm2KsEFYV232VAi+tkeyQsQ1hGxRntm6t+zl RJ3DqOpiJJ8Z+Sj+lGIStbcDMzzW2aEky+uCFc4h31r5TcD2X5Wio8ZdyA/by26h 5/gv3ygak0VcQ3f8tIsn4+ZbLpZVoo7iA04XXBnlbMgygpQQ7ZnewXiuthWodM8o un2NJ80K3mVGiA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrfeeigdduvdekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomhepufgvrghnucggucfmvghllhgvhicuoehsvggrnhhvkhdruggv vhesohhrvghgohhnthhrrggtkhhsrdhorhhgqeenucggtffrrghtthgvrhhnpeehkeffte eiudeiffelkeelvefftdelhfeitdeigeffleeufedvgfegvdefvedtteenucfkphepvdeg rddvtddrudegkedrgeelnecuvehluhhsthgvrhfuihiivgepieenucfrrghrrghmpehmrg hilhhfrhhomhepshgvrghnvhhkrdguvghvsehorhgvghhonhhtrhgrtghkshdrohhrgh X-ME-Proxy: Received: from arch-ashland-svkelley.hsd1.or.comcast.net (c-24-20-148-49.hsd1.or.comcast.net [24.20.148.49]) by mail.messagingengine.com (Postfix) with ESMTPA id C9C1B306468E; Fri, 2 Oct 2020 14:48:03 -0400 (EDT) From: Sean V Kelley To: bhelgaas@google.com, Jonathan.Cameron@huawei.com, rafael.j.wysocki@intel.com, ashok.raj@intel.com, tony.luck@intel.com, sathyanarayanan.kuppuswamy@intel.com, qiuxu.zhuo@intel.com Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Sean V Kelley Subject: [PATCH v8 07/14] PCI/ERR: Limit AER resets in pcie_do_recovery() Date: Fri, 2 Oct 2020 11:47:28 -0700 Message-Id: <20201002184735.1229220-8-seanvk.dev@oregontracks.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201002184735.1229220-1-seanvk.dev@oregontracks.org> References: <20201002184735.1229220-1-seanvk.dev@oregontracks.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sean V Kelley In some cases a bridge may not exist as the hardware controlling may be handled only by firmware and so is not visible to the OS. This scenario is also possible in future use cases involving non-native use of RCECs by firmware. So explicitly apply conditional logic around these resets by limiting them to root ports and downstream ports. Signed-off-by: Sean V Kelley Acked-by: Jonathan Cameron --- drivers/pci/pcie/err.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/pci/pcie/err.c b/drivers/pci/pcie/err.c index 9b2130725ab6..5ff1afa4763d 100644 --- a/drivers/pci/pcie/err.c +++ b/drivers/pci/pcie/err.c @@ -218,9 +218,12 @@ pci_ers_result_t pcie_do_recovery(struct pci_dev *dev, pci_dbg(dev, "broadcast resume message\n"); pci_walk_bridge(bridge, report_resume, &status); - if (pcie_aer_is_native(bridge)) - pcie_clear_device_status(bridge); - pci_aer_clear_nonfatal_status(bridge); + if (type == PCI_EXP_TYPE_ROOT_PORT || + type == PCI_EXP_TYPE_DOWNSTREAM) { + if (pcie_aer_is_native(bridge)) + pcie_clear_device_status(bridge); + pci_aer_clear_nonfatal_status(bridge); + } pci_info(dev, "device recovery successful\n"); return status; -- 2.28.0