All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Guixin Liu" <kanie@linux.alibaba.com>
Cc: linux-pci@vger.kernel.org
Subject: Re: [PATCH] PCI/DPC: Honor "pcie_ports=native" when enabling DPC
Date: Tue, 01 Sep 2026 06:57:11 +0000	[thread overview]
Message-ID: <20260901065711.7AEC91F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260901064554.2178688-1-kanie@linux.alibaba.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:

Pre-existing issues:
- [High] This problem wasn't introduced by this patch, but pre-existed in the codebase. Various PCI and CXL subsystems incorrectly check `host->native_*` flags directly without honoring the `pcie_ports=native` or `pcie_ports_dpc_native` command-line overrides.
--

commit bed1438fd8fcfc05e1122790665a4045a06281cf
Author: Guixin Liu <kanie@linux.alibaba.com>

PCI/DPC: Honor "pcie_ports=native" when enabling DPC
    
This commit fixes an issue where the "pcie_ports=native" command-line
override was ignored when deciding whether to create a DPC service
device. This ensures both command-line overrides continue to work when
firmware retains AER control.

Cc: stable@vger.kernel.org

> diff --git a/drivers/pci/pcie/portdrv.c b/drivers/pci/pcie/portdrv.c
> index a9cbfc1d2bc75..a05ee7980fb27 100644
> --- a/drivers/pci/pcie/portdrv.c
> +++ b/drivers/pci/pcie/portdrv.c
> @@ -264,7 +264,7 @@ 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 || host->native_aer))
> +	    (pcie_ports_native || pcie_ports_dpc_native || host->native_aer))
>  		services |= PCIE_PORT_SERVICE_DPC;

[Severity: High]
This isn't a bug introduced by this patch, but pre-existed in the codebase.
Since this patch correctly restores the pcie_ports_native override here,
should we also fix other subsystems that incorrectly check host->native_*
flags directly without honoring the command-line overrides?

For example, in drivers/cxl/core/ras.c:devm_cxl_dport_rch_ras_setup(),
the code drops the override, which can lead to broken error reporting for
uncorrectable errors:

	host_bridge = to_pci_host_bridge(dport->dport_dev);
	if (!host_bridge->native_aer)
		return;

	cxl_dport_map_rch_aer(dport);

Similarly, in drivers/pci/pci-acpi.c:pci_acpi_program_hpx_type2(), it
fails to account for the command line override which should prevent
programming when the OS forces AER:

	/*
	 * Only do the _HPX Type 2 programming if OS owns PCIe native
	 * hotplug but not AER.
	 */
	if (!host->native_pcie_hotplug || host->native_aer)
		return;

Also, in drivers/pci/pcie/dpc.c:pci_dpc_recovered(), this check bypasses
the synchronization wait if it fails to recognize OS-forced DPC
ownership:

	host = pci_find_host_bridge(pdev->bus);
	if (!host->native_dpc && !IS_ENABLED(CONFIG_PCIE_EDR))
		return false;

Because pci_dpc_recovered() prematurely returns false, the pciehp driver
will not ignore spurious Link Down/Up events during DPC. Does this cause
hotplug to incorrectly race with DPC recovery?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260901064554.2178688-1-kanie@linux.alibaba.com?part=1

  reply	other threads:[~2026-09-01  6:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-01  6:45 [PATCH] PCI/DPC: Honor "pcie_ports=native" when enabling DPC Guixin Liu
2026-09-01  6:57 ` sashiko-bot [this message]
2026-09-03 23:05 ` Bjorn Helgaas
2026-09-04  2:34   ` Guixin Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260901065711.7AEC91F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=kanie@linux.alibaba.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.