From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=198.175.65.15 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796324462; b=DblPwDZ9XbMc87fUfnXFok7Qvlo/yF7KtludFt0/KN+Sh21X6bEjx3/NCJcXMueP3Hip gI8A+2HJDdEJnk4zeeiuOGYECE1gPUkpvQafQ5hurKn33ySZEtZWPawCBCv4i5Ataz2Jp Ada9jPogIenHRjBexsqWpmdop6vh3wAfw58K3jgsfjE8KWKMC3iSY58UlnmhKub8PUr2w z7EiZ2CWUNqpU1cLHyovW/IVzCs+cWsouJh+KV6V2r6z0TnYNQ5X6Qt0ok3eRttQrAhNC T84IqvTgN9/n0x5I+FQ9mNbHa4i+u9hFgNwmk7tva2eyXIkW1Fp+ZhhD+3jxijAVjZQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796324462; h=DMARC-Filter:DKIM-Signature:X-CSE-ConnectionGUID:X-CSE-MsgGUID: X-IronPort-AV:X-IronPort-AV:Received:X-CSE-ConnectionGUID: X-CSE-MsgGUID:X-ExtLoop1:X-IronPort-AV:Received:Message-ID:Date: MIME-Version:User-Agent:Subject:To:Cc:References:Content-Language: From:In-Reply-To:Content-Type:Content-Transfer-Encoding; bh=tn1RjEY6SnisUAUH9qRUtNZ1U8aD0u1WLvPyEgJ/i3s=; b=N79mn6R7QkS0lcqByQST7siGtxIvb2MzfS/jcGbcKDlY4Cyc2G3twtyk9F9KnZm8YWO/ xX+ZooHies0IPJYOiMvwo+0KkR0UHNWFpQkEnipfjNOzrD7T/c8jW+ikdJ5BzTET3HMt4 vTw2MOmQ3oBq7n7jUpVl5c6S84SMHWagGb/Weuh2QnF3Jzi+GEZLBif2yqzHtCWFbvHWQ vGHtWSOPqBueg1pxUKJ8hnrtXadCbWKxMfjpYxq5/x4IvrJBHEygOXPF2NnXjnTTUo5P0 9eRCtxSa+xTpyz0SmY9aS5nySOGSuZO2RmX8mcIAFeke8+Xt03YWMPA3HZbSTmXdX4A== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.intel.com; spf=pass smtp.mailfrom=linux.intel.com; dkim=pass header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=kU3Saaga; arc=none smtp.remote-ip=198.175.65.15 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.15]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7C2D6606A322 for ; Thu, 3 Dec 2026 19:01:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 7C2D6606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=kU3Saaga DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1796324462; x=1827860462; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=tn1RjEY6SnisUAUH9qRUtNZ1U8aD0u1WLvPyEgJ/i3s=; b=kU3SaagaPRzK7h3pLhJb+Am9egoGWwCaizq8orCKMSnujUxVosm/cbjC BMZ+yo+fOT09c83og23wWb7tnH2RrtnfuMbqAiypkANbnSoPV8fe4vWfK yX2eNPB7NzrI/E1e8t4Rw4FRr1R2pDKFmEZQBDYwgedkMO/uDBzHVOT5F 0ZZSXVMaC9RYtGACdSDctGwRyy7EGijO6+nWzlbiLtimOV+raWPqMSdou lkyHtQi7RkmrF6cBLf8CqS7OPmZD2pKwN0AuOcMIpbcqHOujMPEgr1nAP a/UdmvwDMTSqLWy0ljt/6N9doUczTgrPKLzde3KD7yP0jr7ZmcXSPencf g==; X-CSE-ConnectionGUID: KNMchpGLREe3WNDKh9j8Yw== X-CSE-MsgGUID: q56lXnalSy+DjBgygkeREQ== X-IronPort-AV: E=McAfee;i="6800,10657,11985"; a="5294119" X-IronPort-AV: E=Sophos;i="6.29,77,1794902400"; d="scan'208";a="5294119" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by orvoesa107.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Dec 2026 11:01:01 -0800 X-CSE-ConnectionGUID: D0W0STg0TcynIHQIcV8JHg== X-CSE-MsgGUID: 9JJfSK1lRQS2QR/SrDAK7Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.29,77,1794902400"; d="scan'208";a="13925176" Received: from skuppusw-desk1.jf.intel.com (HELO [10.24.80.125]) ([10.24.80.125]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Dec 2026 11:01:01 -0800 Message-ID: Date: Thu, 3 Dec 2026 11:01:00 -0800 X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] PCI/DPC: Use DPC if platform grants DPC control but not AER control To: Mario Limonciello , Sourabh Jain , Oliver O'Halloran , Bjorn Helgaas Cc: linuxppc-dev@lists.ozlabs.org, linux-pci@vger.kernel.org References: <20261203-superm1-pci-dpc-v1-1-6e5dcd5b5fe9@amd.com> Content-Language: en-US From: Kuppuswamy Sathyanarayanan In-Reply-To: <20261203-superm1-pci-dpc-v1-1-6e5dcd5b5fe9@amd.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Hi, On 12/3/26 10:49, Mario Limonciello wrote: > PCIe r7.0, sec 6.2.11, "Implementation Note: Determination of DPC Control", > recommends that operating systems link control of DPC to control of AER. > Accordingly, since commit eed85ff4c0da ("PCI/DPC: Enable DPC only if AER > is available"), the DPC driver only binds to a Port if the OS controls AER > or the user specified "pcie_ports=dpc-native". > > At the time, Linux did not negotiate DPC control with the platform at all. > Commit ac1c8e35a326 ("PCI/DPC: Add Error Disconnect Recover (EDR) > support") added a request for DPC control via _OSC, independent of AER > control, and recorded the result in host->native_dpc. But it didn't > update portdrv or the DPC driver to use host->native_dpc, so if the > platform grants DPC control while retaining AER control, we own DPC but > never use it. Nobody enables DPC, and errors below the Port are not > contained. > > Some platforms grant DPC control without AER control and have no HEST or > other firmware-first error handling, e.g.: > > acpi PNP0A08:00: _OSC: platform does not support [SHPCHotplug AER] > acpi PNP0A08:00: _OSC: OS now controls [PCIeHotplug PME PCIeCapability LTR DPC] > acpi PNP0A08:00: OS native features: SHPCHotplug- PCIeHotplug+ PME+ AER- DPC+ LTR+ > > Treat a platform grant of DPC control like "pcie_ports=dpc-native" and use > DPC if host->native_dpc is set, even if the OS doesn't control AER. pci/next already does this with two commits from this series: https://lore.kernel.org/r/20261118181718.3907441-1-sathyanarayanan.kuppuswamy@linux.intel.com/ db6bf75c52c3 ("PCI/DPC: Reinstate support for AER-incapable ports") removes the pcie_aer_is_native() check from dpc_probe(). b7e91bf93854 ("PCI/portdrv: Bind DPC service based on host_bridge->native_dpc") binds the DPC service based only on host->native_dpc. "pcie_ports=native" and "pcie_ports=dpc-native" are already folded into the _OSC mask, so they are reflected in native_dpc. So on pci/next, a platform that reports "AER- DPC+" should already get the DPC service. Can you test your use case it with pci/next kernel? > > When handling a DPC event, the DPC driver reads and clears AER status in the > DPC Port. That's the same thing we already do in the EDR path, where > firmware has retained control of both AER and DPC, so it's not a new > intrusion on firmware-owned AER registers. > > This has no effect on non-ACPI systems, where native_aer and native_dpc are > both initialized from the same default. > > Fixes: ac1c8e35a326 ("PCI/DPC: Add Error Disconnect Recover (EDR) support") > Signed-off-by: Mario Limonciello > --- > drivers/pci/pcie/dpc.c | 4 +++- > drivers/pci/pcie/portdrv.c | 6 +++--- > 2 files changed, 6 insertions(+), 4 deletions(-) > > diff --git a/drivers/pci/pcie/dpc.c b/drivers/pci/pcie/dpc.c > index 2b779bd1d861b..8218e57ca861d 100644 > --- a/drivers/pci/pcie/dpc.c > +++ b/drivers/pci/pcie/dpc.c > @@ -473,11 +473,13 @@ static void dpc_disable(struct pcie_device *dev) > static int dpc_probe(struct pcie_device *dev) > { > struct pci_dev *pdev = dev->port; > + struct pci_host_bridge *host = pci_find_host_bridge(pdev->bus); > struct device *device = &dev->device; > int status; > u16 cap; > > - if (!pcie_aer_is_native(pdev) && !pcie_ports_dpc_native) > + if (!pcie_aer_is_native(pdev) && !host->native_dpc && > + !pcie_ports_dpc_native) > return -ENOTSUPP; > > status = devm_request_threaded_irq(device, dev->irq, dpc_irq, > diff --git a/drivers/pci/pcie/portdrv.c b/drivers/pci/pcie/portdrv.c > index 32fc623dd4108..ffd695f8aff9a 100644 > --- a/drivers/pci/pcie/portdrv.c > +++ b/drivers/pci/pcie/portdrv.c > @@ -259,12 +259,12 @@ static int get_port_device_capability(struct pci_dev *dev) > } > > /* > - * With dpc-native, allow Linux to use DPC even if it doesn't have > - * permission to use AER. > + * Use DPC if we control AER, if the platform granted us control of > + * DPC, or if the user specified "pcie_ports=dpc-native". > */ > if (pci_find_ext_capability(dev, PCI_EXT_CAP_ID_DPC) && > pci_aer_available() && > - (pcie_ports_dpc_native || host->native_aer)) > + (pcie_ports_dpc_native || host->native_aer || host->native_dpc)) > services |= PCIE_PORT_SERVICE_DPC; > > /* Enable bandwidth control if more than one speed is supported. */ > > --- > base-commit: fe6ff8d5d675c01793b9f051d16055dd4aa75244 > change-id: 20261203-superm1-pci-dpc-515ab9d3f25c > > Best regards, > -- > Mario Limonciello -- Sathyanarayanan Kuppuswamy Linux Kernel Developer