From 2fc84af622b448a7f163727cd937a2b4b62f5476 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eivind=20J=C3=B8lsgard?= Date: Thu, 6 Jul 2023 13:22:06 +0200 Subject: [PATCH] lib: nrf_modem: trace: cancel work items on deinit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cancel work items on deinit. Signed-off-by: Eivind Jølsgard --- .../releases/release-notes-changelog.rst | 7 ++++--- lib/nrf_modem_lib/nrf_modem_lib_trace.c | 13 +++++++++++++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst b/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst index fdb7da884e9..6c6a2cfc199 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst @@ -424,7 +424,9 @@ Modem libraries * :ref:`nrf_modem_lib_readme`: - Updated: + * Added CEREG event tracking to ``lte_connectivity``. + + * Updated: * The :c:func:`nrf_modem_lib_shutdown` function to allow the modem to be in flight mode (``CFUN=4``) when shutting down the modem. * The trace backends can now return ``-EAGAIN`` if the write operation can be retried. @@ -438,10 +440,9 @@ Modem libraries * Updated the library to allow a ``PDP_type``-only configuration in the :c:func:`pdn_ctx_configure` function. -* :ref:`nrf_modem_lib_readme`: +* :ref:`modem_key_mgmt`: * Updated the :c:func:`modem_key_mgmt_cmp` function to return ``1`` if the buffer length does not match the certificate length. - * Added CEREG event tracking to ``lte_connectivity``. Libraries for networking ------------------------ diff --git a/lib/nrf_modem_lib/nrf_modem_lib_trace.c b/lib/nrf_modem_lib/nrf_modem_lib_trace.c index 77a0b31b4fa..ed5a1f81ba5 100644 --- a/lib/nrf_modem_lib/nrf_modem_lib_trace.c +++ b/lib/nrf_modem_lib/nrf_modem_lib_trace.c @@ -362,6 +362,19 @@ static int trace_deinit(void) return err; } + +#if CONFIG_NRF_MODEM_LIB_TRACE_BACKEND_BITRATE + k_work_cancel(&backend_bps_avg_update_work); +#endif + +#if CONFIG_NRF_MODEM_LIB_TRACE_BACKEND_BITRATE_LOG + k_work_cancel(&backend_bps_log_work); +#endif + +#if CONFIG_NRF_MODEM_LIB_TRACE_BITRATE_LOG + k_work_cancel(&bps_log_work); +#endif + k_sem_give(&trace_done_sem); return 0;