lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240929101635.1648234-1-guoniu.zhou@oss.nxp.com>
Date: Sun, 29 Sep 2024 18:16:35 +0800
From: guoniu.zhou@....nxp.com
To: rmfrfs@...il.com,
	laurent.pinchart@...asonboard.com,
	martink@...teo.de,
	kernel@...i.sm,
	mchehab@...nel.org,
	shawnguo@...nel.org,
	s.hauer@...gutronix.de,
	kernel@...gutronix.de,
	festevam@...il.com
Cc: imx@...ts.linux.dev,
	linux-media@...r.kernel.org,
	linux-arm-kernel@...ts.infradead.org,
	linux-kernel@...r.kernel.org
Subject: [PATCH] media: nxp: imx8mq-mipi-csi2: Fix CSI clocks always enabled issue

From: "Guoniu.zhou" <guoniu.zhou@....com>

Fix CSI clocks always enabled issue after run system suspend/resume.

The clocks for CSI will be enabled in imx8mq_mipi_csi_pm_resume()
when system resume and the state of CSI will be set to ST_POWERED.
It not only cause clock always enabled issue but also system hang
issue on iMX8ULP platform since imx8mq_mipi_csi_pm_suspend() will
access CSI registers if run system suspend/resume again, but the
CSI power domain is not active.

In order to fix this issue, using pm_runtime_force_suspend/resume
instead of calling imx8mq_mipi_csi_pm_suspend/resume directly.

Signed-off-by: Guoniu.zhou <guoniu.zhou@....com>
---
 drivers/media/platform/nxp/imx8mq-mipi-csi2.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/media/platform/nxp/imx8mq-mipi-csi2.c b/drivers/media/platform/nxp/imx8mq-mipi-csi2.c
index d4a6c5532969..15029bb81b35 100644
--- a/drivers/media/platform/nxp/imx8mq-mipi-csi2.c
+++ b/drivers/media/platform/nxp/imx8mq-mipi-csi2.c
@@ -697,8 +697,11 @@ static int imx8mq_mipi_csi_suspend(struct device *dev)
 {
 	struct v4l2_subdev *sd = dev_get_drvdata(dev);
 	struct csi_state *state = mipi_sd_to_csi2_state(sd);
+	int ret;
 
-	imx8mq_mipi_csi_pm_suspend(dev);
+	ret = pm_runtime_force_suspend(dev);
+	if (ret < 0)
+		return ret;
 
 	state->state |= ST_SUSPENDED;
 
@@ -713,7 +716,7 @@ static int imx8mq_mipi_csi_resume(struct device *dev)
 	if (!(state->state & ST_SUSPENDED))
 		return 0;
 
-	return imx8mq_mipi_csi_pm_resume(dev);
+	return pm_runtime_force_resume(dev);
 }
 
 static int imx8mq_mipi_csi_runtime_suspend(struct device *dev)
-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ