mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] thunderbolt: Enable runtime PM for the Ice Lake router with the software CM
@ 2026-11-11 13:08 Andre Eikmeyer
  2026-11-11 13:21 ` Mika Westerberg
  0 siblings, 1 reply; 3+ messages in thread
From: Andre Eikmeyer @ 2026-11-11 13:08 UTC (permalink / raw)
  To: westeri, andreas.noever, YehezkelShB
  Cc: linux-usb, linux-kernel, Andre Eikmeyer

The firmware connection manager reports RTD3 for the Ice Lake router.
On Apple systems the software connection manager takes over and enables
runtime PM only for USB4 routers, so the Ice Lake NHI stays in D0 for as
long as the driver is bound and the package does not reach deep C-states.

Enable runtime PM for the Ice Lake router as well. The Ice Lake NHI
already has runtime suspend and resume callbacks.

Tested on a MacBookAir9,1.

Signed-off-by: Andre Eikmeyer <dev@deq.rocks>
---
 drivers/thunderbolt/tb.c |  5 +++--
 drivers/thunderbolt/tb.h | 12 ++++++++++++
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/drivers/thunderbolt/tb.c b/drivers/thunderbolt/tb.c
index 418ad0a61a..139ef49b49 100644
--- a/drivers/thunderbolt/tb.c
+++ b/drivers/thunderbolt/tb.c
@@ -3044,8 +3044,9 @@ static int tb_start(struct tb *tb, bool reset)
 	 * implement the necessary router operations.
 	 */
 	tb->root_switch->no_nvm_upgrade = !tb_switch_is_usb4(tb->root_switch);
-	/* All USB4 routers support runtime PM */
-	tb->root_switch->rpm = tb_switch_is_usb4(tb->root_switch);
+	/* All USB4 routers support runtime PM. Ice Lake also supports RTD3 */
+	tb->root_switch->rpm = tb_switch_is_usb4(tb->root_switch) ||
+			       tb_switch_is_ice_lake(tb->root_switch);
 
 	ret = tb_switch_configure(tb->root_switch);
 	if (ret) {
diff --git a/drivers/thunderbolt/tb.h b/drivers/thunderbolt/tb.h
index e86845762e..eff4a342d6 100644
--- a/drivers/thunderbolt/tb.h
+++ b/drivers/thunderbolt/tb.h
@@ -1011,6 +1011,18 @@ static inline bool tb_switch_is_tiger_lake(const struct tb_switch *sw)
 	return false;
 }
 
+static inline bool tb_switch_is_ice_lake(const struct tb_switch *sw)
+{
+	if (sw->config.vendor_id == PCI_VENDOR_ID_INTEL) {
+		switch (sw->config.device_id) {
+		case PCI_DEVICE_ID_INTEL_ICL_NHI0:
+		case PCI_DEVICE_ID_INTEL_ICL_NHI1:
+			return true;
+		}
+	}
+	return false;
+}
+
 /**
  * tb_switch_is_icm() - Is the switch handled by ICM firmware
  * @sw: Switch to check

base-commit: 13527afe5f15c60b82920fe9915f3cabf1315302

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] thunderbolt: Enable runtime PM for the Ice Lake router with the software CM
  2026-11-11 13:08 [PATCH] thunderbolt: Enable runtime PM for the Ice Lake router with the software CM Andre Eikmeyer
@ 2026-11-11 13:21 ` Mika Westerberg
  2026-11-11 13:28   ` André Eikmeyer
  0 siblings, 1 reply; 3+ messages in thread
From: Mika Westerberg @ 2026-11-11 13:21 UTC (permalink / raw)
  To: Andre Eikmeyer
  Cc: westeri, andreas.noever, YehezkelShB, linux-usb, linux-kernel

Hi,

On Wed, Nov 11, 2026 at 02:08:51PM +0100, Andre Eikmeyer wrote:
> The firmware connection manager reports RTD3 for the Ice Lake router.
> On Apple systems the software connection manager takes over and enables
> runtime PM only for USB4 routers, so the Ice Lake NHI stays in D0 for as
> long as the driver is bound and the package does not reach deep C-states.
> 
> Enable runtime PM for the Ice Lake router as well. The Ice Lake NHI
> already has runtime suspend and resume callbacks.
> 
> Tested on a MacBookAir9,1.

Cool, does it also wake up if you plug something to the TB ports?

> 
> Signed-off-by: Andre Eikmeyer <dev@deq.rocks>
> ---
>  drivers/thunderbolt/tb.c |  5 +++--
>  drivers/thunderbolt/tb.h | 12 ++++++++++++
>  2 files changed, 15 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/thunderbolt/tb.c b/drivers/thunderbolt/tb.c
> index 418ad0a61a..139ef49b49 100644
> --- a/drivers/thunderbolt/tb.c
> +++ b/drivers/thunderbolt/tb.c
> @@ -3044,8 +3044,9 @@ static int tb_start(struct tb *tb, bool reset)
>  	 * implement the necessary router operations.
>  	 */
>  	tb->root_switch->no_nvm_upgrade = !tb_switch_is_usb4(tb->root_switch);
> -	/* All USB4 routers support runtime PM */
> -	tb->root_switch->rpm = tb_switch_is_usb4(tb->root_switch);
> +	/* All USB4 routers support runtime PM. Ice Lake also supports RTD3 */
> +	tb->root_switch->rpm = tb_switch_is_usb4(tb->root_switch) ||
> +			       tb_switch_is_ice_lake(tb->root_switch);
>  
>  	ret = tb_switch_configure(tb->root_switch);
>  	if (ret) {
> diff --git a/drivers/thunderbolt/tb.h b/drivers/thunderbolt/tb.h
> index e86845762e..eff4a342d6 100644
> --- a/drivers/thunderbolt/tb.h
> +++ b/drivers/thunderbolt/tb.h
> @@ -1011,6 +1011,18 @@ static inline bool tb_switch_is_tiger_lake(const struct tb_switch *sw)
>  	return false;
>  }
>  
> +static inline bool tb_switch_is_ice_lake(const struct tb_switch *sw)
> +{
> +	if (sw->config.vendor_id == PCI_VENDOR_ID_INTEL) {
> +		switch (sw->config.device_id) {
> +		case PCI_DEVICE_ID_INTEL_ICL_NHI0:
> +		case PCI_DEVICE_ID_INTEL_ICL_NHI1:
> +			return true;
> +		}
> +	}
> +	return false;
> +}
> +
>  /**
>   * tb_switch_is_icm() - Is the switch handled by ICM firmware
>   * @sw: Switch to check
> 
> base-commit: 13527afe5f15c60b82920fe9915f3cabf1315302

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] thunderbolt: Enable runtime PM for the Ice Lake router with the software CM
  2026-11-11 13:21 ` Mika Westerberg
@ 2026-11-11 13:28   ` André Eikmeyer
  0 siblings, 0 replies; 3+ messages in thread
From: André Eikmeyer @ 2026-11-11 13:28 UTC (permalink / raw)
  To: Mika Westerberg
  Cc: westeri, andreas.noever, YehezkelShB, linux-usb, linux-kernel

On Wed, 11 Nov 2026 14:21:12 +0100
Mika Westerberg <mika.westerberg@linux.intel.com> wrote:

> Cool, does it also wake up if you plug something to the TB ports?

Hi Mika,

yup. working perfectly here. There is also a bunch of other patches
for hotplug and such. I even get pkg-c10 on all T2 macbooks.
But that is for another day.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-11-11 13:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-11 13:08 [PATCH] thunderbolt: Enable runtime PM for the Ice Lake router with the software CM Andre Eikmeyer
2026-11-11 13:21 ` Mika Westerberg
2026-11-11 13:28   ` André Eikmeyer

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®