diff options
author | Mika Westerberg <mika.westerberg@linux.intel.com> | 2020-08-31 12:05:14 +0200 |
---|---|---|
committer | Mika Westerberg <mika.westerberg@linux.intel.com> | 2020-09-16 13:57:46 +0200 |
commit | 884e4d576fdf6780a896bc9f7a2fe73fce5aa66a (patch) | |
tree | c48cc45a43c1072ce028b95d9457c671dfff564d /drivers/thunderbolt/tb.c | |
parent | thunderbolt: debugfs: Fix uninitialized return in counters_write() (diff) | |
download | linux-884e4d576fdf6780a896bc9f7a2fe73fce5aa66a.tar.xz linux-884e4d576fdf6780a896bc9f7a2fe73fce5aa66a.zip |
thunderbolt: Only stop control channel when entering freeze
According to the kernel power management documentation freeze phase
should only quiesce the device, no need to configure wakes or put it to
low power state. For this reason we simply stop the control channel and
in case of Software Connection Manager also mark the hotplug disabled.
This should align the driver better with the PM framework expectations.
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Diffstat (limited to 'drivers/thunderbolt/tb.c')
-rw-r--r-- | drivers/thunderbolt/tb.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/thunderbolt/tb.c b/drivers/thunderbolt/tb.c index 170d1d846557..214fbc92c1b7 100644 --- a/drivers/thunderbolt/tb.c +++ b/drivers/thunderbolt/tb.c @@ -1424,6 +1424,22 @@ static int tb_free_unplugged_xdomains(struct tb_switch *sw) return ret; } +static int tb_freeze_noirq(struct tb *tb) +{ + struct tb_cm *tcm = tb_priv(tb); + + tcm->hotplug_active = false; + return 0; +} + +static int tb_thaw_noirq(struct tb *tb) +{ + struct tb_cm *tcm = tb_priv(tb); + + tcm->hotplug_active = true; + return 0; +} + static void tb_complete(struct tb *tb) { /* @@ -1490,6 +1506,8 @@ static const struct tb_cm_ops tb_cm_ops = { .stop = tb_stop, .suspend_noirq = tb_suspend_noirq, .resume_noirq = tb_resume_noirq, + .freeze_noirq = tb_freeze_noirq, + .thaw_noirq = tb_thaw_noirq, .complete = tb_complete, .runtime_suspend = tb_runtime_suspend, .runtime_resume = tb_runtime_resume, |