Commit 98832db
committed
ASoC: SOF: ipc4-mtrace: resync host_read_ptr on debugfs open
IPC4 mtrace aging timer sends NOTIFY_LOG_BUFFER_STATUS IPC every 256ms
but only when dsp_write_ptr has changed since last tick. If IPC
is sent while no reader is active, the wake_up() is lost and
core_data->dsp_write_ptr becomes stale.
Open() finds host_read_ptr == dsp_write_ptr (both
reflecting stale cached value) and blocks in sof_wait_mtrace_avail()
waiting for IPC that will never come since DSP has gone idle.
This causes empty trace output on platforms with low post-boot DSP
activity.
Fix this by re-reading dsp_write_ptr directly from SRAM in open() so
reader see current write position without relying on IPC cache.
host_read_ptr is intentionally left unchanged to preserve any
data written between sessions
Signed-off-by: Mateusz Junkier <mateusz.junkier@intel.com>1 parent 667770d commit 98832db
1 file changed
Lines changed: 14 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
112 | 126 | | |
113 | 127 | | |
114 | 128 | | |
| |||
0 commit comments