From 7ab8607e7140294ac73cd0f5470c1bc162bed219 Mon Sep 17 00:00:00 2001 From: Ederson de Souza Date: Wed, 15 Jun 2022 13:59:22 -0700 Subject: [PATCH] soc/xtensa/intel_adsp/tools: Ack local interrupt before processing IPC It seems a race can happen between the host acknowledging a DONE interrupt and the DSP being able to mark some IPC as done. To avoid this, the host script now always acknowledges the DONE interrupt _before_ processing the IPC message. Signed-off-by: Ederson de Souza --- soc/xtensa/intel_adsp/tools/cavstool.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/soc/xtensa/intel_adsp/tools/cavstool.py b/soc/xtensa/intel_adsp/tools/cavstool.py index 9ff5b93a5d3..847924b0043 100755 --- a/soc/xtensa/intel_adsp/tools/cavstool.py +++ b/soc/xtensa/intel_adsp/tools/cavstool.py @@ -654,10 +654,10 @@ async def _main(server): (last_seq, output) = winstream_read(last_seq) if output: adsp_log(output, server) - if dsp.HIPCTDR & 0x80000000: - ipc_command(dsp.HIPCTDR & ~0x80000000, dsp.HIPCTDD) if dsp.HIPCIDA & 0x80000000: dsp.HIPCIDA = 1<<31 # must ACK any DONE interrupts that arrive! + if dsp.HIPCTDR & 0x80000000: + ipc_command(dsp.HIPCTDR & ~0x80000000, dsp.HIPCTDD) class adsp_request_handler(socketserver.BaseRequestHandler): """