All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lukas Wunner <lukas@wunner.de>
To: Darshit Shah <darnshah@amazon.de>
Cc: "Bjorn Helgaas" <bhelgaas@google.com>,
	"Krzysztof Wilczyński" <kwilczynski@kernel.org>,
	"Kuppuswamy Sathyanarayanan"
	<sathyanarayanan.kuppuswamy@linux.intel.com>,
	"Jonathan Cameron" <Jonthan.Cameron@huawei.com>,
	darnir@gnu.org, "Feng Tang" <feng.tang@linux.alibaba.com>,
	linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
	nh-open-source@amazon.com
Subject: Re: [PATCH] drivers/pci: Allow attaching AER to non-RP devices that support MSI
Date: Fri, 28 Nov 2025 18:07:21 +0100	[thread overview]
Message-ID: <aSnWyePbCKPvjpKq@wunner.de> (raw)
In-Reply-To: <20251128122053.35909-1-darnshah@amazon.de>

On Fri, Nov 28, 2025 at 12:20:53PM +0000, Darshit Shah wrote:
> Previously portdrv tried to prevent non-Root Port (RP) and non-Root
> Complex Event Collector (RCEC) devices from enabling AER capability.
> This was done because some switches enable AER but do not support MSI.

The AER driver only binds to RPs and RCECs, see aer_probe():

	if ((pci_pcie_type(port) != PCI_EXP_TYPE_RC_EC) &&
	    (pci_pcie_type(port) != PCI_EXP_TYPE_ROOT_PORT))
		return -ENODEV;

So there's no point in adding PCIE_PORT_SERVICE_AER to "services"
for other port types (as your patch does).

> However, it is possible to have switches upstream of an endpoint that
> support MSI and AER. Without AER capability being enabled on such
> a switch, portdrv will refuse to enable the DPC capability as well,
> preventing a PCIe error on an endpoint from being handled by the switch.

I assume you're referring to this clause in get_port_device_capability():

	if (pci_find_ext_capability(dev, PCI_EXT_CAP_ID_DPC) &&
	    pci_aer_available() &&
	    (pcie_ports_dpc_native || (services & PCIE_PORT_SERVICE_AER)))
		services |= PCIE_PORT_SERVICE_DPC;

Presumably on your system, BIOS doesn't grant AER handling to the OS
upon _OSC negotiation?  Is there a BIOS knob to change that?
Alternatively, does passing "pcie_ports=dpc-native" fix the issue?
If it does, why do you need the patch instead of using the command line
option?

> Allow enabling the AER service on non-RP, non-RCEC devices if they still
> support both AER and MSI. This allows switches upstream of an endpoint
> to generate and handle DPC events.

Per PCIe r7.0 sec 7.8.4.9, regarding the Root Error Command Register:

   "For Functions other than Root Ports and Root Complex Event Collectors:
   when End-End TLP Prefix Supported is Set or Flit Mode Supported is Set,
   this register is RsvdP, otherwise [...] this register is not required
   to be implemented."

Hence we can't enable AER handling on anything else than RPs and RCECs.

Thanks,

Lukas

  reply	other threads:[~2025-11-28 17:07 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-28 12:20 [PATCH] drivers/pci: Allow attaching AER to non-RP devices that support MSI Darshit Shah
2025-11-28 17:07 ` Lukas Wunner [this message]
2025-12-08 11:25   ` [PATCH v2 0/1] " Darshit Shah
2025-12-08 11:25     ` [PATCH v2 1/1] drivers/pci: Decouple DPC from AER service Darshit Shah
2025-12-09  7:45       ` Lukas Wunner
2025-12-11 16:42         ` [PATCH v3] " Darshit Shah
2026-02-28 23:59           ` Darshit Shah
2025-12-09 15:29       ` [PATCH v2 1/1] " Sathyanarayanan Kuppuswamy
2025-12-09  0:30 ` [PATCH] drivers/pci: Allow attaching AER to non-RP devices that support MSI 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=aSnWyePbCKPvjpKq@wunner.de \
    --to=lukas@wunner.de \
    --cc=Jonthan.Cameron@huawei.com \
    --cc=bhelgaas@google.com \
    --cc=darnir@gnu.org \
    --cc=darnshah@amazon.de \
    --cc=feng.tang@linux.alibaba.com \
    --cc=kwilczynski@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=nh-open-source@amazon.com \
    --cc=sathyanarayanan.kuppuswamy@linux.intel.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.