fix(freertos-smp): Remove scheduler suspension from event_groups.c

This commit removes the need for suspending the scheduler when calling
some event_groups.c APIs as the non-deterministic operations are
happening with the event group being locked and the preemption being
disabled from the current task.
This commit is contained in:
Sudeep Mohanty 2025-08-20 14:48:25 +02:00
parent c5667e34d0
commit 829d8ba51a
2 changed files with 6 additions and 25 deletions

View file

@ -621,13 +621,6 @@
{
traceEVENT_GROUP_SET_BITS( xEventGroup, uxBitsToSet );
#if ( ( portUSING_GRANULAR_LOCKS == 1 ) && ( configNUMBER_OF_CORES > 1 ) )
/* We are about to access the kernel data group non-deterministically,
* thus we suspend the kernel data group.*/
vTaskSuspendAll();
#endif /* #if ( ( portUSING_GRANULAR_LOCKS == 1 ) && ( configNUMBER_OF_CORES > 1 ) ) */
pxListItem = listGET_HEAD_ENTRY( pxList );
/* Set the bits. */
@ -698,10 +691,6 @@
/* Snapshot resulting bits. */
uxReturnBits = pxEventBits->uxEventBits;
#if ( ( portUSING_GRANULAR_LOCKS == 1 ) && ( configNUMBER_OF_CORES > 1 ) )
( void ) xTaskResumeAll();
#endif /* #if ( ( portUSING_GRANULAR_LOCKS == 1 ) && ( configNUMBER_OF_CORES > 1 ) ) */
}
( void ) event_groupsUNLOCK( pxEventBits );
@ -726,13 +715,6 @@
{
traceEVENT_GROUP_DELETE( xEventGroup );
#if ( ( portUSING_GRANULAR_LOCKS == 1 ) && ( configNUMBER_OF_CORES > 1 ) )
/* We are about to access the kernel data group non-deterministically,
* thus we suspend the kernel data group.*/
vTaskSuspendAll();
#endif /* #if ( ( portUSING_GRANULAR_LOCKS == 1 ) && ( configNUMBER_OF_CORES > 1 ) ) */
while( listCURRENT_LIST_LENGTH( pxTasksWaitingForBits ) > ( UBaseType_t ) 0 )
{
/* Unblock the task, returning 0 as the event list is being deleted
@ -740,10 +722,6 @@
configASSERT( pxTasksWaitingForBits->xListEnd.pxNext != ( const ListItem_t * ) &( pxTasksWaitingForBits->xListEnd ) );
vTaskRemoveFromUnorderedEventList( pxTasksWaitingForBits->xListEnd.pxNext, eventUNBLOCKED_DUE_TO_BIT_SET );
}
#if ( ( portUSING_GRANULAR_LOCKS == 1 ) && ( configNUMBER_OF_CORES > 1 ) )
( void ) xTaskResumeAll();
#endif /* #if ( ( portUSING_GRANULAR_LOCKS == 1 ) && ( configNUMBER_OF_CORES > 1 ) ) */
}
( void ) event_groupsUNLOCK( pxEventBits );

View file

@ -5977,9 +5977,12 @@ void vTaskRemoveFromUnorderedEventList( ListItem_t * pxEventListItem,
traceENTER_vTaskRemoveFromUnorderedEventList( pxEventListItem, xItemValue );
/* THIS FUNCTION MUST BE CALLED WITH THE SCHEDULER SUSPENDED. It is used by
* the event flags implementation. */
configASSERT( uxSchedulerSuspended != ( UBaseType_t ) 0U );
#if ( !( portUSING_GRANULAR_LOCKS == 1 ) )
/* THIS FUNCTION MUST BE CALLED WITH THE SCHEDULER SUSPENDED. It is used by
* the event flags implementation. */
configASSERT( uxSchedulerSuspended != ( UBaseType_t ) 0U );
#endif /* #if ( ! ( portUSING_GRANULAR_LOCKS == 1 ) ) */
/* Store the new item value in the event list. */
listSET_LIST_ITEM_VALUE( pxEventListItem, xItemValue | taskEVENT_LIST_ITEM_VALUE_IN_USE );