Commit 344e0643 authored by Mika Westerberg's avatar Mika Westerberg

thunderbolt: Scan only valid NULL adapter ports in hotplug

The only way to expand Thunderbolt topology is through the NULL adapter
ports (typically ports 1, 2, 3 and 4). There is no point handling
Thunderbolt hotplug events on any other port.

Add a helper function (tb_port_is_null()) that can be used to determine
if the port is NULL port, and use it in software connection manager code
when hotplug event is handled.
Signed-off-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
parent 99cabbb0
...@@ -356,11 +356,13 @@ static void tb_handle_hotplug(struct work_struct *work) ...@@ -356,11 +356,13 @@ static void tb_handle_hotplug(struct work_struct *work)
tb_port_info(port, tb_port_info(port,
"got plug event for connected port, ignoring\n"); "got plug event for connected port, ignoring\n");
} else { } else {
if (tb_port_is_null(port)) {
tb_port_info(port, "hotplug: scanning\n"); tb_port_info(port, "hotplug: scanning\n");
tb_scan_port(port); tb_scan_port(port);
if (!port->remote) if (!port->remote)
tb_port_info(port, "hotplug: no switch found\n"); tb_port_info(port, "hotplug: no switch found\n");
} }
}
put_sw: put_sw:
tb_switch_put(sw); tb_switch_put(sw);
......
...@@ -350,6 +350,11 @@ static inline bool tb_port_has_remote(const struct tb_port *port) ...@@ -350,6 +350,11 @@ static inline bool tb_port_has_remote(const struct tb_port *port)
return true; return true;
} }
static inline bool tb_port_is_null(const struct tb_port *port)
{
return port && port->port && port->config.type == TB_TYPE_PORT;
}
static inline bool tb_port_is_pcie_down(const struct tb_port *port) static inline bool tb_port_is_pcie_down(const struct tb_port *port)
{ {
return port && port->config.type == TB_TYPE_PCIE_DOWN; return port && port->config.type == TB_TYPE_PCIE_DOWN;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment