Skip to content

Commit 1b6b0ce

Browse files
Chun-Kuang HuJassiBrar
authored andcommitted
mailbox: mtk-cmdq: Use mailbox rx_callback
rx_callback is a standard mailbox callback mechanism and could cover the function of proprietary cmdq_task_cb, so use the standard one instead of the proprietary one. But the client driver has already used cmdq_task_cb, so keep cmdq_task_cb until all client driver use rx_callback instead of cmdq_task_cb. Signed-off-by: Chun-Kuang Hu <[email protected]> Reviewed-by: Yongqiang Niu <[email protected]> Signed-off-by: Jassi Brar <[email protected]>
1 parent b3c0d72 commit 1b6b0ce

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

drivers/mailbox/mtk-cmdq-mailbox.c

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,10 @@ static void cmdq_task_exec_done(struct cmdq_task *task, int sta)
188188
WARN_ON(cb->cb == (cmdq_async_flush_cb)NULL);
189189
data.sta = sta;
190190
data.data = cb->data;
191-
cb->cb(data);
191+
if (cb->cb)
192+
cb->cb(data);
193+
194+
mbox_chan_received_data(task->thread->chan, &data);
192195

193196
list_del(&task->list_entry);
194197
}
@@ -451,12 +454,13 @@ static int cmdq_mbox_flush(struct mbox_chan *chan, unsigned long timeout)
451454

452455
list_for_each_entry_safe(task, tmp, &thread->task_busy_list,
453456
list_entry) {
457+
data.sta = -ECONNABORTED;
458+
data.data = cb->data;
454459
cb = &task->pkt->async_cb;
455-
if (cb->cb) {
456-
data.sta = -ECONNABORTED;
457-
data.data = cb->data;
460+
if (cb->cb)
458461
cb->cb(data);
459-
}
462+
463+
mbox_chan_received_data(task->thread->chan, &data);
460464
list_del(&task->list_entry);
461465
kfree(task);
462466
}

0 commit comments

Comments
 (0)