From patchwork Mon Apr 20 21:37:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jon Derrick X-Patchwork-Id: 1273776 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 495gj86Hl9z9sSG for ; Tue, 21 Apr 2020 08:04:44 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=intel.com Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 495gj81zYMzDqtY for ; Tue, 21 Apr 2020 08:04:44 +1000 (AEST) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=intel.com (client-ip=134.134.136.31; helo=mga06.intel.com; envelope-from=jonathan.derrick@intel.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=intel.com Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 495gdR41QbzDqsK for ; Tue, 21 Apr 2020 08:01:31 +1000 (AEST) IronPort-SDR: 91eEeghQaPUhiykkqBR32DZrtSqddqKvaUcjooa6aJ0ZiTaf9IVineWthj2DhwT54T2oZlTgI3 XbSTrd4CS3Ug== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Apr 2020 15:01:11 -0700 IronPort-SDR: B5K5EbZN/GSr4XUuymvuYRrd7HCa5RqMAPti5a6kXncsbreRaatYMRh8I0XZNELFVQPRkBhfRk 7rLmNZUQ5B5Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,407,1580803200"; d="scan'208";a="455848343" Received: from unknown (HELO nsgsw-wilsonpoint.lm.intel.com) ([10.232.116.102]) by fmsmga005.fm.intel.com with ESMTP; 20 Apr 2020 15:01:09 -0700 From: Jon Derrick To: Bjorn Helgaas Subject: [PATCH v2 1/2] PCI/AER: Allow Native AER Host Bridges to use AER Date: Mon, 20 Apr 2020 15:37:09 -0600 Message-Id: <1587418630-13562-2-git-send-email-jonathan.derrick@intel.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1587418630-13562-1-git-send-email-jonathan.derrick@intel.com> References: <1587418630-13562-1-git-send-email-jonathan.derrick@intel.com> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kuppuswamy Sathyanarayanan , Rajat Jain , "Rafael J. Wysocki" , Frederick Lawler , Sam Bobroff , linux-pci@vger.kernel.org, Olof Johansson , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Bjorn Helgaas , Alex Williamson , "Patel, Mayurkumar" , Oliver O'Halloran , Keith Busch , Andy Shevchenko , Mika Westerberg , Jon Derrick Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" Some platforms have a mix of ports whose capabilities can be negotiated by _OSC, and some ports which are not described by ACPI and instead managed by Native drivers. The existing Firmware-First HEST model can incorrectly tag these Native, Non-ACPI ports as Firmware-First managed ports by advertising the HEST Global Flag and matching the type and class of the port (aer_hest_parse). If the port requests Native AER through the Host Bridge's capability settings, the AER driver should honor those settings and allow the port to bind. This patch changes the definition of Firmware-First to exclude ports whose Host Bridges request Native AER. Signed-off-by: Jon Derrick --- drivers/pci/pcie/aer.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/pci/pcie/aer.c b/drivers/pci/pcie/aer.c index f4274d3..30fbd1f 100644 --- a/drivers/pci/pcie/aer.c +++ b/drivers/pci/pcie/aer.c @@ -314,6 +314,9 @@ int pcie_aer_get_firmware_first(struct pci_dev *dev) if (pcie_ports_native) return 0; + if (pci_find_host_bridge(dev->bus)->native_aer) + return 0; + if (!dev->__aer_firmware_first_valid) aer_set_firmware_first(dev); return dev->__aer_firmware_first;