From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=144.76.133.104 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796058551; b=Ylou0vlv5bSOZizrdU180yaCi8ktTbd4eCsObo8BgxuzGTzBh7+YaEwccYnNZfYLbZQA hHx66U6HMuG/C6GuQWnCzKllF8ijxN8QMZvw6v9e/RsHVXJOwCqvKV4+C8DZRxeAEhkf7 1kz+OzpLlU2O+WH/8v4yU/7QBGT0u+PYUK+y0R+RpsdMZ/Jg9jCY0GnnJWlotE16DoIM4 88x6mI6sztXLX/2cs5pZXOWOMU/08mJOgGZE7bPQJ1SgY2UhystQvJAR0EY5nCRLUut3f 4IkO92tmFUBCfrL+miKP+iIHeQY4EPUPS3n7nwRPEZDzZaUpNeQ6demexiGFqjSr6eg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796058551; h=DMARC-Filter:Received:Received:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=FUwehRL3MLVerZsUroOiyXfcVSGvOMO0vf26kLyloug=; b=NbhwvHHRkM6RhGZ2hqbf4X+rVeFcnvUE6DozjTlzn3krmd6kwHukw12wKChTmhMNfvYu pxO1OJPEVEwNF7gVg1U9mFlp3A49c3zduFErdcaRQ/HJ1cL+V2rCNvlFM1kJGm3aAWQ7O ExC7M2P3TTpa30ZbjWwMoxtod2BANDpvJJTO/JARzyErilvXcxSRi//9DN/lBjbasp8TC krJMAzcstdFx8awmOYQzlo3AZ58wypuv24xI8uN+pvN9Mfv0NQOmSVQaGQc5btyny6LLW JQjHkybRkdr25ZI5GgzihMfcWpMQp/y78Lryi766xpvblXkkn2qS1OLYsGKt/QUzQSw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none header.from=wunner.de; spf=pass smtp.mailfrom=wunner.de; arc=none smtp.remote-ip=144.76.133.104 Received: from mailout3.hostsharing.net (mailout3.hostsharing.net [144.76.133.104]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 47E2B606A31C for ; Mon, 30 Nov 2026 17:09:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 47E2B606A31C Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=wunner.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wunner.de Received: from h08.hostsharing.net (h08.hostsharing.net [IPv6:2a01:37:1000::53df:5f1c:0]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384 client-signature ECDSA (secp384r1) client-digest SHA384) (Client CN "*.hostsharing.net", Issuer "GlobalSign GCC R6 AlphaSSL CA 2025" (verified OK)) by mailout3.hostsharing.net (Postfix) with ESMTPS id CA85AC98; Mon, 30 Nov 2026 18:09:00 +0100 (CET) Received: by h08.hostsharing.net (Postfix, from userid 100393) id 932F36024EDC; Mon, 30 Nov 2026 18:09:00 +0100 (CET) Date: Mon, 30 Nov 2026 18:09:00 +0100 From: Lukas Wunner To: Yazen Ghannam Cc: Bjorn Helgaas , linux-pci@vger.kernel.org, Sourabh Jain , Oliver OHalloran , linuxppc-dev@lists.ozlabs.org, Sathyanarayanan Kuppuswamy , Keith Busch , Maciej Grochowski Subject: Re: [PATCH] PCI/AER: Check error status registers if Error Source ID is zero Message-ID: References: <1ddc35c51b5317988bbf235c467a9534218c6ea4.1795717157.git.lukas@wunner.de> <20261130161857.GA14048@yaz-khff2.amd.com> 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 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20261130161857.GA14048@yaz-khff2.amd.com> On Mon, Nov 30, 2026 at 11:18:57AM -0500, Yazen Ghannam wrote: > On Thu, Nov 26, 2026 at 07:35:00PM +0100, Lukas Wunner wrote: > > However per PCIe r7.1 sec 2.2.9.1, devices may send Completions with a > > zero Completer ID "prior to the initial device Configuration Write > > Request". Similarly, CXL r4.0 sec 8.1.5.1 states that a Component may > > generate a CREDIT_RTN IP2PM message with a zero bus number after reset, > > which can fail ACS Source Validation and trigger an ACS Violation Error. > > The Error Source ID records the "Requester ID" of a device. So how does > the "Completer ID" behavior relate here? > > Can a device send ERR_* messages before it is initialized? As an example, at any point in time can an Endpoint raise a Receiver Error due to signaling issues at the physical layer. That could occur prior to the Endpoint receiving its initial device Configuration Write Request from which it learns its bus, device and function number. So yes I do believe that an error message could be generated with a zero Requester ID. The reason for referencing sec 2.2.9.1 is to make it clear that the device learns its BDF from the first Config Write Request and prior to that, the device uses zero as its ID. I'm wondering if we should perform a single Config Write (e.g. to the Vendor ID register) immediately after issuing a SBR, FLR or coming out of D3hot/D3cold, to ensure the device gets its ID as early as possible. However that would only shrink, not eliminate the time window within which the device uses a zero ID. So we have to cope with a zero ID regardless. > > static bool source_id_valid(struct pci_dev *root, u16 id) > > { > > + /* ID is zero prior to initial device config (PCIe r7.1 sec 2.2.9.1) */ > > + if (id == 0) > > + return true; > > + > > > > What is this hunk supposed to catch? Without this, if the Root Port is not located at 00:00.0, users would see a gratuitous " (invalid source)" message in dmesg for a zero Error Source ID. That message would not be correct because zero *is* a valid Error Source ID if the device is uninitialized. (The message was introduced by 6d69eeae8966, which is queued on pci/aer and which is fixed by this patch.) > > > > /* The Root Port or RCEC can itself be a valid Error Source */ > > if (pci_dev_id(root) == id) > > return true; > > The ARM "RP 0:0.0" case would already be covered by this. ^^^ Right. > > /* Some Root Ports report an invalid Error Source ID */ > > - if (e_info->id_valid && > > + if (e_info->id && e_info->id_valid && > > !(dev->bus->bus_flags & PCI_BUS_FLAGS_NO_AERSID)) { > > /* Device ID match? */ > > if (e_info->id == pci_dev_id(dev)) > > -- > > So adding the "e_info->id" check is to let the ARM "RP 0:0.0" case fall > through and be double-checked, right? Yes. Thanks for taking a look! Lukas