summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChun-Kuang Hu <chunkuang.hu@kernel.org>2021-03-15 07:33:22 +0800
committerJassi Brar <jaswinder.singh@linaro.org>2021-06-26 11:40:07 -0500
commit1b6b0ce2240e717bd5839cc106a0bf6cdbac9abc (patch)
tree90ce64ae4c484a56f5cfe3c91ec3f3992a6d04e3
parentb3c0d72b092e52ae7369b52fb97f63eb2ea7f16a (diff)
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 <chunkuang.hu@kernel.org> Reviewed-by: Yongqiang Niu <yongqiang.niu@mediatek.com> Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
-rw-r--r--drivers/mailbox/mtk-cmdq-mailbox.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/mailbox/mtk-cmdq-mailbox.c b/drivers/mailbox/mtk-cmdq-mailbox.c
index 1f2edc9521c1..7dfd0c9d7bbd 100644
--- a/drivers/mailbox/mtk-cmdq-mailbox.c
+++ b/drivers/mailbox/mtk-cmdq-mailbox.c
@@ -188,7 +188,10 @@ static void cmdq_task_exec_done(struct cmdq_task *task, int sta)
WARN_ON(cb->cb == (cmdq_async_flush_cb)NULL);
data.sta = sta;
data.data = cb->data;
- cb->cb(data);
+ if (cb->cb)
+ cb->cb(data);
+
+ mbox_chan_received_data(task->thread->chan, &data);
list_del(&task->list_entry);
}
@@ -451,12 +454,13 @@ static int cmdq_mbox_flush(struct mbox_chan *chan, unsigned long timeout)
list_for_each_entry_safe(task, tmp, &thread->task_busy_list,
list_entry) {
+ data.sta = -ECONNABORTED;
+ data.data = cb->data;
cb = &task->pkt->async_cb;
- if (cb->cb) {
- data.sta = -ECONNABORTED;
- data.data = cb->data;
+ if (cb->cb)
cb->cb(data);
- }
+
+ mbox_chan_received_data(task->thread->chan, &data);
list_del(&task->list_entry);
kfree(task);
}