Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1205739ybz; Wed, 22 Apr 2020 15:52:30 -0700 (PDT) X-Google-Smtp-Source: APiQypI7/vBgh6OZyG+OuUu4wCWYKighOqtYyUQJhZ0jAmsLQ+9rCdVela/P0u+3lMeTrrG0nXa6 X-Received: by 2002:a17:906:804a:: with SMTP id x10mr509003ejw.86.1587595949843; Wed, 22 Apr 2020 15:52:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587595949; cv=none; d=google.com; s=arc-20160816; b=YKbjkw7d5Z0XcaMQevC9yjEt6l1H4xTjIegtyXVuSI5w+95co9t8fzP3CgLDlKF8so WMCx1/ofNJ5/7AMaO2580vRrnn0pbehDBHGm0yRjbpSgkCoWPN4Ceb+3XX+pWZWL/5yx obTHnPpxWBB4IyefGoRTDLQe/ptKOv6QICVx+FLKUS2d0nW+DeW4zb5kpZmUyjWzmjdX oUqUYPZGRyj6LtWfbMbAuAy6d5TJA72KyiumCPdJFyK1cj4jKu/2ppk+BXFJbiI3t8on HQ50zhkul9M2NnhNLVA42WRhlWDdCk/d43JlcdlYQkCoKFiI7fVW9FcM2CTqz9+ZSReT 5dLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:ironport-sdr:ironport-sdr; bh=9Jg5XaRPo50844Fw0C6LXqQ5TTrPq3KXfbB2IYiauSI=; b=NqLbxFFb0CqiwtAcXLijQm88IPcv6gIFAuQFY79IlqrGWAmvpYReQ/T9FCTAYg6LUG /WTGvj2Ronidce14ZLj9quZJA4OgVZ2wp6E1yXQzvz5K/SqYJldPO0BGYTPI+8QGUuiQ JxWRZ+OsDjsE2Y+6iRQ0L9pnqdjrt31D2ef5cfutkhvs71OHmWK70bHFEV3ywRGwpx3G AsXeLa/6rnasOlqm6PnQ7cusSr3+EHC7Eki02cPNCwqa4byMWKulc/yvh7t1rS92Fv8R xVE8DdGvYV0LDhxJpe+LchcE0I09Sd5eJQ2colIYbfERt1dK3J7066SyVjd8SeKDtPZU Eihw== ARC-Authentication-Results: i=1; mx.google.com; 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 bs23si274155edb.203.2020.04.22.15.52.07; Wed, 22 Apr 2020 15:52:29 -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; 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 S1726117AbgDVWuU (ORCPT + 99 others); Wed, 22 Apr 2020 18:50:20 -0400 Received: from mga09.intel.com ([134.134.136.24]:59297 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725846AbgDVWuU (ORCPT ); Wed, 22 Apr 2020 18:50:20 -0400 IronPort-SDR: w2TekEPaGgH6ZQLQlfwVylgdaj8X6dwjZPWsl8Hv4O8McGptNdWVnBZIYrh02BTzVl9w89bl8+ bFhA8ZakmMRw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Apr 2020 15:50:19 -0700 IronPort-SDR: AQJuUtKle/RXyk8OeabhgcPSN8iqD+WQkZDNbNj4VjAxRWLpaxrc9UF/e5AuG4sQTEgZBWoWbs SBDNZPZOJnDg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,304,1583222400"; d="scan'208";a="259231225" Received: from crschrol-desk22.amr.corp.intel.com (HELO [10.254.73.197]) ([10.254.73.197]) by orsmga006.jf.intel.com with ESMTP; 22 Apr 2020 15:50:18 -0700 Subject: Re: [PATCH v2 2/2] PCI/DPC: Allow Native DPC Host Bridges to use DPC To: Jon Derrick , Bjorn Helgaas Cc: linux-pci@vger.kernel.org, Keith Busch , Russell Currey , Sam Bobroff , Oliver O'Halloran , Bjorn Helgaas , Andy Shevchenko , Frederick Lawler , Rajat Jain , "Patel, Mayurkumar" , Olof Johansson , "Rafael J. Wysocki" , Mika Westerberg , Alex Williamson , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org References: <1587418630-13562-1-git-send-email-jonathan.derrick@intel.com> <1587418630-13562-3-git-send-email-jonathan.derrick@intel.com> From: "Kuppuswamy, Sathyanarayanan" Message-ID: <0058b993-0663-7fed-ed31-cb0adf845a39@linux.intel.com> Date: Wed, 22 Apr 2020 15:50:17 -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: <1587418630-13562-3-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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/20/20 2:37 PM, Jon Derrick wrote: > The existing portdrv model prevents DPC services without either OS > control (_OSC) granted to AER services, a Host Bridge requesting Native > AER, or using one of the 'pcie_ports=' parameters of 'native' or > 'dpc-native'. > > The DPC port service driver itself will also fail to probe if the kernel > assumes the port is using Firmware-First AER. It's a reasonable > expectation that a port using Firmware-First AER will also be using > Firmware-First DPC, however if a Host Bridge requests Native DPC, the > DPC driver should allow it and not fail to bind due to AER capability > settings. > > Host Bridges which request Native DPC port services will also likely > request Native AER, however it shouldn't be a requirement. This patch > allows ports on those Host Bridges to have DPC port services. > > This will avoid the unlikely situation where the port is Firmware-First > AER and Native DPC, and a BIOS or switch firmware preconfiguration of > the DPC trigger could result in unhandled DPC events. > > Signed-off-by: Jon Derrick > --- > drivers/pci/pcie/dpc.c | 3 ++- > drivers/pci/pcie/portdrv_core.c | 3 ++- > 2 files changed, 4 insertions(+), 2 deletions(-) > > diff --git a/drivers/pci/pcie/dpc.c b/drivers/pci/pcie/dpc.c > index 7621704..3f3106f 100644 > --- a/drivers/pci/pcie/dpc.c > +++ b/drivers/pci/pcie/dpc.c > @@ -284,7 +284,8 @@ static int dpc_probe(struct pcie_device *dev) > 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 && > + !pci_find_host_bridge(pdev->bus)->native_dpc) Why do it in probe as well ? if host->native_dpc is not set then the device DPC probe it self won't happen right ? > return -ENOTSUPP; > > status = devm_request_threaded_irq(device, dev->irq, dpc_irq, > diff --git a/drivers/pci/pcie/portdrv_core.c b/drivers/pci/pcie/portdrv_core.c > index 50a9522..f2139a1 100644 > --- a/drivers/pci/pcie/portdrv_core.c > +++ b/drivers/pci/pcie/portdrv_core.c > @@ -256,7 +256,8 @@ static int get_port_device_capability(struct pci_dev *dev) > */ > if (pci_find_ext_capability(dev, PCI_EXT_CAP_ID_DPC) && > pci_aer_available() && > - (pcie_ports_dpc_native || (services & PCIE_PORT_SERVICE_AER))) > + (pcie_ports_dpc_native || host->native_dpc || > + (services & PCIE_PORT_SERVICE_AER))) > services |= PCIE_PORT_SERVICE_DPC; > > if (pci_pcie_type(dev) == PCI_EXP_TYPE_DOWNSTREAM || >