All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Yury Murashka" <yurypm@arista.com>
Cc: linux-pci@vger.kernel.org
Subject: Re: [PATCH v2 2/2] PCI: Add pci=nodpc kernel boot option
Date: Thu, 09 Jul 2026 19:07:30 +0000	[thread overview]
Message-ID: <20260709190730.E19A11F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260709185429.627968-3-yurypm@arista.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] The `pci=nodpc` parameter disables native OS DPC but still claims DPC control via ACPI `_OSC` and enables it via `_DSM`, causing permanent unhandled link errors.
--

--- Patch [2]: [PATCH v2 2/2] PCI: Add pci=nodpc kernel boot option ---
commit 9eea006773bbca0de0b0f501e83971ad7b74166e
Author: Yury Murashka <yurypm@arista.com>

PCI: Add pci=nodpc kernel boot option

This patch introduces the pci=nodpc kernel boot option to disable PCI
Downstream Port Containment (DPC). When specified, DPC initialization,
state operations, and driver registration are bypassed, allowing userspace
to handle PCIe errors.

> diff --git a/drivers/pci/pcie/dpc.c b/drivers/pci/pcie/dpc.c
> index 2b779bd1d861b..759d9f18812ee 100644
> --- a/drivers/pci/pcie/dpc.c
> +++ b/drivers/pci/pcie/dpc.c
[ ... ]
> @@ -404,6 +411,9 @@ void pci_dpc_init(struct pci_dev *pdev)
>  {
>  	u16 cap;
>  
> +	if (pcie_dpc_disable)
> +		return;
> +

[Severity: High]
Does returning early here leave pdev->dpc_cap as 0 and cause issues with Error
Disconnect Recover (EDR)?

When pci=nodpc is set, calculate_control() in drivers/acpi/pci_root.c still
requests DPC control from firmware based solely on the compile-time flag:

drivers/acpi/pci_root.c:calculate_control() {
    ...
	if (IS_ENABLED(CONFIG_PCIE_DPC) && IS_ENABLED(CONFIG_PCIE_EDR))
		control |= OSC_PCI_EXPRESS_DPC_CONTROL;
    ...
}

And pci_acpi_add_edr_notifier() in drivers/pci/pcie/edr.c unconditionally
enables DPC in hardware:

drivers/pci/pcie/edr.c:pci_acpi_add_edr_notifier() {
    ...
	if (acpi_enable_dpc(pdev))
		acpi_remove_notify_handler(adev->handle, ACPI_SYSTEM_NOTIFY,
					   edr_handle_event);
    ...
}

If a PCIe error occurs and ACPI firmware notifies the OS, edr_handle_event()
will trigger but immediately abort because edev->dpc_cap is 0:

drivers/pci/pcie/edr.c:edr_handle_event() {
    ...
	if (!edev->dpc_cap) {
		pci_err(edev, FW_BUG "This device doesn't support DPC\n");
		goto send_ost;
	}
    ...
}

Will this cause EDR to abort recovery, incorrectly log a firmware bug, and
permanently abandon the link instead of letting userspace handle it?

>  	pdev->dpc_cap = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_DPC);
>  	if (!pdev->dpc_cap)
>  		return;

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260709185429.627968-1-yurypm@arista.com?part=2

  reply	other threads:[~2026-07-09 19:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-09 18:54 [PATCH v2 0/2] PCI: Add boot options to disable DPC and AER recovery Yury Murashka
2026-07-09 18:54 ` [PATCH v2 1/2] PCI: Add pci=noaer_recovery kernel boot option Yury Murashka
2026-07-09 19:06   ` sashiko-bot
2026-07-09 18:54 ` [PATCH v2 2/2] PCI: Add pci=nodpc " Yury Murashka
2026-07-09 19:07   ` sashiko-bot [this message]
2026-07-09 22:42 ` [PATCH v2 0/2] PCI: Add boot options to disable DPC and AER recovery Bjorn Helgaas

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=20260709190730.E19A11F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=yurypm@arista.com \
    /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.