Commit 4c09f20
committed
ASoC: SOF: ipc4-mtrace: resync host_read_ptr on debugfs open and release
IPC4 mtrace debugfs read handler advances host_read_ptr in SRAM
after consuming all available data. When file descriptor is
closed, host_read_ptr is left equal to dsp_write_ptr in kernel
core_data cache. So subsequent open() inherits this stale pointer.
first read() call, sof_wait_mtrace_avail() find host_read_ptr == dsp_write_ptr
and block waiting for NOTIFY_LOG_BUFFER_STATUS IPC from fw. Platforms
with low post-boot DSP activity timer (256 ms) may not work good
with reader timeout window, resulting in empty trace output.
Fix this by re-reading dsp_write_ptr directly from SRAM in open() and
aligning host_read_ptr to it, so new reader starts from current write
position without waiting for IPC notification. Also reset host_read_ptr
to dsp_write_ptr in release() to leave core_data to consistent state.
Reset target is dsp_write_ptr (not 0) to avoid re-reading stale
data that may remain before last wrap of circular buffer.
Signed-off-by: Mateusz Junkier <mateusz.junkier@intel.com>1 parent 667770d commit 4c09f20
1 file changed
+28
-0
lines changed| 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 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
112 | 132 | | |
113 | 133 | | |
114 | 134 | | |
| |||
254 | 274 | | |
255 | 275 | | |
256 | 276 | | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
257 | 285 | | |
258 | 286 | | |
259 | 287 | | |
| |||
0 commit comments