From 19d00bee3b99f82de553ad9028e3614ffebaf59f Mon Sep 17 00:00:00 2001 From: Arnaud Ferraris Date: Sat, 20 Feb 2021 17:04:38 +0100 Subject: [PATCH] manager: make sure we don't block suspend when rebooting the modem --- src/manager.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/manager.c b/src/manager.c index fe3cd1a..964552e 100644 --- a/src/manager.c +++ b/src/manager.c @@ -165,7 +165,14 @@ void modem_reset(struct EG25Manager *manager) return; error: - // Everything else failed, reset the modem + // Release blocking sleep inhibitor + if (manager->suspend_block_fd >= 0) + suspend_inhibit(manager, FALSE, TRUE); + if (manager->modem_boot_timer) { + g_source_remove(manager->modem_boot_timer); + manager->modem_boot_timer = 0; + } + // Everything else failed, reboot the modem at_sequence_reset(manager); }