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

Aleksander Morgado aleksander at aleksander.es
Tue Aug 29 05:34:50 UTC 2017


On 28/08/17 14:18, Carlo Lobrano wrote:
> Currently when the modem is disabled, it also releases SIM hot swap ports context,
> and it is not able to receive any notification about the SIM status anymore.
> 
> This patch keeps these ports opened when Modem is disabled and released them
> only when SIM swap is detected.
> 
> ---
> 
> Hi Aleksander,
> 
> as you might remember we talked about this issue while discussing "Handling QSS unsolicited in power state transitions" (it's the email's subject).
> I'm back working on this topic and saw that this part hasn't been submitted yet.
> 

If removed from here (which I agree we should) we also need to clear the context when the modem goes away, e.g. in finalize(), or we would be leaking the context and the port references. Could you also add that in the patch?

> ---
> 
>  src/mm-broadband-modem.c | 4 ----
>  1 file changed, 4 deletions(-)
> 
> diff --git a/src/mm-broadband-modem.c b/src/mm-broadband-modem.c
> index 552bdc5..b482705 100644
> --- a/src/mm-broadband-modem.c
> +++ b/src/mm-broadband-modem.c
> @@ -8640,10 +8640,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;
>  }
>  
> 


-- 
Aleksander
https://aleksander.es


More information about the ModemManager-devel mailing list