summaryrefslogtreecommitdiff
path: root/drivers/thunderbolt/switch.c
diff options
context:
space:
mode:
authorMika Westerberg <mika.westerberg@linux.intel.com>2020-06-01 12:47:07 +0300
committerMika Westerberg <mika.westerberg@linux.intel.com>2020-06-22 19:58:06 +0300
commit126764236e3557853c4208a70a08f5f69da8d897 (patch)
tree9a31338a22bab48bbe43ec53f9590b2a3c127aaf /drivers/thunderbolt/switch.c
parent177aa362eb92ab8bd350a0642b66252db24b6140 (diff)
downloadlwn-126764236e3557853c4208a70a08f5f69da8d897.tar.gz
lwn-126764236e3557853c4208a70a08f5f69da8d897.zip
thunderbolt: NHI can use HopIDs 1-7
NHI (The host interface adapter) is allowed to use HopIDs 1-7 as well so relax the restriction in tb_port_alloc_hopid() to support this. Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Diffstat (limited to 'drivers/thunderbolt/switch.c')
-rw-r--r--drivers/thunderbolt/switch.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/thunderbolt/switch.c b/drivers/thunderbolt/switch.c
index d7d60cd9226f..95b75a712ade 100644
--- a/drivers/thunderbolt/switch.c
+++ b/drivers/thunderbolt/switch.c
@@ -789,8 +789,11 @@ static int tb_port_alloc_hopid(struct tb_port *port, bool in, int min_hopid,
ida = &port->out_hopids;
}
- /* HopIDs 0-7 are reserved */
- if (min_hopid < TB_PATH_MIN_HOPID)
+ /*
+ * NHI can use HopIDs 1-max for other adapters HopIDs 0-7 are
+ * reserved.
+ */
+ if (port->config.type != TB_TYPE_NHI && min_hopid < TB_PATH_MIN_HOPID)
min_hopid = TB_PATH_MIN_HOPID;
if (max_hopid < 0 || max_hopid > port_max_hopid)