diff options
author | Chun-Kuang Hu <chunkuang.hu@kernel.org> | 2021-03-15 00:33:22 +0100 |
---|---|---|
committer | Jassi Brar <jaswinder.singh@linaro.org> | 2021-06-26 18:40:07 +0200 |
commit | 1b6b0ce2240e717bd5839cc106a0bf6cdbac9abc (patch) | |
tree | 90ce64ae4c484a56f5cfe3c91ec3f3992a6d04e3 /drivers/mailbox/mtk-cmdq-mailbox.c | |
parent | mailbox: mtk-cmdq: Remove cmdq_cb_status (diff) | |
download | linux-1b6b0ce2240e717bd5839cc106a0bf6cdbac9abc.tar.xz linux-1b6b0ce2240e717bd5839cc106a0bf6cdbac9abc.zip |
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>
Diffstat (limited to 'drivers/mailbox/mtk-cmdq-mailbox.c')
-rw-r--r-- | drivers/mailbox/mtk-cmdq-mailbox.c | 14 |
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); } |