Linux PCI subsystem development
 help / color / mirror / Atom feed
From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
To: Lukas Wunner <lukas@wunner.de>,
	Bjorn Helgaas <helgaas@kernel.org>,
	linux-pci@vger.kernel.org
Cc: Smita Koralahalli <Smita.KoralahalliChannabasappa@amd.com>,
	Yazen Ghannam <yazen.ghannam@amd.com>,
	Keith Busch <kbusch@kernel.org>,
	Maciej Grochowski <Maciej.Grochowski@sony.com>,
	Sizhe Liu <liusizhe5@huawei.com>,
	Yicong Yang <yangyicong@hisilicon.com>,
	Sourabh Jain <sourabhjain@linux.ibm.com>,
	Oliver OHalloran <oohall@gmail.com>,
	linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH] PCI/DPC: Document spec update on Surprise Down errors
Date: Wed, 2 Dec 2026 08:19:04 -0800	[thread overview]
Message-ID: <dd2d5f0d-5a18-4077-bd18-669dfec5815c@linux.intel.com> (raw)
In-Reply-To: <b52d25c02c4268d2f832b74c1abbcb20a01691f3.1796212287.git.lukas@wunner.de>



On 12/2/26 04:04, Lukas Wunner wrote:
> When PCIe r1.1 introduced hotplug support in 2005, sec 3.2.1 was amended
> to state that a transition from DL_Active to DL_Inactive must not cause a
> Surprise Down error on hotplug ports capable of surprise removal.
> 
> But when PCIe r3.1 introduced DPC support in 2014, sec 6.7.6 was added
> which states that:
> 
>    "Async removal may result in a transition from DL_Active to DL_Down in
>     the Downstream Port. This transition may result in a Surprise Down
>     error."
> 
> I raised this contradiction with our representative at the PCISIG Protocol
> Working Group.  He noted that DL_Down is likewise nonsensical because it
> is a Status Output, not a State (sec 3.2).  The PWG recently approved the
> following new language for sec 6.7.6 as erratum B157, which will appear in
> the next revision, either r7.1.1 or r7.2:
> 
>    "Async removal may result in a transition from DL_Active to DL_Inactive
>     in the Downstream Port.  Error handling for this transition is defined
>     in Section 3.2.1."
> 
> Commit 2ae8fbbe1cd4 ("PCI/DPC: Ignore Surprise Down error on hot removal")
> changed the DPC driver to handle Surprise Down errors per the old language
> in sec 6.7.6.  This was needed for AMD Epyc systems.  No Intel system is
> affected.
> 
> Document the spec update in the code comment introduced by the commit to
> make it clear that the old spec language should not be followed by new
> hardware implementations.
> 
> The functionality introduced by the commit might still be useful beyond
> systems which adhere to the legacy behavior of sec 6.7.6:  Sec 3.2.1 does
> allow Surprise Down errors on non-surprise-capable hotplug ports.  pciehp
> binds to such ports and handles removal on Surprise Down.  It makes sense
> for the DPC driver not to interfere with pciehp in such cases.
> 
> Fixes: 2ae8fbbe1cd4 ("PCI/DPC: Ignore Surprise Down error on hot removal")
> Signed-off-by: Lukas Wunner <lukas@wunner.de>
> Cc: stable@vger.kernel.org # v6.9+
> ---

Reviewed-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>


>  drivers/pci/pcie/dpc.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/pci/pcie/dpc.c b/drivers/pci/pcie/dpc.c
> index e030811..5538dde 100644
> --- a/drivers/pci/pcie/dpc.c
> +++ b/drivers/pci/pcie/dpc.c
> @@ -374,8 +374,10 @@ static irqreturn_t dpc_handler(int irq, void *context)
>  	struct pci_dev *pdev = context;
>  
>  	/*
> -	 * According to PCIe r6.0 sec 6.7.6, errors are an expected side effect
> -	 * of async removal and should be ignored by software.
> +	 * From PCIe r3.1 to r7.1, sec 6.7.6 allowed Surprise Down errors as
> +	 * a side effect of async removal which should be ignored by software.
> +	 * Newer revisions point to sec 3.2.1 instead, whereby Surprise Down
> +	 * errors are blocked on hotplug ports capable of surprise removal.
>  	 */
>  	if (dpc_is_surprise_removal(pdev)) {
>  		dpc_handle_surprise_removal(pdev);

-- 
Sathyanarayanan Kuppuswamy
Linux Kernel Developer


      parent reply	other threads:[~2026-12-02 16:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-02 12:04 [PATCH] PCI/DPC: Document spec update on Surprise Down errors Lukas Wunner
2026-12-02 12:06 ` sashiko-bot
2026-12-02 16:19 ` Kuppuswamy Sathyanarayanan [this message]

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=dd2d5f0d-5a18-4077-bd18-669dfec5815c@linux.intel.com \
    --to=sathyanarayanan.kuppuswamy@linux.intel.com \
    --cc=Maciej.Grochowski@sony.com \
    --cc=Smita.KoralahalliChannabasappa@amd.com \
    --cc=helgaas@kernel.org \
    --cc=kbusch@kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=liusizhe5@huawei.com \
    --cc=lukas@wunner.de \
    --cc=oohall@gmail.com \
    --cc=sourabhjain@linux.ibm.com \
    --cc=yangyicong@hisilicon.com \
    --cc=yazen.ghannam@amd.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox