linux-mediatek.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mailbox: mtk-cmdq: Fix pm_runtime_get_sync() warning in mbox shutdown
@ 2024-04-26  2:01 Jason-JH.Lin
  2024-04-29  7:51 ` AngeloGioacchino Del Regno
  0 siblings, 1 reply; 2+ messages in thread
From: Jason-JH.Lin @ 2024-04-26  2:01 UTC (permalink / raw)
  To: Jassi Brar, Chun-Kuang Hu, Matthias Brugger
  Cc: AngeloGioacchino Del Regno, Jason-ch Chen, Jason-JH . Lin,
	Singo Chang, Nancy Lin, Shawn Sung, linux-kernel,
	linux-arm-kernel, linux-mediatek,
	Project_Global_Chrome_Upstream_Group

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>
---
 drivers/mailbox/mtk-cmdq-mailbox.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mailbox/mtk-cmdq-mailbox.c b/drivers/mailbox/mtk-cmdq-mailbox.c
index ead2200f39ba..033aff11f87c 100644
--- a/drivers/mailbox/mtk-cmdq-mailbox.c
+++ b/drivers/mailbox/mtk-cmdq-mailbox.c
@@ -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))
-- 
2.18.0



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] mailbox: mtk-cmdq: Fix pm_runtime_get_sync() warning in mbox shutdown
  2024-04-26  2:01 [PATCH] mailbox: mtk-cmdq: Fix pm_runtime_get_sync() warning in mbox shutdown Jason-JH.Lin
@ 2024-04-29  7:51 ` AngeloGioacchino Del Regno
  0 siblings, 0 replies; 2+ messages in thread
From: AngeloGioacchino Del Regno @ 2024-04-29  7:51 UTC (permalink / raw)
  To: Jason-JH.Lin, Jassi Brar, Chun-Kuang Hu, Matthias Brugger
  Cc: Jason-ch Chen, Singo Chang, Nancy Lin, Shawn Sung, linux-kernel,
	linux-arm-kernel, linux-mediatek,
	Project_Global_Chrome_Upstream_Group

Il 26/04/24 04:01, Jason-JH.Lin ha scritto:
> 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>




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-04-29  7:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-26  2:01 [PATCH] mailbox: mtk-cmdq: Fix pm_runtime_get_sync() warning in mbox shutdown Jason-JH.Lin
2024-04-29  7:51 ` AngeloGioacchino Del Regno

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).