public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mika Westerberg <mika.westerberg@linux.intel.com>
To: Jiayi Li <lijiayi@kylinos.cn>
Cc: westeri@kernel.org, andreas.noever@gmail.com,
	michael.jamet@intel.com, YehezkelShB@gmail.com,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	jiayi_dec@163.com
Subject: Re: [PATCH RFC] thunderbolt: Re-add DP resources on resume
Date: Wed, 17 Sep 2025 10:36:43 +0200	[thread overview]
Message-ID: <20250917083643.GG2912318@black.igk.intel.com> (raw)
In-Reply-To: <20250917082456.1790252-1-lijiayi@kylinos.cn>

Hi,

On Wed, Sep 17, 2025 at 04:24:56PM +0800, Jiayi Li wrote:
> During suspend, DP resources are released through tb_disconnect_and_release_dp()
> but were not being re-added during resume, preventing DP tunnels from being
> re-established.
> 
> This caused DP displays connected via Thunderbolt docks (such as Targus docks)
> to not display after S3 resume. The issue was visible in logs:
> 
> [246.397437] tb_cfg_ack_plug:819: thunderbolt 0000:2c:00.0: acking hot plug event on 3:10

It should add the resource back when it gets hotplug event like above.

You should see hotplug happening to the DP IN adapters when the host
router comes out of sleep. Can you share the full dmesg with
thunderbolt.dyndbg=+p in the command line?

> [246.398282] tb_dp_resource_available:2019: thunderbolt 0000:2c:00.0: 3:10: DP OUT resource available
> [246.398291] tb_tunnel_dp:1875: thunderbolt 0000:2c:00.0: looking for DP IN <-> DP OUT pairs:
> [246.398294] tb_tunnel_dp:1899: thunderbolt 0000:2c:00.0: no suitable DP IN adapter available, not tunneling
> 
> Add call to tb_add_dp_resources() in tb_resume_noirq() to ensure DP resources
> are properly re-added during resume, allowing DP tunnels to be re-established.
> 
> Signed-off-by: Jiayi Li <lijiayi@kylinos.cn>
> ---
>  drivers/thunderbolt/tb.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/thunderbolt/tb.c b/drivers/thunderbolt/tb.c
> index c14ab1fbeeaf..cb652df3fc9f 100644
> --- a/drivers/thunderbolt/tb.c
> +++ b/drivers/thunderbolt/tb.c
> @@ -3119,6 +3119,7 @@ static int tb_resume_noirq(struct tb *tb)
>  		tb_switch_reset(tb->root_switch);
>  
>  	tb_switch_resume(tb->root_switch, false);
> +	tb_add_dp_resources(tb->root_switch);
>  	tb_free_invalid_tunnels(tb);
>  	tb_free_unplugged_children(tb->root_switch);
>  	tb_restore_children(tb->root_switch);
> -- 
> 2.47.1

  reply	other threads:[~2025-09-17  8:36 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-17  8:24 [PATCH RFC] thunderbolt: Re-add DP resources on resume Jiayi Li
2025-09-17  8:36 ` Mika Westerberg [this message]
2025-09-17 10:12 ` 李佳怡
2025-09-17 12:50   ` Mika Westerberg
2025-09-18  8:34     ` 李佳怡
2025-09-18 16:20       ` Mika Westerberg
2025-09-18 16:43         ` Mika Westerberg
2025-09-19  7:24           ` 李佳怡
2025-09-19  7:30             ` Mika Westerberg
2025-09-19  8:00               ` 李佳怡
2025-09-19  8:41                 ` Mika Westerberg

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=20250917083643.GG2912318@black.igk.intel.com \
    --to=mika.westerberg@linux.intel.com \
    --cc=YehezkelShB@gmail.com \
    --cc=andreas.noever@gmail.com \
    --cc=jiayi_dec@163.com \
    --cc=lijiayi@kylinos.cn \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=michael.jamet@intel.com \
    --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