]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
thunderbolt: Correct path indices for PCIe tunnel
authorMika Westerberg <mika.westerberg@linux.intel.com>
Tue, 11 Jun 2019 16:31:26 +0000 (19:31 +0300)
committerMika Westerberg <mika.westerberg@linux.intel.com>
Mon, 26 Aug 2019 09:08:57 +0000 (12:08 +0300)
PCIe tunnel path indices got mixed up when we added support for tunnels
between switches that are not adjacent. This did not affect the
functionality as it is just an index but fix it now nevertheless to make
the code easier to understand.

Reported-by: Rajmohan Mani <rajmohan.mani@intel.com>
Fixes: 8c7acaaf020f ("thunderbolt: Extend tunnel creation to more than 2 adjacent switches")
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Reviewed-by: Yehezkel Bernat <YehezkelShB@gmail.com>
drivers/thunderbolt/tunnel.c

index 31d0234837e45d74143d06ff2ac4bb9f28d6bc25..5a99234826e73b5932ea51ccfb63817fecea3236 100644 (file)
@@ -211,7 +211,7 @@ struct tb_tunnel *tb_tunnel_alloc_pci(struct tb *tb, struct tb_port *up,
                return NULL;
        }
        tb_pci_init_path(path);
-       tunnel->paths[TB_PCI_PATH_UP] = path;
+       tunnel->paths[TB_PCI_PATH_DOWN] = path;
 
        path = tb_path_alloc(tb, up, TB_PCI_HOPID, down, TB_PCI_HOPID, 0,
                             "PCIe Up");
@@ -220,7 +220,7 @@ struct tb_tunnel *tb_tunnel_alloc_pci(struct tb *tb, struct tb_port *up,
                return NULL;
        }
        tb_pci_init_path(path);
-       tunnel->paths[TB_PCI_PATH_DOWN] = path;
+       tunnel->paths[TB_PCI_PATH_UP] = path;
 
        return tunnel;
 }