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-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211206131242.2697464-2-martin.kepplinger@puri.sm>
Date:   Mon,  6 Dec 2021 14:12:41 +0100
From:   Martin Kepplinger <martin.kepplinger@...i.sm>
To:     slongerbeam@...il.com, p.zabel@...gutronix.de, mchehab@...nel.org,
        laurent.pinchart@...asonboard.com
Cc:     kernel@...gutronix.de, festevam@...il.com, linux-imx@....com,
        linux-media@...r.kernel.org, linux-staging@...ts.linux.dev,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
        Martin Kepplinger <martin.kepplinger@...i.sm>
Subject: [PATCH v1 1/2] media: imx: imx8mq-mipi-csi2: fix system resume issue

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@...i.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ