[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8d270603-4604-4c1c-b3a9-f596e2e8af6d@panix.com>
Date: Thu, 6 Mar 2025 08:56:44 -0800
From: Kenneth Crudup <kenny@...ix.com>
To: Lukas Wunner <lukas@...ner.de>,
Mika Westerberg <mika.westerberg@...ux.intel.com>, Me <kenny@...ix.com>
Cc: Bjorn Helgaas <helgaas@...nel.org>, ilpo.jarvinen@...ux.intel.com,
Bjorn Helgaas <bhelgaas@...gle.com>, Jian-Hong Pan <jhp@...lessos.org>,
linux-pci@...r.kernel.org, linux-kernel@...r.kernel.org,
Nikl??vs Ko??es??ikovs <pinkflames.linux@...il.com>,
Andreas Noever <andreas.noever@...il.com>,
Michael Jamet <michael.jamet@...el.com>,
Yehezkel Bernat <YehezkelShB@...il.com>, linux-usb@...r.kernel.org
Subject: Re: diagnosing resume failures after disconnected USB4 drives (Was:
Re: PCI/ASPM: Fix L1SS saving (linus/master commit 7507eb3e7bfac))
Is this a separate commit on top of master, or along with your previous fix?
-Kenny
On 3/6/25 08:45, Lukas Wunner wrote:
> On Tue, Mar 04, 2025 at 10:23:14AM +0200, Mika Westerberg wrote:
>> Unfortunately I still see the same hang. I double checked, with revert the
>> problem goes a way and with this patch I still see it.
>>
>> Steps:
>>
>> 1. Boot the system, nothing connected.
>> 2. Connect TBT 4 dock to the host.
>> 3. Connect TBT 3 NVMe to the TBT4 doc.
>> 4. Authorize both PCIe tunnels, verify devices are there.
>> 5. Enter s2idle.
>> 6. Unplug the TBT 4 dock from the host.
>> 7. Exit s2idle.
>
> Thanks for testing. Would you mind giving the below a spin?
>
> I've realized this can likely be solved in a much easier way:
>
> The ->resume_noirq callback is invoked while traversing down
> the hierarchy and the topmost slot which detects device replacement
> already marks everything below as disconnected. Hence any nested
> hotplug ports can just skip the replacement check because they're
> disconnected as well.
>
> -- >8 --
>
> diff --git a/drivers/pci/hotplug/pciehp_core.c b/drivers/pci/hotplug/pciehp_core.c
> index ff458e6..997841c 100644
> --- a/drivers/pci/hotplug/pciehp_core.c
> +++ b/drivers/pci/hotplug/pciehp_core.c
> @@ -286,9 +286,12 @@ static int pciehp_suspend(struct pcie_device *dev)
>
> static bool pciehp_device_replaced(struct controller *ctrl)
> {
> - struct pci_dev *pdev __free(pci_dev_put);
> + struct pci_dev *pdev __free(pci_dev_put) = NULL;
> u32 reg;
>
> + if (pci_dev_is_disconnected(ctrl->pcie->port))
> + return false;
> +
> pdev = pci_get_slot(ctrl->pcie->port->subordinate, PCI_DEVFN(0, 0));
> if (!pdev)
> return true;
>
--
Kenneth R. Crudup / Sr. SW Engineer, Scott County Consulting, Orange
County CA
Powered by blists - more mailing lists