Fix suppressed ISR yield reporting in SMP preemption fix

Restore the original post-prvYieldForTask() yield checks so FromISR paths still report a required yield when xYieldPendings[] was already set. Keep the xTaskIncrementTick() root-cause fix and the vTaskSwitchContext() preemption-disable safety net.
This commit is contained in:
Harsh Abasaheb Chavan 2026-04-12 18:20:59 +05:30
parent c926adcf6e
commit 47691e6c90

20
tasks.c
View file

@ -3524,12 +3524,9 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode,
#if ( ( configNUMBER_OF_CORES > 1 ) && ( configUSE_PREEMPTION == 1 ) ) #if ( ( configNUMBER_OF_CORES > 1 ) && ( configUSE_PREEMPTION == 1 ) )
{ {
BaseType_t xYieldPendingBefore = xYieldPendings[ portGET_CORE_ID() ];
prvYieldForTask( pxTCB ); prvYieldForTask( pxTCB );
if( ( xYieldPendingBefore == pdFALSE ) && if( xYieldPendings[ portGET_CORE_ID() ] != pdFALSE )
( xYieldPendings[ portGET_CORE_ID() ] != pdFALSE ) )
{ {
xYieldRequired = pdTRUE; xYieldRequired = pdTRUE;
} }
@ -5497,12 +5494,9 @@ BaseType_t xTaskRemoveFromEventList( const List_t * const pxEventList )
#if ( configUSE_PREEMPTION == 1 ) #if ( configUSE_PREEMPTION == 1 )
{ {
BaseType_t xYieldPendingBefore = xYieldPendings[ portGET_CORE_ID() ];
prvYieldForTask( pxUnblockedTCB ); prvYieldForTask( pxUnblockedTCB );
if( ( xYieldPendingBefore == pdFALSE ) && if( xYieldPendings[ portGET_CORE_ID() ] != pdFALSE )
( xYieldPendings[ portGET_CORE_ID() ] != pdFALSE ) )
{ {
xReturn = pdTRUE; xReturn = pdTRUE;
} }
@ -8211,12 +8205,9 @@ TickType_t uxTaskResetEventItemValue( void )
{ {
#if ( configUSE_PREEMPTION == 1 ) #if ( configUSE_PREEMPTION == 1 )
{ {
BaseType_t xYieldPendingBefore = xYieldPendings[ portGET_CORE_ID() ];
prvYieldForTask( pxTCB ); prvYieldForTask( pxTCB );
if( ( xYieldPendingBefore == pdFALSE ) && if( xYieldPendings[ portGET_CORE_ID() ] == pdTRUE )
( xYieldPendings[ portGET_CORE_ID() ] == pdTRUE ) )
{ {
if( pxHigherPriorityTaskWoken != NULL ) if( pxHigherPriorityTaskWoken != NULL )
{ {
@ -8348,12 +8339,9 @@ TickType_t uxTaskResetEventItemValue( void )
{ {
#if ( configUSE_PREEMPTION == 1 ) #if ( configUSE_PREEMPTION == 1 )
{ {
BaseType_t xYieldPendingBefore = xYieldPendings[ portGET_CORE_ID() ];
prvYieldForTask( pxTCB ); prvYieldForTask( pxTCB );
if( ( xYieldPendingBefore == pdFALSE ) && if( xYieldPendings[ portGET_CORE_ID() ] == pdTRUE )
( xYieldPendings[ portGET_CORE_ID() ] == pdTRUE ) )
{ {
if( pxHigherPriorityTaskWoken != NULL ) if( pxHigherPriorityTaskWoken != NULL )
{ {