mirror of
https://github.com/torvalds/linux.git
synced 2026-05-30 10:04:04 +02:00
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: a195c7ccfb ("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>
This commit is contained in:
parent
1e0ec9719f
commit
d2591db9c8
|
|
@ -493,14 +493,14 @@ static int cmdq_mbox_send_data(struct mbox_chan *chan, void *data)
|
|||
if (curr_pa == end_pa - CMDQ_INST_SIZE ||
|
||||
curr_pa == end_pa) {
|
||||
/* set to this task directly */
|
||||
writel(task->pa_base >> cmdq->pdata->shift,
|
||||
thread->base + CMDQ_THR_CURR_ADDR);
|
||||
gce_addr = cmdq_convert_gce_addr(task->pa_base, cmdq->pdata);
|
||||
writel(gce_addr, thread->base + CMDQ_THR_CURR_ADDR);
|
||||
} else {
|
||||
cmdq_task_insert_into_thread(task);
|
||||
smp_mb(); /* modify jump before enable thread */
|
||||
}
|
||||
writel((task->pa_base + pkt->cmd_buf_size) >> cmdq->pdata->shift,
|
||||
thread->base + CMDQ_THR_END_ADDR);
|
||||
gce_addr = cmdq_convert_gce_addr(task->pa_base + pkt->cmd_buf_size, cmdq->pdata);
|
||||
writel(gce_addr, thread->base + CMDQ_THR_END_ADDR);
|
||||
cmdq_thread_resume(thread);
|
||||
}
|
||||
list_move_tail(&task->list_entry, &thread->task_busy_list);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user