mirror of
https://gitlab.com/mobian1/eg25-manager.git
synced 2025-08-28 23:03:24 +02:00
manager: disable reset timers once reset sequence starts
`modem_reset()` can be called from multiple places, both tied to a specific timer. In order to prevent calling this function multiple times in a row, disable all related timers as soon as we enter this function.
This commit is contained in:
committed by
Arnaud Ferraris
parent
9e6bccdf37
commit
97b1878ebc
@@ -153,7 +153,15 @@ gboolean modem_reset(struct EG25Manager *manager)
|
||||
int fd, ret, len;
|
||||
|
||||
/* reset sequence started, cannot be canceled anymore */
|
||||
manager->schedule_reset_timer = 0;
|
||||
if (manager->schedule_reset_timer) {
|
||||
g_source_remove(manager->schedule_reset_timer);
|
||||
manager->schedule_reset_timer = 0;
|
||||
}
|
||||
|
||||
if (manager->modem_recovery_timer) {
|
||||
g_source_remove(manager->modem_recovery_timer);
|
||||
manager->modem_recovery_timer = 0;
|
||||
}
|
||||
|
||||
if (manager->complete_reset_timer) {
|
||||
g_message("modem_reset: timer already setup, skipping...");
|
||||
@@ -170,11 +178,6 @@ gboolean modem_reset(struct EG25Manager *manager)
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
if (manager->modem_recovery_timer) {
|
||||
g_source_remove(manager->modem_recovery_timer);
|
||||
manager->modem_recovery_timer = 0;
|
||||
}
|
||||
|
||||
if (!manager->modem_usb_id) {
|
||||
g_warning("Empty modem USB ID");
|
||||
goto error;
|
||||
|
Reference in New Issue
Block a user