Skip to content

Commit 34d27c7

Browse files
crojewsk-intelbroonie
authored andcommitted
ASoC: Intel: avs: Gather remaining logs on strace_release()
When user closes the tracer, some logs may still remain in the tail of the buffer as firmware sends LOG_BUFFER_STATUS notification only when certain threshold of data is reached. Add whatever is left to already gathered logs so no information is lost. Signed-off-by: Cezary Rojewski <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 5a565ba commit 34d27c7

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

sound/soc/intel/avs/debugfs.c

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,11 +201,25 @@ static int strace_open(struct inode *inode, struct file *file)
201201

202202
static int strace_release(struct inode *inode, struct file *file)
203203
{
204+
union avs_notify_msg msg = AVS_NOTIFICATION(LOG_BUFFER_STATUS);
204205
struct avs_dev *adev = file->private_data;
205-
unsigned long flags;
206+
unsigned long resource_mask;
207+
unsigned long flags, i;
208+
u32 num_cores;
209+
210+
resource_mask = adev->logged_resources;
211+
num_cores = adev->hw_cfg.dsp_cores;
206212

207213
spin_lock_irqsave(&adev->trace_lock, flags);
214+
215+
/* Gather any remaining logs. */
216+
for_each_set_bit(i, &resource_mask, num_cores) {
217+
msg.log.core = i;
218+
avs_dsp_op(adev, log_buffer_status, &msg);
219+
}
220+
208221
kfifo_free(&adev->trace_fifo);
222+
209223
spin_unlock_irqrestore(&adev->trace_lock, flags);
210224

211225
return 0;

0 commit comments

Comments
 (0)