From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=198.175.65.11 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796051099; b=orDpOvfmnUflT4LG5knFN1gFBOhUqs4PH1K2xJ4qPYxPpSWm0/ohkHKFj1oVx4CaQ/VX zJEyIFLKUw8gsDDhxTTm1h+epxxB2SntXw4bZXxBSSYGxiBk5/6aYxsfMCnJ80szCj6sg XkR3LLt+aRjmwIG6uCR1zWHTuRQjZcB3RLJk17Wn3sNuXsAAPfvT7DZgwR9R2JpWMk7d0 unNw6yulhq79eXl9LBq2RJ2znhEC6xP19Mu4JZ2XjJT8H/LTH4NrL0qFsb0pCy9g3XvDH UYVM/Z5kduCh7dcG4Dtzxfl30q1RdxfmQcsfsTOTMnDLn7TzlYndjfQCwyD629HCBuQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796051099; 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=5btIWBTr9ExMBYvSV0W3GLXf4eZwTHZHXuI/GoeyD0Q=; b=5ewl4fSfjo2S+eUgTMjzH2jufVKkhi9kipCOlkJuAO2Ybwpbqs7mhrL7K8noj3+4M9JQ DBB3qp0Vrts4HT54yJ/HE5KwZbsKpr9o3KJX3UiJ4ifsanO6R8F52G3bu9evr2Y7lfg3F RSst5zR9nCNOIbREKEYAr3PrVaU7TZaYAa+pzkUsKlLAnxUdjgSNmOKh1N3P719jOU/kb krhcHKAK3CVReMk7VknYWVGw7fUV3YQPup58IsojmGKt43eYrMEVpZaTC10UmQ2Mi/1PC NwYxe6AO8jaEvzvozZIjjqjdihJAM/+zCEd7D250z2JuYyninFii6jiQePzJIki0BkQ== 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=EnepDxuz; arc=none smtp.remote-ip=198.175.65.11 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.11]) (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 748A4606A31C for ; Mon, 30 Nov 2026 15:04:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 748A4606A31C 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=EnepDxuz DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1796051098; x=1827587098; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=5btIWBTr9ExMBYvSV0W3GLXf4eZwTHZHXuI/GoeyD0Q=; b=EnepDxuz+kUPFK+rIemV3c2CjOfg/0fECMQqKcxMObAzUxW7TgqLkquG SzAdvA7lAyTNOuj7DojHGMtxs8gOqo2815fzkBiFstzYABd/G+f9U/dx/ gfL+P52jneFTjPd8LfHieXceTi/F+hnD3/QaazpvI+WBguA+xbe+HlGTI 0JGWPWr/maOSZztcW15e33OnlIWB/NcDeBHeY8rVY3Uxxokk1w+5zk+HC LPueR6elOIHSm0TkQ656YWTTTwfKaKe6W4UJXLJTgMuDir5h2NBi8mMDc gez1vHA8PKnZcQNBxXvUEvLK7GxrH4wFdCI7TE6hEUinDWPdeYmvQa2V3 Q==; X-CSE-ConnectionGUID: 7FDvNtCWQ1qdIv/KSQev9Q== X-CSE-MsgGUID: B0xSXWdGR7e4vlUPD7oidw== X-IronPort-AV: E=McAfee;i="6800,10657,11982"; a="4773496" X-IronPort-AV: E=Sophos;i="6.27,242,1787036400"; d="scan'208";a="4773496" Received: from fmviesa004.fm.intel.com ([10.60.135.144]) by orvoesa103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Nov 2026 07:04:57 -0800 X-CSE-ConnectionGUID: 40cRnZX0RHGfD+Wg0avt6A== X-CSE-MsgGUID: DVHioyK7QV+BKdn9fAfYSw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.27,242,1787036400"; d="scan'208";a="12949050" 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; 30 Nov 2026 07:04:58 -0800 Message-ID: Date: Mon, 30 Nov 2026 07:04:57 -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/AER: Check error status registers if Error Source ID is zero To: Lukas Wunner , Bjorn Helgaas , linux-pci@vger.kernel.org Cc: Sourabh Jain , Oliver OHalloran , linuxppc-dev@lists.ozlabs.org, Keith Busch , Maciej Grochowski , Yazen Ghannam References: <1ddc35c51b5317988bbf235c467a9534218c6ea4.1795717157.git.lukas@wunner.de> Content-Language: en-US From: Kuppuswamy Sathyanarayanan In-Reply-To: <1ddc35c51b5317988bbf235c467a9534218c6ea4.1795717157.git.lukas@wunner.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Hi, On 11/26/26 10:35, Lukas Wunner wrote: > Since commit 6d69eeae8966 ("PCI/AER: Check validity of Error Source ID > register"), the AER driver checks whether the Error Source ID register > contains either the ID of the Root Port (or RCEC) itself, or of a device > subordinate to the Root Port (or associated with the RCEC). > > If this check succeeds, the Error Source ID register is assumed to contain > a valid value and is not double-checked by reading error status registers. > > 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. > > On ARM platforms, there is often a Root Port at address 0000:00:00.0, > which makes it impossible to discern whether a zero Error Source ID refers > to the Root Port or to an uninitialized device downstream. > > For this reason, always double-check error status registers if the Error > Source ID is zero. > > Fixes: 6d69eeae8966 ("PCI/AER: Check validity of Error Source ID register") > Signed-off-by: Lukas Wunner > --- Reviewed-by: Kuppuswamy Sathyanarayanan > base-commit: 6d69eeae8966bc3bea0facbd550f45ef9de41cc4 > > This fixes a commit queued on pci/aer. It can either be folded into > that commit or applied on top of pci/aer, whichever is preferred. > > drivers/pci/pcie/aer.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/drivers/pci/pcie/aer.c b/drivers/pci/pcie/aer.c > index 1973b6e..24b014b 100644 > --- a/drivers/pci/pcie/aer.c > +++ b/drivers/pci/pcie/aer.c > @@ -1158,6 +1158,10 @@ static int add_error_device(struct aer_err_info *e_info, struct pci_dev *dev) > > 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; > + > /* The Root Port or RCEC can itself be a valid Error Source */ > if (pci_dev_id(root) == id) > return true; > @@ -1186,7 +1190,7 @@ static bool is_error_source(struct pci_dev *dev, struct aer_err_info *e_info) > u16 reg16; > > /* 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)) -- Sathyanarayanan Kuppuswamy Linux Kernel Developer