hi Laurent and all interested,
these are fixes for the imx8mq mipi controller driver I collected recently.
thank you very much for any review,
martin
Martin Kepplinger (2):
media: imx: imx8mq-mipi-csi2: fix system resume issue
media: imx: imx8mq-mipi-csi2: remove wrong irq config write operation
drivers/staging/media/imx/imx8mq-mipi-csi2.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
--
2.30.2
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 <[email protected]>
---
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
The place where this register writel() that masks one interrupt is placed
does not guarantee that the device is powered so that's not allowed. Moreover
imx8mq_mipi_csi_start_stream() masks the interrupt anyway so the
write is not even needed. Remove it as this is a mistake that slipped in
with the driver.
Fixes: f33fd8d77dd0 ("media: imx: add a driver for i.MX8MQ mipi csi rx phy and controller")
Signed-off-by: Martin Kepplinger <[email protected]>
---
drivers/staging/media/imx/imx8mq-mipi-csi2.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/staging/media/imx/imx8mq-mipi-csi2.c b/drivers/staging/media/imx/imx8mq-mipi-csi2.c
index 31a1e43733a0..776a00eed550 100644
--- a/drivers/staging/media/imx/imx8mq-mipi-csi2.c
+++ b/drivers/staging/media/imx/imx8mq-mipi-csi2.c
@@ -398,9 +398,6 @@ static int imx8mq_mipi_csi_s_stream(struct v4l2_subdev *sd, int enable)
struct csi_state *state = mipi_sd_to_csi2_state(sd);
int ret = 0;
- imx8mq_mipi_csi_write(state, CSI2RX_IRQ_MASK,
- CSI2RX_IRQ_MASK_ULPS_STATUS_CHANGE);
-
if (enable) {
ret = pm_runtime_resume_and_get(state->dev);
if (ret < 0)
--
2.30.2