[PATCH RFC DNM 10/15] thunderbolt: nhi: Resume a runtime suspended NHI for system suspend
From: Konrad Dybcio
Date: Tue Nov 24 2026 - 15:02:27 EST
The PCI core resumes a runtime suspended device in pci_pm_suspend()
before calling the driver's suspend callback, so nhi_suspend_noirq()
always finds the NHI active. Platform devices get no such treatment, so
these runtime suspended NHIs gets suspended a second time in the
noirq phase and resumed in nhi_resume_noirq(). nhi_complete() then still
sees it as runtime suspended and resumes it once more, which corrupts
the control channel (RX checksum mismatches, config space timeouts).
Resume the NHI at the beginning of nhi_suspend(), like the PCI core
does as a workaround.
Signed-off-by: Konrad Dybcio <konrad.dybcio@xxxxxxxxxxxxxxxx>
---
drivers/thunderbolt/nhi.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/thunderbolt/nhi.c b/drivers/thunderbolt/nhi.c
index e2578740d569a7ee1d5ab22e8effc153cb7d4632..56bc5748b6515b9d4799aa87ce0f72e1d673d634 100644
--- a/drivers/thunderbolt/nhi.c
+++ b/drivers/thunderbolt/nhi.c
@@ -1258,6 +1258,13 @@ static int nhi_suspend(struct device *dev)
{
struct tb *tb = dev_get_drvdata(dev);
+ /*
+ * The noirq callbacks expect the NHI to be active. The PCI core
+ * resumes a runtime suspended device before calling this, do the
+ * same for the NHIs that are not PCI devices.
+ */
+ pm_runtime_resume(dev);
+
return tb_domain_suspend(tb);
}
--
2.55.0