From: Mika Westerberg <mika.westerberg@linux.intel.com>
To: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Cc: Vinod Koul <vkoul@kernel.org>,
Neil Armstrong <neil.armstrong@linaro.org>,
Manivannan Sadhasivam <mani@kernel.org>,
Bjorn Andersson <andersson@kernel.org>,
Konrad Dybcio <konradybcio@kernel.org>,
Abel Vesa <abelvesa@kernel.org>, Stephen Boyd <sboyd@kernel.org>,
Brian Masney <bmasney+clk@redhat.com>,
Jerome Brunet <jbrunet+clk@baylibre.com>,
Andreas Noever <andreas.noever@gmail.com>,
Mika Westerberg <westeri@kernel.org>,
Yehezkel Bernat <YehezkelShB@gmail.com>,
Mario Limonciello <mario.limonciello@amd.com>,
Philipp Zabel <p.zabel@pengutronix.de>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org,
linux-clk@vger.kernel.org, linux-usb@vger.kernel.org,
linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
usb4-upstream@oss.qualcomm.com
Subject: Re: [PATCH RFC DNM 10/15] thunderbolt: nhi: Resume a runtime suspended NHI for system suspend
Date: Tue, 1 Dec 2026 08:49:02 +0100 [thread overview]
Message-ID: <20261201074902.GU953667@black.igk.intel.com> (raw)
In-Reply-To: <20261124-topic-next-20261116-fsm-mvp-v1-10-a9b45c69cd38@oss.qualcomm.com>
Hi,
On Tue, Nov 24, 2026 at 09:01:39PM +0100, Konrad Dybcio wrote:
> 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.
Okay but I would rather keep it suspended over the system sleep. There
is no difference from USB4 perspective so there is really no point waking
it up. IIRC we do that now because USB stack needs to re-configure wakes
for S3 but for s2idle (which is what the modern Intel systems at least do)
that should not be necessary - it should wake the same way as runtime
suspended.
> Signed-off-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
> ---
> 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
next prev parent reply other threads:[~2026-12-01 7:49 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-24 20:01 [RFC DNM PATCH 00/15] Qualcomm USB4 host router Konrad Dybcio
2026-11-24 20:01 ` [PATCH RFC DNM 01/15] phy: qualcomm: qmp-combo: Add Glymur USB4v1 PHY sequences Konrad Dybcio
2026-11-24 20:01 ` [PATCH RFC DNM 02/15] phy: qualcomm: qmp-combo: Add USB4 power_on/off to de/assert USB4 clamps Konrad Dybcio
2026-11-24 20:01 ` [PATCH RFC DNM 03/15] soc: qcom: smem: Add and export qcom_smem_get_serial_no() Konrad Dybcio
2026-11-24 20:01 ` [PATCH RFC DNM 04/15] soc: qcom: pmic_glink_altmode: Enable TBT/USB4 negotiation Konrad Dybcio
2026-11-24 20:01 ` [PATCH RFC DNM 05/15] clk: qcom: gcc-glymur: Don't poll the status bit of some USB4 clocks Konrad Dybcio
2026-11-24 20:01 ` [PATCH RFC DNM 06/15] thunderbolt: nhi: Clear ring interrupts when not using MSI-X Konrad Dybcio
2026-12-01 7:16 ` Mika Westerberg
2026-11-24 20:01 ` [PATCH RFC DNM 07/15] thunderbolt: nhi: Process ring completions in the threaded IRQ Konrad Dybcio
2026-12-01 7:33 ` Mika Westerberg
2026-11-24 20:01 ` [PATCH RFC DNM 08/15] thunderbolt: nhi: Add pre_switch_suspend hook Konrad Dybcio
2026-12-01 7:41 ` Mika Westerberg
2026-11-24 20:01 ` [PATCH RFC DNM 09/15] thunderbolt: nhi: Resume the domain if the NHI suspend op fails Konrad Dybcio
2026-12-01 7:44 ` Mika Westerberg
2026-11-24 20:01 ` [PATCH RFC DNM 10/15] thunderbolt: nhi: Resume a runtime suspended NHI for system suspend Konrad Dybcio
2026-12-01 7:49 ` Mika Westerberg [this message]
2026-11-24 20:01 ` [PATCH RFC DNM 11/15] thunderbolt: Raise TB_TIMEOUT to 500 ms Konrad Dybcio
2026-11-24 20:01 ` [PATCH HACK RFC DNM 12/15] thunderbolt: Refuse to activate DP/USB3/PCIe tunnels Konrad Dybcio
2026-11-24 20:01 ` [PATCH RFC DNM 13/15] thunderbolt: Introduce Qualcomm USB4 router driver Konrad Dybcio
2026-11-28 13:54 ` Troels Vognbjerg
2026-12-01 8:36 ` Mika Westerberg
2026-11-24 20:01 ` [PATCH RFC DNM 14/15] arm64: dts: qcom: glymur: Add USB4 topology Konrad Dybcio
2026-11-24 20:01 ` [PATCH RFC DNM 15/15] arm64: dts: qcom: glymur-crd: Enable the tertiary Type-C Konrad Dybcio
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=20261201074902.GU953667@black.igk.intel.com \
--to=mika.westerberg@linux.intel.com \
--cc=YehezkelShB@gmail.com \
--cc=abelvesa@kernel.org \
--cc=andersson@kernel.org \
--cc=andreas.noever@gmail.com \
--cc=bmasney+clk@redhat.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=jbrunet+clk@baylibre.com \
--cc=konrad.dybcio@oss.qualcomm.com \
--cc=konradybcio@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-phy@lists.infradead.org \
--cc=linux-usb@vger.kernel.org \
--cc=mani@kernel.org \
--cc=mario.limonciello@amd.com \
--cc=neil.armstrong@linaro.org \
--cc=p.zabel@pengutronix.de \
--cc=robh@kernel.org \
--cc=sboyd@kernel.org \
--cc=usb4-upstream@oss.qualcomm.com \
--cc=vkoul@kernel.org \
--cc=westeri@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
all inboxes | Powered by JetHome®