From: Lukas Wunner <lukas@wunner.de>
To: "Chia-Lin Kao (AceLan)" <acelan.kao@canonical.com>
Cc: "Bjorn Helgaas" <bhelgaas@google.com>,
"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] PCI: pciehp: Fix system hang on resume after hot-unplug during suspend
Date: Thu, 26 Sep 2024 15:23:24 +0200 [thread overview]
Message-ID: <ZvVgTGVSco0Kg7H5@wunner.de> (raw)
In-Reply-To: <20240926125909.2362244-1-acelan.kao@canonical.com>
On Thu, Sep 26, 2024 at 08:59:09PM +0800, Chia-Lin Kao (AceLan) wrote:
> Remove unnecessary pci_walk_bus() call in pciehp_resume_noirq(). This
> fixes a system hang that occurs when resuming after a Thunderbolt dock
> with attached thunderbolt storage is unplugged during system suspend.
>
> The PCI core already handles setting the disconnected state for devices
> under a port during suspend/resume.
Please explain in the commit message where the PCI core does that.
> The redundant bus walk was
> interfering with proper hardware state detection during resume, causing
> a system hang when hot-unplugging daisy-chained Thunderbolt devices.
Please explain what "proper hardware state detection" means.
Did you get a hung task stacktrace? If so, please include it in the
commit message.
If you're getting a system hang, it means there's a deadlock
involving pci_bus_sem. I don't quite see how that could happen,
so a more verbose explanation would be appreciated.
Thanks,
Lukas
> Fixes: 9d573d19547b ("PCI: pciehp: Detect device replacement during system sleep")
> Signed-off-by: Chia-Lin Kao (AceLan) <acelan.kao@canonical.com>
> ---
> drivers/pci/hotplug/pciehp_core.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/drivers/pci/hotplug/pciehp_core.c b/drivers/pci/hotplug/pciehp_core.c
> index ff458e692fed..c1c3f7e2bc43 100644
> --- a/drivers/pci/hotplug/pciehp_core.c
> +++ b/drivers/pci/hotplug/pciehp_core.c
> @@ -330,8 +330,6 @@ static int pciehp_resume_noirq(struct pcie_device *dev)
> */
> if (pciehp_device_replaced(ctrl)) {
> ctrl_dbg(ctrl, "device replaced during system sleep\n");
> - pci_walk_bus(ctrl->pcie->port->subordinate,
> - pci_dev_set_disconnected, NULL);
> pciehp_request(ctrl, PCI_EXP_SLTSTA_PDC);
> }
> }
> --
> 2.43.0
next prev parent reply other threads:[~2024-09-26 13:29 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-26 12:59 [PATCH] PCI: pciehp: Fix system hang on resume after hot-unplug during suspend Chia-Lin Kao (AceLan)
2024-09-26 13:23 ` Lukas Wunner [this message]
2024-09-27 7:33 ` AceLan Kao
2024-09-27 9:28 ` Lukas Wunner
2024-09-28 12:51 ` Lukas Wunner
2024-09-30 1:31 ` AceLan Kao
2024-10-01 11:02 ` Lukas Wunner
2024-10-01 11:03 ` Lukas Wunner
2024-10-07 4:34 ` AceLan Kao
2024-10-17 2:40 ` AceLan Kao
2024-10-22 13:05 ` AceLan Kao
2024-10-23 4:23 ` Ethan Zhao
2024-09-30 3:27 ` AceLan Kao
2024-10-01 11:07 ` Lukas Wunner
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=ZvVgTGVSco0Kg7H5@wunner.de \
--to=lukas@wunner.de \
--cc=acelan.kao@canonical.com \
--cc=bhelgaas@google.com \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).