thunderbolt: Fix nontrivial endpoint devices.
[firefly-linux-kernel-4.4.55.git] / drivers / thunderbolt / tb.c
index 1aa6dd7dc68b72fb87b2d4e9168a61263a14cbf2..d2c3fe346e91230e423cdeb88fc3f3fc2a5682c2 100644 (file)
@@ -38,6 +38,11 @@ static void tb_scan_port(struct tb_port *port)
                return;
        if (port->config.type != TB_TYPE_PORT)
                return;
+       if (port->dual_link_port && port->link_nr)
+               return; /*
+                        * Downstream switch is reachable through two ports.
+                        * Only scan on the primary port (link_nr == 0).
+                        */
        if (tb_wait_for_port(port, false) <= 0)
                return;
        if (port->remote) {