Skip to content

Commit d866dbf

Browse files
committed
audio: base_fw: fix race condition in perf counters reset operation
Change the order of operations in the performance measurement initialization sequence to avoid a race condition. Previously, the performance counters were reset before setting the state to STOPPED, which created a window where an LL task could preempt the execution and record new measurements between these operations. Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
1 parent ba3e73f commit d866dbf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/audio/base_fw.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,8 +439,8 @@ __cold int set_perf_meas_state(const char *data)
439439
break;
440440
case IPC4_PERF_MEASUREMENTS_STOPPED:
441441
enable_performance_counters();
442-
reset_performance_counters();
443442
perf_meas_set_state(IPC4_PERF_MEASUREMENTS_STOPPED);
443+
reset_performance_counters();
444444
break;
445445
case IPC4_PERF_MEASUREMENTS_STARTED:
446446
enable_performance_counters();

0 commit comments

Comments
 (0)