linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Martin Kepplinger <martin.kepplinger@puri.sm>
To: slongerbeam@gmail.com, p.zabel@pengutronix.de,
	mchehab@kernel.org, laurent.pinchart@ideasonboard.com
Cc: kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com,
	linux-media@vger.kernel.org, linux-staging@lists.linux.dev,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	Martin Kepplinger <martin.kepplinger@puri.sm>
Subject: [PATCH v1 1/2] media: imx: imx8mq-mipi-csi2: fix system resume issue
Date: Mon,  6 Dec 2021 14:12:41 +0100	[thread overview]
Message-ID: <20211206131242.2697464-2-martin.kepplinger@puri.sm> (raw)
In-Reply-To: <20211206131242.2697464-1-martin.kepplinger@puri.sm>

during system resume, interconnect bandwidth would be requested even
though the device is runtime suspended. This leaves the system in an
unbalanced state. Fix that by checking the state before.

Signed-off-by: Martin Kepplinger <martin.kepplinger@puri.sm>
---
 drivers/staging/media/imx/imx8mq-mipi-csi2.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/staging/media/imx/imx8mq-mipi-csi2.c b/drivers/staging/media/imx/imx8mq-mipi-csi2.c
index 7adbdd14daa9..31a1e43733a0 100644
--- a/drivers/staging/media/imx/imx8mq-mipi-csi2.c
+++ b/drivers/staging/media/imx/imx8mq-mipi-csi2.c
@@ -714,6 +714,9 @@ static int imx8mq_mipi_csi_pm_suspend(struct device *dev, bool runtime)
 
 	mutex_unlock(&state->lock);
 
+	if (!runtime && pm_runtime_suspended(state->dev))
+		return 0;
+
 	ret = icc_set_bw(state->icc_path, 0, 0);
 	if (ret)
 		dev_err(dev, "icc_set_bw failed with %d\n", ret);
@@ -727,6 +730,9 @@ static int imx8mq_mipi_csi_pm_resume(struct device *dev, bool runtime)
 	struct csi_state *state = mipi_sd_to_csi2_state(sd);
 	int ret = 0;
 
+	if (!runtime && pm_runtime_suspended(state->dev))
+		return 0;
+
 	ret = icc_set_bw(state->icc_path, 0, state->icc_path_bw);
 	if (ret) {
 		dev_err(dev, "icc_set_bw failed with %d\n", ret);
-- 
2.30.2


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

  reply	other threads:[~2021-12-06 13:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-06 13:12 [PATCH v1 0/2] media: imx: imx8mq-mipi-csi2 fixes Martin Kepplinger
2021-12-06 13:12 ` Martin Kepplinger [this message]
2021-12-06 13:12 ` [PATCH v1 2/2] media: imx: imx8mq-mipi-csi2: remove wrong irq config write operation Martin Kepplinger

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=20211206131242.2697464-2-martin.kepplinger@puri.sm \
    --to=martin.kepplinger@puri.sm \
    --cc=festevam@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=mchehab@kernel.org \
    --cc=p.zabel@pengutronix.de \
    --cc=slongerbeam@gmail.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 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).