From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 991342EE96F for ; Wed, 18 Jun 2025 15:13:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750259590; cv=none; b=X+i1n0Gz3D4KUf9NNglITrZUo8BYx+f1ELNl/2e58guiwbbqDmqQ+/GZa+8n7Gw3tncNLh167VIECPuNeg1+Jlspj7rP887EPchpOIeFaEDjJ5joiHDetQPpT+kVZKAu3F09HOA21AQSQkZD4Nru4kVxhN+KNjWY4dRjMbUaArI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750259590; c=relaxed/simple; bh=RxyUMiuudcd2zaA9C02HdB4e4SfRw0dOFH1tKyo03Xs=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; b=AC1wRMaabs5EJx97dnYBHtHn4JKlWG8aF+lSWJBuGIOYoYzkNoQTLUJbzZgRmtqVapBMTeoXh3agm4ZCYpN9Z/cUVFmuch4F1m1+Hd+CG/Rr4gNQpUpl469kGqppUsVKTwdg+/+8WI8ZScv/ugV8pTAWpLXvhTL0xNGO7MltjgY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=iCTBLbZU; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="iCTBLbZU" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 04930C4CEE7; Wed, 18 Jun 2025 15:13:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1750259589; bh=RxyUMiuudcd2zaA9C02HdB4e4SfRw0dOFH1tKyo03Xs=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=iCTBLbZU36w1Zp3/rnRzCErxrw/EdeiCJDh5MZ0zfFPsikPoe1GXRq9CZ8XC0HvjI nmSem/3/YMOxILryJTK84Wndu2JvYr0OlUQI28L87Zc9+WfM76QWaKB0Hw0Wn2VOd0 jZqOfzou9PBHPQoriWY00jOx0QdWAzSg5yiwGx3L3rruxh+Vbf8WOwlvsSPEZ/stRi mwBDLK1cehod3Y22/GR0LD5vTg1vhVFQr5m7hlG1+7tsrwKo4tOG2wETEGtqMvYGWT RXZQwx51RExTQwdAEVEO0fU3e9DSBM9Xt5IwkLy1T7KSXQLvReFvyt8YDOyYnPaa2K bJm2N06dt8m5A== Date: Wed, 18 Jun 2025 10:13:07 -0500 From: Bjorn Helgaas To: Lukas Wunner Cc: Keith Busch , Ilpo Jarvinen , Joel Mathew Thomas , tcm4095@gmail.com, linux-pci@vger.kernel.org Subject: Re: [PATCH for-linus] PCI: pciehp: Ignore belated Presence Detect Changed caused by DPC Message-ID: <20250618151307.GA1203119@bhelgaas> Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Wed, Jun 18, 2025 at 04:38:25PM +0200, Lukas Wunner wrote: > Commit c3be50f7547c ("PCI: pciehp: Ignore Presence Detect Changed caused > by DPC") sought to ignore Presence Detect Changed events occurring as a > side effect of Downstream Port Containment. > > The commit awaits recovery from DPC and then clears events which occurred > in the meantime. However if the first event seen after DPC is Data Link > Layer State Changed, only that event is cleared and not Presence Detect > Changed. The object of the commit is thus defeated. > > That's because pciehp_ist() computes the events to clear based on the > local "events" variable instead of "ctrl->pending_events". The former > contains the events that had occurred when pciehp_ist() was entered, > whereas the latter also contains events that have accumulated while > awaiting DPC recovery. > > In practice, the order of PDC and DLLSC events is arbitrary and the delay > in-between can be several milliseconds. > > So change the logic to always clear PDC events, even if they come after an > initial DLLSC event. > > Fixes: c3be50f7547c ("PCI: pciehp: Ignore Presence Detect Changed caused by DPC") > Reported-by: Lương Việt Hoàng > Reported-by: Joel Mathew Thomas > Closes: https://bugzilla.kernel.org/show_bug.cgi?id=219765#c165 > Tested-by: Lương Việt Hoàng > Tested-by: Joel Mathew Thomas > Signed-off-by: Lukas Wunner Applied to pci/for-linus for v6.16, thanks, Lukas! > --- > drivers/pci/hotplug/pciehp_hpc.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c > index ebd342b..91d2d92 100644 > --- a/drivers/pci/hotplug/pciehp_hpc.c > +++ b/drivers/pci/hotplug/pciehp_hpc.c > @@ -771,7 +771,7 @@ static irqreturn_t pciehp_ist(int irq, void *dev_id) > u16 ignored_events = PCI_EXP_SLTSTA_DLLSC; > > if (!ctrl->inband_presence_disabled) > - ignored_events |= events & PCI_EXP_SLTSTA_PDC; > + ignored_events |= PCI_EXP_SLTSTA_PDC; > > events &= ~ignored_events; > pciehp_ignore_link_change(ctrl, pdev, irq, ignored_events); > -- > 2.47.2 >