summaryrefslogtreecommitdiffstats
path: root/drivers/thunderbolt
diff options
context:
space:
mode:
authorMika Westerberg <mika.westerberg@linux.intel.com>2017-06-06 08:24:54 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-06-09 05:42:41 -0400
commit08a5e4cebec543bfa4a6d119fc18f0ed8fd9d8ce (patch)
tree09adf22c1a45da2763ebbf933dbe4f0079106bd9 /drivers/thunderbolt
parent16a1258af5d8e1bd58e20fc70069f9dd91cc5b34 (diff)
thunderbolt: No need to read UID of the root switch on resume
The root switch is part of the host controller and cannot be physically removed, so there is no point of reading UID again on resume in order to check if the root switch is still the same. Suggested-by: Andreas Noever <andreas.noever@gmail.com> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Andreas Noever <andreas.noever@gmail.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/thunderbolt')
-rw-r--r--drivers/thunderbolt/switch.c29
1 files changed, 18 insertions, 11 deletions
diff --git a/drivers/thunderbolt/switch.c b/drivers/thunderbolt/switch.c
index c6f30b1695a9..81f5164a6364 100644
--- a/drivers/thunderbolt/switch.c
+++ b/drivers/thunderbolt/switch.c
@@ -452,19 +452,26 @@ void tb_sw_set_unplugged(struct tb_switch *sw)
452int tb_switch_resume(struct tb_switch *sw) 452int tb_switch_resume(struct tb_switch *sw)
453{ 453{
454 int i, err; 454 int i, err;
455 u64 uid;
456 tb_sw_info(sw, "resuming switch\n"); 455 tb_sw_info(sw, "resuming switch\n");
457 456
458 err = tb_drom_read_uid_only(sw, &uid); 457 /*
459 if (err) { 458 * Check for UID of the connected switches except for root
460 tb_sw_warn(sw, "uid read failed\n"); 459 * switch which we assume cannot be removed.
461 return err; 460 */
462 } 461 if (tb_route(sw)) {
463 if (sw != sw->tb->root_switch && sw->uid != uid) { 462 u64 uid;
464 tb_sw_info(sw, 463
465 "changed while suspended (uid %#llx -> %#llx)\n", 464 err = tb_drom_read_uid_only(sw, &uid);
466 sw->uid, uid); 465 if (err) {
467 return -ENODEV; 466 tb_sw_warn(sw, "uid read failed\n");
467 return err;
468 }
469 if (sw->uid != uid) {
470 tb_sw_info(sw,
471 "changed while suspended (uid %#llx -> %#llx)\n",
472 sw->uid, uid);
473 return -ENODEV;
474 }
468 } 475 }
469 476
470 /* upload configuration */ 477 /* upload configuration */