mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v3 1/2] media: imagination: e5010: Move e5010_init_device to Runtime Resume Hook
@ 2026-08-10 15:54 Brandon Brnich
  2026-08-10 15:54 ` [PATCH v3 2/2] media: imagination: e5010: Enable autosuspend for runtime PM Brandon Brnich
  2026-08-10 16:48 ` [PATCH v3 1/2] media: imagination: e5010: Move e5010_init_device to Runtime Resume Hook Kendall Willis
  0 siblings, 2 replies; 3+ messages in thread
From: Brandon Brnich @ 2026-08-10 15:54 UTC (permalink / raw)
  To: devarsht, mchehab, hverkuil, benjamin.gaignard
  Cc: linux-media, linux-kernel, jai.luthra, k-willis, b-brnich, stable

The PM framework skips the runtime resume hook if the device was never on
in the first place. This results in a crash in the system resume hook when
a call to e5010_init_device attempts a write to a powered down device.

Move e5010_init_device to the resume hook to ensure register write only
occurs when device is properly powered on.

Fixes: a1e294045885 ("media: imagination: Add E5010 JPEG Encoder driver")
Cc: stable@vger.kernel.org
Signed-off-by: Brandon Brnich <b-brnich@ti.com>
Reviewed-by: Jai Luthra <jai.luthra@ideasonboard.com>
---
 drivers/media/platform/imagination/e5010-jpeg-enc.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/media/platform/imagination/e5010-jpeg-enc.c b/drivers/media/platform/imagination/e5010-jpeg-enc.c
index 42ad9ee3993b4..2b98d230429d1 100644
--- a/drivers/media/platform/imagination/e5010-jpeg-enc.c
+++ b/drivers/media/platform/imagination/e5010-jpeg-enc.c
@@ -1501,6 +1501,13 @@ static int e5010_runtime_resume(struct device *dev)
 		return ret;
 	}
 
+	ret = e5010_init_device(e5010);
+	if (ret) {
+		dev_err(dev, "Failed to re-enable e5010 device\n");
+		clk_disable_unprepare(e5010->clk);
+		return ret;
+	}
+
 	return 0;
 }
 
@@ -1533,12 +1540,6 @@ static int e5010_resume(struct device *dev)
 	if (ret < 0)
 		return ret;
 
-	ret = e5010_init_device(e5010);
-	if (ret) {
-		dev_err(dev, "Failed to re-enable e5010 device\n");
-		return ret;
-	}
-
 	v4l2_m2m_resume(e5010->m2m_dev);
 
 	return ret;
-- 
2.43.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-08-10 16:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-10 15:54 [PATCH v3 1/2] media: imagination: e5010: Move e5010_init_device to Runtime Resume Hook Brandon Brnich
2026-08-10 15:54 ` [PATCH v3 2/2] media: imagination: e5010: Enable autosuspend for runtime PM Brandon Brnich
2026-08-10 16:48 ` [PATCH v3 1/2] media: imagination: e5010: Move e5010_init_device to Runtime Resume Hook Kendall Willis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®