Linux USB
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Mika Westerberg" <mika.westerberg@linux.intel.com>,
	linux-usb@vger.kernel.org
Subject: Re: [PATCH 05/18] thunderbolt: Re-apply Alpine/Titan Ridge flow on resume
Date: Thu, 19 Nov 2026 17:35:54 +0000	[thread overview]
Message-ID: <sashiko-outbox-223706@kernel.org> (raw)
In-Reply-To: <20261119171232.1616316-6-mika.westerberg@linux.intel.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] thunderbolt: missing tb_pci_post_activate() in
  tb_runtime_resume()
--

commit 087ef2024705f5c81e4d876d241a868e52e4e3b5
Author: Mika Westerberg (Intel) <westeri@kernel.org>

thunderbolt: Re-apply Alpine/Titan Ridge flow on resume

This commit extracts the PCIe L1 enable and xHCI connect steps into
tb_pci_post_activate() and calls it when re-activating PCIe tunnels in
tb_resume_noirq().

> diff --git a/drivers/thunderbolt/tb.c b/drivers/thunderbolt/tb.c
> index 3c4903adb687d..6a11d686bdf14 100644
> --- a/drivers/thunderbolt/tb.c
> +++ b/drivers/thunderbolt/tb.c
> @@ -2315,6 +2315,21 @@ static int tb_disconnect_pci(struct tb *tb, struct tb_switch *sw)
>  	return 0;
>  }
>  
> +static void tb_pci_post_activate(struct tb_tunnel *tunnel)
> +{
> +	struct tb_switch *sw = tunnel->dst_port->sw;
> +
> +	/*
> +	 * PCIe L1 is needed to enable CL0s for Titan Ridge so enable it
> +	 * here.
> +	 */
> +	if (tb_switch_pcie_l1_enable(sw))
> +		tb_sw_warn(sw, "failed to enable PCIe L1 for Titan Ridge\n");
> +
> +	if (tb_switch_xhci_connect(sw))
> +		tb_sw_warn(sw, "failed to connect xHCI\n");
> +}

[ ... ]

> @@ -3239,6 +3246,8 @@ static int tb_resume_noirq(struct tb *tb)
>  			usb3_delay = 0;
>  		}
>  		tb_tunnel_activate(tunnel);
> +		if (tb_tunnel_is_pci(tunnel))
> +			tb_pci_post_activate(tunnel);
>  	}

[Severity: Medium]
Should tb_runtime_resume() also call tb_pci_post_activate() when it
re-activates PCIe tunnels?

drivers/thunderbolt/tb.c:tb_runtime_resume() {
	...
	tb_switch_resume(tb->root_switch, true);
	tb_free_invalid_tunnels(tb);
	tb_restore_children(tb->root_switch);
	list_for_each_entry_safe(tunnel, n, &tcm->tunnel_list, list)
		tb_tunnel_activate(tunnel);
	...
}

Generation 3 routers use runtime PM (tb_runtime_suspend() puts the routers
into sleep via tb_switch_suspend()), and when the NHI is already
runtime-suspended at the start of system sleep, nhi_complete() resumes the
domain through pm_runtime_resume() -> tb_runtime_resume() instead of
tb_resume_noirq().  Without tb_pci_post_activate() there, Titan Ridge PCIe
L1 and Alpine/Titan Ridge internal xHCI remain unconfigured after runtime
resume.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261119171232.1616316-1-mika.westerberg@linux.intel.com?part=5

  reply	other threads:[~2026-11-19 17:35 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-19 17:12 [PATCH 00/18] thunderbolt: Add support for shared buffering Mika Westerberg
2026-11-19 17:12 ` [PATCH 01/18] thunderbolt: Avoid leaking of DMA tunnel after XDomain removal Mika Westerberg
2026-11-19 17:32   ` sashiko-bot
2026-11-19 17:12 ` [PATCH 02/18] thunderbolt: Tear down DMA tunnels on every " Mika Westerberg
2026-11-19 17:34   ` sashiko-bot
2026-11-19 17:12 ` [PATCH 03/18] thunderbolt: Delay re-pairing DP IN/OUT if DPRX negotiation fails Mika Westerberg
2026-11-19 17:26   ` sashiko-bot
2026-11-19 17:12 ` [PATCH 04/18] thunderbolt: Call DP tunnel activation callback with tb->lock held Mika Westerberg
2026-11-19 17:28   ` sashiko-bot
2026-11-19 17:12 ` [PATCH 05/18] thunderbolt: Re-apply Alpine/Titan Ridge flow on resume Mika Westerberg
2026-11-19 17:35   ` sashiko-bot [this message]
2026-11-19 17:12 ` [PATCH 06/18] thunderbolt: Return -ESHUTDOWN when control channel is not running Mika Westerberg
2026-11-19 17:25   ` sashiko-bot
2026-11-19 17:12 ` [PATCH 07/18] thunderbolt: Add usb4_port_hotplug_disable() Mika Westerberg
2026-11-19 17:22   ` sashiko-bot
2026-11-19 17:12 ` [PATCH 08/18] thunderbolt: Move tb_plug_events_active() before tb_switch_reset_host() Mika Westerberg
2026-11-19 17:25   ` sashiko-bot
2026-11-19 17:12 ` [PATCH 09/18] thunderbolt: Add tb_port_state_is_up() Mika Westerberg
2026-11-19 17:22   ` sashiko-bot
2026-11-19 17:12 ` [PATCH 10/18] thunderbolt: Split host router port reset into a separate function Mika Westerberg
2026-11-19 17:22   ` sashiko-bot
2026-11-19 17:12 ` [PATCH 11/18] thunderbolt: Reset topology after suspend-to-disk Mika Westerberg
2026-11-19 17:44   ` sashiko-bot
2026-11-19 17:12 ` [PATCH 12/18] thunderbolt: Drop tunnel discovery without HopID allocation Mika Westerberg
2026-11-19 17:26   ` sashiko-bot
2026-11-19 17:12 ` [PATCH 13/18] thunderbolt: Always take domain lock when tb_tunnel_put() is called Mika Westerberg
2026-11-19 17:34   ` sashiko-bot
2026-11-19 17:12 ` [PATCH 14/18] thunderbolt: Assign domain to the routers in KUnit tests Mika Westerberg
2026-11-19 17:26   ` sashiko-bot
2026-11-19 17:12 ` [PATCH 15/18] thunderbolt: Rework tunnel credit allocation Mika Westerberg
2026-11-19 17:43   ` sashiko-bot
2026-11-19 17:12 ` [PATCH 16/18] thunderbolt: Add support for shared flow control Mika Westerberg
2026-11-19 17:34   ` sashiko-bot
2026-11-19 17:12 ` [PATCH 17/18] thunderbolt: Use restricted shared flow control for DMA tunnels on intra-domain links Mika Westerberg
2026-11-19 17:32   ` sashiko-bot
2026-11-19 17:12 ` [PATCH 18/18] thunderbolt: Add KUnit tests for shared buffering Mika Westerberg
2026-11-19 17:28   ` sashiko-bot

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=sashiko-outbox-223706@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.com \
    --cc=sashiko-reviews@lists.linux.dev \
    /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