[PATCH 1/2] mailbox: mtk-cmdq: Add mminfra_offset to the error resume address

From: Jason-JH Lin

Date: Tue Dec 01 2026 - 06:27:56 EST


From: Jason-jh Lin <jason-jh.lin@xxxxxxxxxxxx>

After an error, cmdq_task_handle_error() moves the thread PC to the
next task with next_task->pa_base >> shift. All other writes of a task
address to CMDQ_THR_CURR_ADDR go through cmdq_convert_gce_addr(), which
also adds mminfra_offset. On SoCs with a non-zero mminfra_offset (e.g.
MT8196, SZ_2G), the thread resumes from the wrong PC after an error.

Use cmdq_convert_gce_addr() here as well.

Fixes: ddb5d0c941c6 ("mailbox: mtk-cmdq: Add mminfra_offset configuration for DRAM transaction")
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Jason-jh Lin <jason-jh.lin@xxxxxxxxxxxx>
---
drivers/mailbox/mtk-cmdq-mailbox.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mailbox/mtk-cmdq-mailbox.c b/drivers/mailbox/mtk-cmdq-mailbox.c
index f1eb886368cc..191122b4c94f 100644
--- a/drivers/mailbox/mtk-cmdq-mailbox.c
+++ b/drivers/mailbox/mtk-cmdq-mailbox.c
@@ -300,7 +300,7 @@ static void cmdq_task_handle_error(struct cmdq_task *task)
next_task = list_first_entry_or_null(&thread->task_busy_list,
struct cmdq_task, list_entry);
if (next_task)
- writel(next_task->pa_base >> cmdq->pdata->shift,
+ writel(cmdq_convert_gce_addr(next_task->pa_base, cmdq->pdata),
thread->base + CMDQ_THR_CURR_ADDR);
cmdq_thread_resume(thread);
}
--
2.43.0