mailbox: mtk-cmdq: Fix pm_runtime_get_sync() warning in mbox shutdown
authorJason-JH.Lin <jason-jh.lin@mediatek.com>
Fri, 26 Apr 2024 02:01:21 +0000 (10:01 +0800)
committerJassi Brar <jassisinghbrar@gmail.com>
Mon, 20 May 2024 03:32:13 +0000 (22:32 -0500)
The return value of pm_runtime_get_sync() in cmdq_mbox_shutdown()
will return 1 when pm runtime state is active, and we don't want to
get the warning message in this case.

So we change the return value < 0 for WARN_ON().

Fixes: 8afe816b0c99 ("mailbox: mtk-cmdq-mailbox: Implement Runtime PM with autosuspend")
Signed-off-by: Jason-JH.Lin <jason-jh.lin@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Jassi Brar <jassisinghbrar@gmail.com>
drivers/mailbox/mtk-cmdq-mailbox.c

index 080d091e28acfb5b44744cf71c8f11623164d21b..4aa394e91109c8c8369c08865ce5ebcfaa8797b7 100644 (file)
@@ -465,7 +465,7 @@ static void cmdq_mbox_shutdown(struct mbox_chan *chan)
        struct cmdq_task *task, *tmp;
        unsigned long flags;
 
-       WARN_ON(pm_runtime_get_sync(cmdq->mbox.dev));
+       WARN_ON(pm_runtime_get_sync(cmdq->mbox.dev) < 0);
 
        spin_lock_irqsave(&thread->chan->lock, flags);
        if (list_empty(&thread->task_busy_list))