From 005e12bdacf35c62123b37ebca287f1f9f2f6236 Mon Sep 17 00:00:00 2001 From: Andy Ross Date: Sun, 23 Jan 2022 10:34:56 -0800 Subject: [PATCH] soc/intel_adsp: Add hardware race workaround to cavstool On cAVS 1.8 (specifically) there seems to be a propagation delay on the IPC registers. Hitting the TDA register to signal DONE too soon after clearing the interrupt via TDR can cause the interrupt to be dropped. Merely polling for it to read back correctly isn't sufficient, we need an actual sleep here. (The behavior that a message won't send while an existing message is in progress is actually a hardware feature that is new with 1.8. My guess is it's a little glitchy in its first version.) Signed-off-by: Andy Ross --- soc/xtensa/intel_adsp/tools/cavstool.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/soc/xtensa/intel_adsp/tools/cavstool.py b/soc/xtensa/intel_adsp/tools/cavstool.py index 4fa1b840d15..ef480c0b606 100755 --- a/soc/xtensa/intel_adsp/tools/cavstool.py +++ b/soc/xtensa/intel_adsp/tools/cavstool.py @@ -342,6 +342,9 @@ def ipc_command(data, ext_data): log.warning(f"cavstool: Unrecognized IPC command 0x{data:x} ext 0x{ext_data:x}") dsp.HIPCTDR = 1<<31 # Ack local interrupt, also signals DONE on v1.5 + if cavs18: + time.sleep(0.01) # Needed on 1.8, or the command below won't send! + if done and not cavs15: dsp.HIPCTDA = 1<<31 # Signal done if send_msg: