[PATCH v2] broadband-modem: do not release SIM swap port contexts on disable

Carlo Lobrano c.lobrano at gmail.com
Tue Aug 29 07:15:52 UTC 2017


Currently when the modem is disabled, it releases SIM hot swap ports context,
and is not able to receive any notification about the SIM status.

This patch keeps these ports opened when Modem is disabled and released them
only when SIM swap is detected or when modem is released.
---

If I understood correctly, the only change was to be done in broadband modem's finalize.
I also looked at enabled_ports_ctx as reference and it seems there are not other places to
relese the port contexts.

---

 src/mm-broadband-modem.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/src/mm-broadband-modem.c b/src/mm-broadband-modem.c
index 552bdc5..b298721 100644
--- a/src/mm-broadband-modem.c
+++ b/src/mm-broadband-modem.c
@@ -1,5 +1,4 @@
-/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- *//*
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
@@ -8640,10 +8639,6 @@ disabling_stopped (MMBroadbandModem *self,
         self->priv->enabled_ports_ctx = NULL;
     }
 
-    if (self->priv->sim_hot_swap_ports_ctx) {
-        ports_context_unref (self->priv->sim_hot_swap_ports_ctx);
-        self->priv->sim_hot_swap_ports_ctx = NULL;
-    }
     return TRUE;
 }
 
@@ -10661,6 +10656,9 @@ finalize (GObject *object)
     if (self->priv->enabled_ports_ctx)
         ports_context_unref (self->priv->enabled_ports_ctx);
 
+    if (self->priv->sim_hot_swap_ports_ctx)
+        ports_context_unref (self->priv->sim_hot_swap_ports_ctx);
+
     if (self->priv->modem_3gpp_registration_regex)
         mm_3gpp_creg_regex_destroy (self->priv->modem_3gpp_registration_regex);
 
-- 
2.9.3



More information about the ModemManager-devel mailing list