Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3706pxk; Wed, 30 Sep 2020 16:01:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw1putlqAK6eyF9kO67iVASIDF8N4IFseBVbN37X64/TmvFpOxcJVUcE/Z84eMPIKMeHTMV X-Received: by 2002:a17:906:c8ca:: with SMTP id gc10mr4904443ejb.461.1601506901065; Wed, 30 Sep 2020 16:01:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601506901; cv=none; d=google.com; s=arc-20160816; b=WgSO7iQghuQMx7dWnwDSonc1iTRa8wBdWIGhFhkNpm8Zf4xFPFManug70s5kVUEW+r lq3fTcIXw2WnQ45yi3XVnKRvfHK9A2BwAUThYDmm2Dc7neONAlvbJMxcGyGonUy8/6yl OtmHRtQefF7FEXirsjTvQLpjytzY1gwkySnkQ6qtLWGzT5QptF+/sdy1FqZBA+I0e3nb t07FjG2kk128+vEdCpylxILwMweWrviBWjXpDJAZFrBJfARbI0gTLz48b2bbie17mZfl petQCLVTiPinLutSXuSGKtOPt1O6sEmNf5BtHZHiypv0aoIvStHiDN4JzUw4HUnGKIDr lsCA== 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=ssHeaqMnPt5Gs846wLr7DIjg7Vyu5Ulfjnxp9FjFInU=; b=rmrd5Uw4fGK81PAUphxrQp9hurk2NZf/n+P4l6fCGZ57DL72bLW0PReUI6HzHA9eQc Dt7vlOWBWD8y/NXLwklxl5+OsBDncNZ/2u/w/+ZUgnRcVHufL8lcyRY2CN0lXJO6k+c8 1cFg83jefTovR9Er8yXOmD6PVNwgs7dKC19H7hPzHmavQO9EQiWWuBW3/yQLleCM1rWy J9JW8Ab+8M67n08hHUDmrbCS7PfZjNPWEKjOe6DFjqctDKWku7jNY1jx7GDY4bhPjFt3 keCEvLeiF+6+yS6YSHhr+CQD1aRj3xaf8mxHnA2ay1fR0MoKa81GBrsrIZ/eqNqdP0JZ 6ocw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oregontracks.org header.s=fm1 header.b=H7SPISrt; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=MNbTCeEb; 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 c1si2067711eds.366.2020.09.30.16.01.18; Wed, 30 Sep 2020 16:01:41 -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=H7SPISrt; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=MNbTCeEb; 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 S1731235AbgI3V6v (ORCPT + 99 others); Wed, 30 Sep 2020 17:58:51 -0400 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]:56721 "EHLO wout1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731239AbgI3V6l (ORCPT ); Wed, 30 Sep 2020 17:58:41 -0400 Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.west.internal (Postfix) with ESMTP id 19054C6B; Wed, 30 Sep 2020 17:58:39 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Wed, 30 Sep 2020 17:58:40 -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=ssHeaqMnPt5Gs846wLr7DIjg7Vyu5Ulfjnxp9FjFInU=; b=H7SPI Srtcxj9BaKzoFy8w4aoCx/ItdTTgYUoZyU4+CFcl+09Te7veQXuZoSL3puiN/Q94 tcXhR6u3zWjZ7I8i4DXyBx5MwhcXZdEIr2iu/nIvQ/CklUX8QhUFkgJwIEw5HipI RS+vJzCweiQ+/jrcGG97tFLJcmZMmH90XKdNTag8A1hl57SLnIToKABkb4Bkeorj ItKCEC4FK3KSORCsqjiDayTqNhQZI28S+MNXA4xO2VqGke5JW0u513j9UfHb11J+ z3oiYyZIikhZjVmfZSCF+ypu3daO2jRfG4R0Xb8aeDL34dH/MmMPvYluWguCXkPu /dtKLAXyYnkMpLV5g== 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=ssHeaqMnPt5Gs846wLr7DIjg7Vyu5Ulfjnxp9FjFInU=; b=MNbTCeEb 5XAmgdTx5ohcQr2UxlOJsGaooYE/3UOgUJKm9x8q1vyMRUX5QSpE/exTgmr18aCt KI6Yex3n9nTBc0jvZU8l1xhfrg3GMTN1/81W6GHjwV8zQCz/S93eYsv3kPZVudHd s8vGospo093o3cUoEgXfJXQur0PDOn+LetF5ycqN1SrHTnyCmpuvyFR/OrIcEaS4 88jKzL4nGrqtPzLXioc5phtiOoH7YjvnUCdRJPODVv/UzYzTKcFN/RFDZ98FJYxh JPG6HcoCi5QcPKepaKNpIHDd2kLm6alJLDYT8+bsf0yDIAWHy8ows+WRLFxprAJv PkolQ5gyaXvw+A== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrfeefgddthecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertd ertddtnecuhfhrohhmpefuvggrnhcuggcumfgvlhhlvgihuceoshgvrghnvhhkrdguvghv sehorhgvghhonhhtrhgrtghkshdrohhrgheqnecuggftrfgrthhtvghrnhepheekffetie duieffleekleevffdtlefhiedtieegffelueefvdfggedvfeevtdetnecukfhppedvgedr vddtrddugeekrdegleenucevlhhushhtvghrufhiiigvpedunecurfgrrhgrmhepmhgrih hlfhhrohhmpehsvggrnhhvkhdruggvvhesohhrvghgohhnthhrrggtkhhsrdhorhhg 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 40E083280064; Wed, 30 Sep 2020 17:58:38 -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 v7 06/13] PCI/ERR: Limit AER resets in pcie_do_recovery() Date: Wed, 30 Sep 2020 14:58:13 -0700 Message-Id: <20200930215820.1113353-7-seanvk.dev@oregontracks.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200930215820.1113353-1-seanvk.dev@oregontracks.org> References: <20200930215820.1113353-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 --- 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 c6922c099c76..9e552330155b 100644 --- a/drivers/pci/pcie/err.c +++ b/drivers/pci/pcie/err.c @@ -203,9 +203,12 @@ pci_ers_result_t pcie_do_recovery(struct pci_dev *dev, pci_dbg(dev, "broadcast resume message\n"); pci_walk_bus(bus, report_resume, &status); - if (pcie_aer_is_native(dev)) - pcie_clear_device_status(dev); - pci_aer_clear_nonfatal_status(dev); + 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