[PATCH v2] broadband-modem: do not release SIM swap port contexts on disable
Aleksander Morgado
aleksander at aleksander.es
Tue Aug 29 09:20:15 UTC 2017
On Tue, Aug 29, 2017 at 9:15 AM, Carlo Lobrano <c.lobrano at gmail.com> wrote:
> 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.
>
Pushed to git master after fixing up the change in the file mode line,
which I assume wasn't on purpose :)
Thanks!
> ---
>
> 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
>
> _______________________________________________
> ModemManager-devel mailing list
> ModemManager-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel
--
Aleksander
https://aleksander.es
More information about the ModemManager-devel
mailing list