Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mailbox: mtk-cmdq: Fix CURR and END addr for task insert case

Fix CURR and END address calculation for inserting a cmdq task into the
task list by using cmdq_reg_shift_addr() for proper address converting.
This ensures both CURR and END addresses are set correctly when
enabling the thread.

Fixes: a195c7ccfb7a ("mailbox: mtk-cmdq: Refine DMA address handling for the command buffer")
Signed-off-by: Jason-JH Lin <jason-jh.lin@mediatek.com>
Signed-off-by: Jassi Brar <jassisinghbrar@gmail.com>

authored by

Jason-JH Lin and committed by
Jassi Brar
d2591db9 1e0ec971

+4 -4
+4 -4
drivers/mailbox/mtk-cmdq-mailbox.c
··· 493 493 if (curr_pa == end_pa - CMDQ_INST_SIZE || 494 494 curr_pa == end_pa) { 495 495 /* set to this task directly */ 496 - writel(task->pa_base >> cmdq->pdata->shift, 497 - thread->base + CMDQ_THR_CURR_ADDR); 496 + gce_addr = cmdq_convert_gce_addr(task->pa_base, cmdq->pdata); 497 + writel(gce_addr, thread->base + CMDQ_THR_CURR_ADDR); 498 498 } else { 499 499 cmdq_task_insert_into_thread(task); 500 500 smp_mb(); /* modify jump before enable thread */ 501 501 } 502 - writel((task->pa_base + pkt->cmd_buf_size) >> cmdq->pdata->shift, 503 - thread->base + CMDQ_THR_END_ADDR); 502 + gce_addr = cmdq_convert_gce_addr(task->pa_base + pkt->cmd_buf_size, cmdq->pdata); 503 + writel(gce_addr, thread->base + CMDQ_THR_END_ADDR); 504 504 cmdq_thread_resume(thread); 505 505 } 506 506 list_move_tail(&task->list_entry, &thread->task_busy_list);