Skip to content

Commit 47691e6

Browse files
committed
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.
1 parent c926adc commit 47691e6

1 file changed

Lines changed: 4 additions & 16 deletions

File tree

tasks.c

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3524,12 +3524,9 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode,
35243524

35253525
#if ( ( configNUMBER_OF_CORES > 1 ) && ( configUSE_PREEMPTION == 1 ) )
35263526
{
3527-
BaseType_t xYieldPendingBefore = xYieldPendings[ portGET_CORE_ID() ];
3528-
35293527
prvYieldForTask( pxTCB );
35303528

3531-
if( ( xYieldPendingBefore == pdFALSE ) &&
3532-
( xYieldPendings[ portGET_CORE_ID() ] != pdFALSE ) )
3529+
if( xYieldPendings[ portGET_CORE_ID() ] != pdFALSE )
35333530
{
35343531
xYieldRequired = pdTRUE;
35353532
}
@@ -5497,12 +5494,9 @@ BaseType_t xTaskRemoveFromEventList( const List_t * const pxEventList )
54975494

54985495
#if ( configUSE_PREEMPTION == 1 )
54995496
{
5500-
BaseType_t xYieldPendingBefore = xYieldPendings[ portGET_CORE_ID() ];
5501-
55025497
prvYieldForTask( pxUnblockedTCB );
55035498

5504-
if( ( xYieldPendingBefore == pdFALSE ) &&
5505-
( xYieldPendings[ portGET_CORE_ID() ] != pdFALSE ) )
5499+
if( xYieldPendings[ portGET_CORE_ID() ] != pdFALSE )
55065500
{
55075501
xReturn = pdTRUE;
55085502
}
@@ -8211,12 +8205,9 @@ TickType_t uxTaskResetEventItemValue( void )
82118205
{
82128206
#if ( configUSE_PREEMPTION == 1 )
82138207
{
8214-
BaseType_t xYieldPendingBefore = xYieldPendings[ portGET_CORE_ID() ];
8215-
82168208
prvYieldForTask( pxTCB );
82178209

8218-
if( ( xYieldPendingBefore == pdFALSE ) &&
8219-
( xYieldPendings[ portGET_CORE_ID() ] == pdTRUE ) )
8210+
if( xYieldPendings[ portGET_CORE_ID() ] == pdTRUE )
82208211
{
82218212
if( pxHigherPriorityTaskWoken != NULL )
82228213
{
@@ -8348,12 +8339,9 @@ TickType_t uxTaskResetEventItemValue( void )
83488339
{
83498340
#if ( configUSE_PREEMPTION == 1 )
83508341
{
8351-
BaseType_t xYieldPendingBefore = xYieldPendings[ portGET_CORE_ID() ];
8352-
83538342
prvYieldForTask( pxTCB );
83548343

8355-
if( ( xYieldPendingBefore == pdFALSE ) &&
8356-
( xYieldPendings[ portGET_CORE_ID() ] == pdTRUE ) )
8344+
if( xYieldPendings[ portGET_CORE_ID() ] == pdTRUE )
83578345
{
83588346
if( pxHigherPriorityTaskWoken != NULL )
83598347
{

0 commit comments

Comments
 (0)