From 884e4d576fdf6780a896bc9f7a2fe73fce5aa66a Mon Sep 17 00:00:00 2001 From: Mika Westerberg Date: Mon, 31 Aug 2020 13:05:14 +0300 Subject: 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 --- drivers/thunderbolt/tb.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'drivers/thunderbolt/tb.c') 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, -- cgit