All of lore.kernel.org
 help / color / mirror / Atom feed
From: jason-jh.lin <jason-jh.lin@mediatek.com>
To: Chun-Kuang Hu <chunkuang.hu@kernel.org>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	Jassi Brar <jassisinghbrar@gmail.com>
Cc: fshao@chromium.org, David Airlie <airlied@linux.ie>,
	"jason-jh.lin" <jason-jh.lin@mediatek.com>,
	singo.chang@mediatek.com, linux-kernel@vger.kernel.org,
	dri-devel@lists.freedesktop.org, tzungbi@google.com,
	nancy.lin@mediatek.com, linux-mediatek@lists.infradead.org,
	hsinyi@chromium.org, linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/3] mialbox: move cmdq suspend, resume and remove after cmdq_mbox_flush
Date: Wed, 17 Nov 2021 14:41:56 +0800	[thread overview]
Message-ID: <20211117064158.27451-2-jason-jh.lin@mediatek.com> (raw)
In-Reply-To: <20211117064158.27451-1-jason-jh.lin@mediatek.com>

Move the function order to make sure cmdq_mbox_flush is declared
before cmdq_suspend calling it.

Signed-off-by: jason-jh.lin <jason-jh.lin@mediatek.com>
---
 drivers/mailbox/mtk-cmdq-mailbox.c | 84 +++++++++++++++---------------
 1 file changed, 42 insertions(+), 42 deletions(-)

diff --git a/drivers/mailbox/mtk-cmdq-mailbox.c b/drivers/mailbox/mtk-cmdq-mailbox.c
index c591dab9d5a4..03f9ed4c5131 100644
--- a/drivers/mailbox/mtk-cmdq-mailbox.c
+++ b/drivers/mailbox/mtk-cmdq-mailbox.c
@@ -296,48 +296,6 @@ static irqreturn_t cmdq_irq_handler(int irq, void *dev)
 	return IRQ_HANDLED;
 }
 
-static int cmdq_suspend(struct device *dev)
-{
-	struct cmdq *cmdq = dev_get_drvdata(dev);
-	struct cmdq_thread *thread;
-	int i;
-	bool task_running = false;
-
-	cmdq->suspended = true;
-
-	for (i = 0; i < cmdq->thread_nr; i++) {
-		thread = &cmdq->thread[i];
-		if (!list_empty(&thread->task_busy_list)) {
-			task_running = true;
-			break;
-		}
-	}
-
-	if (task_running)
-		dev_warn(dev, "exist running task(s) in suspend\n");
-
-	clk_bulk_unprepare(cmdq->gce_num, cmdq->clocks);
-
-	return 0;
-}
-
-static int cmdq_resume(struct device *dev)
-{
-	struct cmdq *cmdq = dev_get_drvdata(dev);
-
-	WARN_ON(clk_bulk_prepare(cmdq->gce_num, cmdq->clocks));
-	cmdq->suspended = false;
-	return 0;
-}
-
-static int cmdq_remove(struct platform_device *pdev)
-{
-	struct cmdq *cmdq = platform_get_drvdata(pdev);
-
-	clk_bulk_unprepare(cmdq->gce_num, cmdq->clocks);
-	return 0;
-}
-
 static int cmdq_mbox_send_data(struct mbox_chan *chan, void *data)
 {
 	struct cmdq_pkt *pkt = (struct cmdq_pkt *)data;
@@ -521,6 +479,48 @@ static struct mbox_chan *cmdq_xlate(struct mbox_controller *mbox,
 	return &mbox->chans[ind];
 }
 
+static int cmdq_suspend(struct device *dev)
+{
+	struct cmdq *cmdq = dev_get_drvdata(dev);
+	struct cmdq_thread *thread;
+	int i;
+	bool task_running = false;
+
+	cmdq->suspended = true;
+
+	for (i = 0; i < cmdq->thread_nr; i++) {
+		thread = &cmdq->thread[i];
+		if (!list_empty(&thread->task_busy_list)) {
+			task_running = true;
+			break;
+		}
+	}
+
+	if (task_running)
+		dev_warn(dev, "exist running task(s) in suspend\n");
+
+	clk_bulk_unprepare(cmdq->gce_num, cmdq->clocks);
+
+	return 0;
+}
+
+static int cmdq_resume(struct device *dev)
+{
+	struct cmdq *cmdq = dev_get_drvdata(dev);
+
+	WARN_ON(clk_bulk_prepare(cmdq->gce_num, cmdq->clocks));
+	cmdq->suspended = false;
+	return 0;
+}
+
+static int cmdq_remove(struct platform_device *pdev)
+{
+	struct cmdq *cmdq = platform_get_drvdata(pdev);
+
+	clk_bulk_unprepare(cmdq->gce_num, cmdq->clocks);
+	return 0;
+}
+
 static int cmdq_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
-- 
2.18.0


WARNING: multiple messages have this Message-ID (diff)
From: jason-jh.lin <jason-jh.lin@mediatek.com>
To: Chun-Kuang Hu <chunkuang.hu@kernel.org>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	"Jassi Brar" <jassisinghbrar@gmail.com>
Cc: David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
	<dri-devel@lists.freedesktop.org>,
	<linux-mediatek@lists.infradead.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>, <hsinyi@chromium.org>,
	<fshao@chromium.org>, <tzungbi@google.com>,
	<nancy.lin@mediatek.com>, <singo.chang@mediatek.com>,
	jason-jh.lin <jason-jh.lin@mediatek.com>
Subject: [PATCH 1/3] mialbox: move cmdq suspend, resume and remove after cmdq_mbox_flush
Date: Wed, 17 Nov 2021 14:41:56 +0800	[thread overview]
Message-ID: <20211117064158.27451-2-jason-jh.lin@mediatek.com> (raw)
In-Reply-To: <20211117064158.27451-1-jason-jh.lin@mediatek.com>

Move the function order to make sure cmdq_mbox_flush is declared
before cmdq_suspend calling it.

Signed-off-by: jason-jh.lin <jason-jh.lin@mediatek.com>
---
 drivers/mailbox/mtk-cmdq-mailbox.c | 84 +++++++++++++++---------------
 1 file changed, 42 insertions(+), 42 deletions(-)

diff --git a/drivers/mailbox/mtk-cmdq-mailbox.c b/drivers/mailbox/mtk-cmdq-mailbox.c
index c591dab9d5a4..03f9ed4c5131 100644
--- a/drivers/mailbox/mtk-cmdq-mailbox.c
+++ b/drivers/mailbox/mtk-cmdq-mailbox.c
@@ -296,48 +296,6 @@ static irqreturn_t cmdq_irq_handler(int irq, void *dev)
 	return IRQ_HANDLED;
 }
 
-static int cmdq_suspend(struct device *dev)
-{
-	struct cmdq *cmdq = dev_get_drvdata(dev);
-	struct cmdq_thread *thread;
-	int i;
-	bool task_running = false;
-
-	cmdq->suspended = true;
-
-	for (i = 0; i < cmdq->thread_nr; i++) {
-		thread = &cmdq->thread[i];
-		if (!list_empty(&thread->task_busy_list)) {
-			task_running = true;
-			break;
-		}
-	}
-
-	if (task_running)
-		dev_warn(dev, "exist running task(s) in suspend\n");
-
-	clk_bulk_unprepare(cmdq->gce_num, cmdq->clocks);
-
-	return 0;
-}
-
-static int cmdq_resume(struct device *dev)
-{
-	struct cmdq *cmdq = dev_get_drvdata(dev);
-
-	WARN_ON(clk_bulk_prepare(cmdq->gce_num, cmdq->clocks));
-	cmdq->suspended = false;
-	return 0;
-}
-
-static int cmdq_remove(struct platform_device *pdev)
-{
-	struct cmdq *cmdq = platform_get_drvdata(pdev);
-
-	clk_bulk_unprepare(cmdq->gce_num, cmdq->clocks);
-	return 0;
-}
-
 static int cmdq_mbox_send_data(struct mbox_chan *chan, void *data)
 {
 	struct cmdq_pkt *pkt = (struct cmdq_pkt *)data;
@@ -521,6 +479,48 @@ static struct mbox_chan *cmdq_xlate(struct mbox_controller *mbox,
 	return &mbox->chans[ind];
 }
 
+static int cmdq_suspend(struct device *dev)
+{
+	struct cmdq *cmdq = dev_get_drvdata(dev);
+	struct cmdq_thread *thread;
+	int i;
+	bool task_running = false;
+
+	cmdq->suspended = true;
+
+	for (i = 0; i < cmdq->thread_nr; i++) {
+		thread = &cmdq->thread[i];
+		if (!list_empty(&thread->task_busy_list)) {
+			task_running = true;
+			break;
+		}
+	}
+
+	if (task_running)
+		dev_warn(dev, "exist running task(s) in suspend\n");
+
+	clk_bulk_unprepare(cmdq->gce_num, cmdq->clocks);
+
+	return 0;
+}
+
+static int cmdq_resume(struct device *dev)
+{
+	struct cmdq *cmdq = dev_get_drvdata(dev);
+
+	WARN_ON(clk_bulk_prepare(cmdq->gce_num, cmdq->clocks));
+	cmdq->suspended = false;
+	return 0;
+}
+
+static int cmdq_remove(struct platform_device *pdev)
+{
+	struct cmdq *cmdq = platform_get_drvdata(pdev);
+
+	clk_bulk_unprepare(cmdq->gce_num, cmdq->clocks);
+	return 0;
+}
+
 static int cmdq_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
-- 
2.18.0


_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

WARNING: multiple messages have this Message-ID (diff)
From: jason-jh.lin <jason-jh.lin@mediatek.com>
To: Chun-Kuang Hu <chunkuang.hu@kernel.org>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	"Jassi Brar" <jassisinghbrar@gmail.com>
Cc: David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
	<dri-devel@lists.freedesktop.org>,
	<linux-mediatek@lists.infradead.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>, <hsinyi@chromium.org>,
	<fshao@chromium.org>, <tzungbi@google.com>,
	<nancy.lin@mediatek.com>, <singo.chang@mediatek.com>,
	jason-jh.lin <jason-jh.lin@mediatek.com>
Subject: [PATCH 1/3] mialbox: move cmdq suspend, resume and remove after cmdq_mbox_flush
Date: Wed, 17 Nov 2021 14:41:56 +0800	[thread overview]
Message-ID: <20211117064158.27451-2-jason-jh.lin@mediatek.com> (raw)
In-Reply-To: <20211117064158.27451-1-jason-jh.lin@mediatek.com>

Move the function order to make sure cmdq_mbox_flush is declared
before cmdq_suspend calling it.

Signed-off-by: jason-jh.lin <jason-jh.lin@mediatek.com>
---
 drivers/mailbox/mtk-cmdq-mailbox.c | 84 +++++++++++++++---------------
 1 file changed, 42 insertions(+), 42 deletions(-)

diff --git a/drivers/mailbox/mtk-cmdq-mailbox.c b/drivers/mailbox/mtk-cmdq-mailbox.c
index c591dab9d5a4..03f9ed4c5131 100644
--- a/drivers/mailbox/mtk-cmdq-mailbox.c
+++ b/drivers/mailbox/mtk-cmdq-mailbox.c
@@ -296,48 +296,6 @@ static irqreturn_t cmdq_irq_handler(int irq, void *dev)
 	return IRQ_HANDLED;
 }
 
-static int cmdq_suspend(struct device *dev)
-{
-	struct cmdq *cmdq = dev_get_drvdata(dev);
-	struct cmdq_thread *thread;
-	int i;
-	bool task_running = false;
-
-	cmdq->suspended = true;
-
-	for (i = 0; i < cmdq->thread_nr; i++) {
-		thread = &cmdq->thread[i];
-		if (!list_empty(&thread->task_busy_list)) {
-			task_running = true;
-			break;
-		}
-	}
-
-	if (task_running)
-		dev_warn(dev, "exist running task(s) in suspend\n");
-
-	clk_bulk_unprepare(cmdq->gce_num, cmdq->clocks);
-
-	return 0;
-}
-
-static int cmdq_resume(struct device *dev)
-{
-	struct cmdq *cmdq = dev_get_drvdata(dev);
-
-	WARN_ON(clk_bulk_prepare(cmdq->gce_num, cmdq->clocks));
-	cmdq->suspended = false;
-	return 0;
-}
-
-static int cmdq_remove(struct platform_device *pdev)
-{
-	struct cmdq *cmdq = platform_get_drvdata(pdev);
-
-	clk_bulk_unprepare(cmdq->gce_num, cmdq->clocks);
-	return 0;
-}
-
 static int cmdq_mbox_send_data(struct mbox_chan *chan, void *data)
 {
 	struct cmdq_pkt *pkt = (struct cmdq_pkt *)data;
@@ -521,6 +479,48 @@ static struct mbox_chan *cmdq_xlate(struct mbox_controller *mbox,
 	return &mbox->chans[ind];
 }
 
+static int cmdq_suspend(struct device *dev)
+{
+	struct cmdq *cmdq = dev_get_drvdata(dev);
+	struct cmdq_thread *thread;
+	int i;
+	bool task_running = false;
+
+	cmdq->suspended = true;
+
+	for (i = 0; i < cmdq->thread_nr; i++) {
+		thread = &cmdq->thread[i];
+		if (!list_empty(&thread->task_busy_list)) {
+			task_running = true;
+			break;
+		}
+	}
+
+	if (task_running)
+		dev_warn(dev, "exist running task(s) in suspend\n");
+
+	clk_bulk_unprepare(cmdq->gce_num, cmdq->clocks);
+
+	return 0;
+}
+
+static int cmdq_resume(struct device *dev)
+{
+	struct cmdq *cmdq = dev_get_drvdata(dev);
+
+	WARN_ON(clk_bulk_prepare(cmdq->gce_num, cmdq->clocks));
+	cmdq->suspended = false;
+	return 0;
+}
+
+static int cmdq_remove(struct platform_device *pdev)
+{
+	struct cmdq *cmdq = platform_get_drvdata(pdev);
+
+	clk_bulk_unprepare(cmdq->gce_num, cmdq->clocks);
+	return 0;
+}
+
 static int cmdq_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
-- 
2.18.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2021-11-17  6:42 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-17  6:41 Fix drm suspend and resume issue jason-jh.lin
2021-11-17  6:41 ` jason-jh.lin
2021-11-17  6:41 ` jason-jh.lin
2021-11-17  6:41 ` jason-jh.lin [this message]
2021-11-17  6:41   ` [PATCH 1/3] mialbox: move cmdq suspend, resume and remove after cmdq_mbox_flush jason-jh.lin
2021-11-17  6:41   ` jason-jh.lin
2021-11-18  5:55   ` [PATCH 1/3] mialbox: move cmdq suspend,resume " Tzung-Bi Shih
2021-11-18  5:55     ` Tzung-Bi Shih
2021-11-18  5:55     ` Tzung-Bi Shih
2021-11-18  5:55     ` Tzung-Bi Shih
2021-11-28 14:50     ` Jason-JH Lin
2021-11-28 14:50       ` Jason-JH Lin
2021-11-28 14:50       ` Jason-JH Lin
2021-11-28 14:50       ` Jason-JH Lin
2021-11-17  6:41 ` [PATCH 2/3] mailbox: add cmdq_mbox_flush to clear all task before suspend jason-jh.lin
2021-11-17  6:41   ` jason-jh.lin
2021-11-17  6:41   ` jason-jh.lin
2021-11-19  0:01   ` Chun-Kuang Hu
2021-11-19  0:01     ` Chun-Kuang Hu
2021-11-19  0:01     ` Chun-Kuang Hu
2021-11-19  0:01     ` Chun-Kuang Hu
2021-11-28 15:40     ` Jason-JH Lin
2021-11-28 15:40       ` Jason-JH Lin
2021-11-28 15:40       ` Jason-JH Lin
2021-11-28 15:40       ` Jason-JH Lin
2021-11-17  6:41 ` [PATCH 3/3] drm/mediatek: add devlink to cmdq dev jason-jh.lin
2021-11-17  6:41   ` jason-jh.lin
2021-11-17  6:41   ` jason-jh.lin
2021-11-18  5:55   ` Tzung-Bi Shih
2021-11-18  5:55     ` Tzung-Bi Shih
2021-11-18  5:55     ` Tzung-Bi Shih
2021-11-18  5:55     ` Tzung-Bi Shih
     [not found]     ` <PU1PR03MB306252A252139515F7EA9ABCB8659@PU1PR03MB3062.apcprd03.prod.outlook.com>
2021-11-28 15:57       ` FW: " Jason-JH Lin
2021-11-28 16:02         ` Jason-JH Lin
2021-11-28 16:02         ` Jason-JH Lin
2021-11-28 16:02         ` Jason-JH Lin
2021-11-28 16:02         ` Jason-JH Lin
2021-11-28 15:57         ` Jason-JH Lin
2021-11-28 15:57         ` Jason-JH Lin
2021-11-28 15:57         ` Jason-JH Lin
2021-11-28 15:53         ` Jason-JH Lin
2021-11-18  5:54 ` Fix drm suspend and resume issue Tzung-Bi Shih
2021-11-18  5:54   ` Tzung-Bi Shih
2021-11-18  5:54   ` Tzung-Bi Shih
2021-11-18  5:54   ` Tzung-Bi Shih
2021-11-28 14:52   ` Jason-JH Lin
2021-11-28 14:52     ` Jason-JH Lin
2021-11-28 14:52     ` Jason-JH Lin
2021-11-28 14:52     ` Jason-JH Lin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211117064158.27451-2-jason-jh.lin@mediatek.com \
    --to=jason-jh.lin@mediatek.com \
    --cc=airlied@linux.ie \
    --cc=chunkuang.hu@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=fshao@chromium.org \
    --cc=hsinyi@chromium.org \
    --cc=jassisinghbrar@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=nancy.lin@mediatek.com \
    --cc=p.zabel@pengutronix.de \
    --cc=singo.chang@mediatek.com \
    --cc=tzungbi@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.