summaryrefslogtreecommitdiffstats
path: root/drivers/thunderbolt/tb.h
diff options
context:
space:
mode:
authorMika Westerberg2018-12-30 11:14:46 +0100
committerMika Westerberg2019-04-18 10:18:51 +0200
commitf0342e757c271e7c6dd5adedfb6e6695c5af52bf (patch)
treebeaa2c019b14a6f35e3f925a11c6ca78ad139df4 /drivers/thunderbolt/tb.h
parentthunderbolt: Take domain lock in switch sysfs attribute callbacks (diff)
downloadkernel-qcow2-linux-f0342e757c271e7c6dd5adedfb6e6695c5af52bf.tar.gz
kernel-qcow2-linux-f0342e757c271e7c6dd5adedfb6e6695c5af52bf.tar.xz
kernel-qcow2-linux-f0342e757c271e7c6dd5adedfb6e6695c5af52bf.zip
thunderbolt: Do not allocate switch if depth is greater than 6
Maximum depth in Thunderbolt topology is 6 so make sure it is not possible to allocate switches that exceed the depth limit. While at it update tb_switch_alloc() to use upper/lower_32_bits() following tb_switch_alloc_safe_mode(). Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Diffstat (limited to 'drivers/thunderbolt/tb.h')
-rw-r--r--drivers/thunderbolt/tb.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/thunderbolt/tb.h b/drivers/thunderbolt/tb.h
index f7b0c43c29a7..93c1ea21feeb 100644
--- a/drivers/thunderbolt/tb.h
+++ b/drivers/thunderbolt/tb.h
@@ -43,6 +43,7 @@ struct tb_switch_nvm {
};
#define TB_SWITCH_KEY_SIZE 32
+#define TB_SWITCH_MAX_DEPTH 6
/**
* struct tb_switch - a thunderbolt switch