summaryrefslogtreecommitdiffstats
path: root/drivers/thunderbolt/tb.c
diff options
context:
space:
mode:
authorMika Westerberg <mika.westerberg@linux.intel.com>2022-11-18 15:26:12 +0200
committerMika Westerberg <mika.westerberg@linux.intel.com>2023-06-09 12:07:23 +0300
commit9650de737992cad35f48e19d7004a0ad2673dae1 (patch)
tree89fd5f95f6113922affc02bda32353888eacb7e8 /drivers/thunderbolt/tb.c
parent35627353063bc145ba5c2c509dfe042982e2a219 (diff)
downloadlinux-stable-9650de737992cad35f48e19d7004a0ad2673dae1.tar.gz
linux-stable-9650de737992cad35f48e19d7004a0ad2673dae1.tar.bz2
linux-stable-9650de737992cad35f48e19d7004a0ad2673dae1.zip
thunderbolt: Check for first depth router in tb.c
Currently tb_switch_clx_enable() enables CL states only for the first depth router. This is something we may want to change in the future and in addition it is not visible from the calling path at all. For this reason do the check in the tb.c so it is immediately visible that we only do this for the first depth router. Fix the kernel-docs accordingly. Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Diffstat (limited to 'drivers/thunderbolt/tb.c')
-rw-r--r--drivers/thunderbolt/tb.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/thunderbolt/tb.c b/drivers/thunderbolt/tb.c
index 2d360508aeeb..1d056ff6d77f 100644
--- a/drivers/thunderbolt/tb.c
+++ b/drivers/thunderbolt/tb.c
@@ -245,6 +245,16 @@ static int tb_enable_clx(struct tb_switch *sw)
int ret;
/*
+ * Currently only enable CLx for the first link. This is enough
+ * to allow the CPU to save energy at least on Intel hardware
+ * and makes it slightly simpler to implement. We may change
+ * this in the future to cover the whole topology if it turns
+ * out to be beneficial.
+ */
+ if (sw->config.depth != 1)
+ return 0;
+
+ /*
* CL0s and CL1 are enabled and supported together.
* Silently ignore CLx enabling in case CLx is not supported.
*/