From 47691e6c90c539ac82a85b80adb8cf1829e78dd1 Mon Sep 17 00:00:00 2001 From: Harsh Abasaheb Chavan Date: Sun, 12 Apr 2026 18:20:59 +0530 Subject: [PATCH] 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. --- tasks.c | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/tasks.c b/tasks.c index 5e68c7d26..b30a0f71e 100644 --- a/tasks.c +++ b/tasks.c @@ -3524,12 +3524,9 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode, #if ( ( configNUMBER_OF_CORES > 1 ) && ( configUSE_PREEMPTION == 1 ) ) { - BaseType_t xYieldPendingBefore = xYieldPendings[ portGET_CORE_ID() ]; - prvYieldForTask( pxTCB ); - if( ( xYieldPendingBefore == pdFALSE ) && - ( xYieldPendings[ portGET_CORE_ID() ] != pdFALSE ) ) + if( xYieldPendings[ portGET_CORE_ID() ] != pdFALSE ) { xYieldRequired = pdTRUE; } @@ -5497,12 +5494,9 @@ BaseType_t xTaskRemoveFromEventList( const List_t * const pxEventList ) #if ( configUSE_PREEMPTION == 1 ) { - BaseType_t xYieldPendingBefore = xYieldPendings[ portGET_CORE_ID() ]; - prvYieldForTask( pxUnblockedTCB ); - if( ( xYieldPendingBefore == pdFALSE ) && - ( xYieldPendings[ portGET_CORE_ID() ] != pdFALSE ) ) + if( xYieldPendings[ portGET_CORE_ID() ] != pdFALSE ) { xReturn = pdTRUE; } @@ -8211,12 +8205,9 @@ TickType_t uxTaskResetEventItemValue( void ) { #if ( configUSE_PREEMPTION == 1 ) { - BaseType_t xYieldPendingBefore = xYieldPendings[ portGET_CORE_ID() ]; - prvYieldForTask( pxTCB ); - if( ( xYieldPendingBefore == pdFALSE ) && - ( xYieldPendings[ portGET_CORE_ID() ] == pdTRUE ) ) + if( xYieldPendings[ portGET_CORE_ID() ] == pdTRUE ) { if( pxHigherPriorityTaskWoken != NULL ) { @@ -8348,12 +8339,9 @@ TickType_t uxTaskResetEventItemValue( void ) { #if ( configUSE_PREEMPTION == 1 ) { - BaseType_t xYieldPendingBefore = xYieldPendings[ portGET_CORE_ID() ]; - prvYieldForTask( pxTCB ); - if( ( xYieldPendingBefore == pdFALSE ) && - ( xYieldPendings[ portGET_CORE_ID() ] == pdTRUE ) ) + if( xYieldPendings[ portGET_CORE_ID() ] == pdTRUE ) { if( pxHigherPriorityTaskWoken != NULL ) {