From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 89315C2BA2B for ; Thu, 16 Apr 2020 20:32:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 69684206A2 for ; Thu, 16 Apr 2020 20:32:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729455AbgDPUcy (ORCPT ); Thu, 16 Apr 2020 16:32:54 -0400 Received: from mga01.intel.com ([192.55.52.88]:25215 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728696AbgDPUcy (ORCPT ); Thu, 16 Apr 2020 16:32:54 -0400 IronPort-SDR: n9OrY2WUz0OYd2M5VpoxGVJ5iElygHIsla2nK0HO09G+QyiLL85hDyFdmdq+Vlx9/p7oWecrw3 mpvsPdz+x5gg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Apr 2020 13:32:53 -0700 IronPort-SDR: bQIx91LfQ/1cGTGt3CJ21Sg11de1UFLBO5hn51HyVttmh5OEivccc2C2hrfY1U+dHUm/vrErK2 0GijO9uT9QOQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,392,1580803200"; d="scan'208";a="242776228" Received: from msaddawx-mobl1.amr.corp.intel.com (HELO [10.254.107.229]) ([10.254.107.229]) by orsmga007.jf.intel.com with ESMTP; 16 Apr 2020 13:32:52 -0700 Subject: Re: [PATCH] PCI/DPC: Allow Non-ACPI Native ports to use DPC To: Jon Derrick , Bjorn Helgaas Cc: Russell Currey , Sam Bobroff , Oliver O'Halloran , Bjorn Helgaas , Olof Johansson , Keith Busch , Frederick Lawler , linuxppc-dev@lists.ozlabs.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org References: <1587067157-2291-1-git-send-email-jonathan.derrick@intel.com> From: "Kuppuswamy, Sathyanarayanan" Message-ID: <4c2bf639-5510-fb17-2f02-73e7016d8f70@linux.intel.com> Date: Thu, 16 Apr 2020 13:32:51 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <1587067157-2291-1-git-send-email-jonathan.derrick@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Hi, On 4/16/20 12:59 PM, Jon Derrick wrote: > 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 capable > ports by advertising the HEST Global flag and specifying the type and > class (aer_hest_parse). > > This ultimately can lead to bad situations if the BIOS or port firmware > leaves DPC preconfigured and the Linux DPC driver is unable to bind to > the port to handle DPC events. > > This patch adds the check for Native DPC in the port's host bridge in > order to allow DPC services to bind to the port. > > Signed-off-by: Jon Derrick > --- > drivers/pci/pcie/dpc.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/pci/pcie/dpc.c b/drivers/pci/pcie/dpc.c > index 7621704..a1e355d 100644 > --- a/drivers/pci/pcie/dpc.c > +++ b/drivers/pci/pcie/dpc.c > @@ -281,10 +281,12 @@ static int dpc_probe(struct pcie_device *dev) > { > struct pci_dev *pdev = dev->port; > struct device *device = &dev->device; > + struct pci_host_bridge *host = pci_find_host_bridge(pdev->bus); > int status; > u16 ctl, cap; > > - if (pcie_aer_get_firmware_first(pdev) && !pcie_ports_dpc_native) > + if (pcie_aer_get_firmware_first(pdev) && !pcie_ports_dpc_native && For other PCIe services, this check is added in get_port_device_capability(). Why not add it there for DPC as well ? > + !host->native_dpc) > return -ENOTSUPP; > > status = devm_request_threaded_irq(device, dev->irq, dpc_irq, >