Tool/software:
Hi everyone,
on ti-linux-6.6.y, drivers/remoteproc/ti_k3_r5_remoteproc.c, I noticed during k3_r5_rproc_stop() call, a message is sent to the remote core (cortex R5). If the firmware does not reply to this message, it stays into the mailbox preventing the system to go into suspend mode (echo mem > /sys/power/state):
platform 79000000.r5f: k3_r5_suspend: timedout waiting for rproc completion event
omap-mailbox 29010000.mailbox: fifo 1 has unexpected unread messages
omap-mailbox 29010000.mailbox: PM: dpm_run_callback(): omap_mbox_suspend+0x0/0xc4 [omap_mailbox] returns -16
If 'stop' is not called, then the suspend works fine.
'ti_k3_m4_remoteproc' driver does free the mailbox channel during the stop function, therefore I added the same to 'ti_k3_r5_remoteproc' driver to fix suspend on the AM62P SoC:
```diff
diff --git a/drivers/remoteproc/ti_k3_r5_remoteproc.c b/drivers/remoteproc/ti_k3_r5_remoteproc.c
index 42a1afed490c..95bd276995a7 100644
--- a/drivers/remoteproc/ti_k3_r5_remoteproc.c
+++ b/drivers/remoteproc/ti_k3_r5_remoteproc.c
@@ -836,6 +836,8 @@ static int k3_r5_rproc_stop(struct rproc *rproc)
return ret;
}
+ mbox_free_channel(kproc->mbox);
+
ret = wait_for_completion_timeout(&kproc->shut_comp, to);
```
I would like to know if this is indeed the correct approach, and if so, if this can be fixed into ti-linux kernel.
Thanks for your time,
Hiago.