You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@mynewt.apache.org by "gmarull (via GitHub)" <gi...@apache.org> on 2025/03/07 09:05:29 UTC
[I] Potentially blocking call within critical section [mynewt-nimble]
gmarull opened a new issue, #2004:
URL: https://github.com/apache/mynewt-nimble/issues/2004
In the following controller code:
https://github.com/apache/mynewt-nimble/blob/7b14eab3d07caffa3a70046271b9f5b805f5c965/nimble/controller/src/ble_ll_rfmgmt.c#L285-L300
`ble_ll_event_add` is called while inside a critical section. This calls:
https://github.com/apache/mynewt-nimble/blob/7b14eab3d07caffa3a70046271b9f5b805f5c965/nimble/controller/src/ble_ll.c#L1426-L1430
In case of FreeRTOS,
https://github.com/apache/mynewt-nimble/blob/7b14eab3d07caffa3a70046271b9f5b805f5c965/porting/npl/freertos/include/nimble/nimble_npl_os.h#L100-L104
https://github.com/apache/mynewt-nimble/blob/7b14eab3d07caffa3a70046271b9f5b805f5c965/porting/npl/freertos/src/npl_os_freertos.c#L60-L80
As you can see above, `xQueueSendToBack` is called with `portMAX_DELAY`. I guess at the very least, we should add a zero delay if we're within a critical section. Also, see https://forums.freertos.org/t/critical-sections-freertos-api-calls/17352.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@mynewt.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Potentially blocking call within critical section [mynewt-nimble]
Posted by "andrzej-kaczmarek (via GitHub)" <gi...@apache.org>.
andrzej-kaczmarek commented on issue #2004:
URL: https://github.com/apache/mynewt-nimble/issues/2004#issuecomment-2706278241
Ah, I just realized that sending an event from timer callback is not great idea as this would delay rfmgmt enable a bit which is not what we want there...
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@mynewt.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Potentially blocking call within critical section [mynewt-nimble]
Posted by "andrzej-kaczmarek (via GitHub)" <gi...@apache.org>.
andrzej-kaczmarek commented on issue #2004:
URL: https://github.com/apache/mynewt-nimble/issues/2004#issuecomment-2706258058
I think we could try to remove critical sections from rfmgmt code entirely. The only usage of rfmgmt outside LL task context seems to be the rfmgmt timer, at least this is the only I could find after a quick scan though the code. If we change that to either send an event to LL queue in order to serialize rfmgmt calls or replace the timer with a callout, critical sections should not be necessary.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@mynewt.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org