Skip to contentSkip to conversation

media: ov5648: Fix order of a call to pm_runtime_set_suspended

PATCH In review Ondřej Jirman 2 participants 3 messages Jul 25 – Jul 27

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 media: ov5648: Fix order of a call to pm_runtime_set_suspended

From: Ondrej Jirman <[email protected]>

It should be done when RPM is disabled.

---
 drivers/media/i2c/ov5648.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/i2c/ov5648.c +1 -1
index f0b839cd65f1..0643440a6f5d 100644
@@ -2566,8 +2566,8 @@ static int ov5648_probe(struct i2c_client *client)
 
 	/* Runtime PM */
 
-	pm_runtime_enable(sensor->dev);
 	pm_runtime_set_suspended(sensor->dev);
+	pm_runtime_enable(sensor->dev);
 
 	/* V4L2 subdev register */
 
Signature · 1 line
2.54.0
maintainer
#1 lore raw

Hi Ondřej,

Thanks for the patch.

Quoted 14 lines · Ondřej Jirman

From: Ondrej Jirman <[email protected]>

It should be done when RPM is disabled.

---
 drivers/media/i2c/ov5648.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/i2c/ov5648.c +0 -0
index f0b839cd65f1..0643440a6f5d 100644

drivers/media/i2c/ov5648.c static int ov5648_probe(struct i2c_client *client) · line 2570

Quoted 6 lines
drivers/media/i2c/ov5648.c +1 -1
@@ -2566,8 +2566,8 @@ static int ov5648_probe(struct i2c_client *client)
 
 	/* Runtime PM */
 
-	pm_runtime_enable(sensor->dev);
 	pm_runtime_set_suspended(sensor->dev);
+	pm_runtime_enable(sensor->dev);

Runtime PM API usage in this driver appears to be very broken. :-( I guess it got merged just before we started paying more attention to Runtime PM as a whole. Either way, feel free to fix this all, I could provide a patch as well (but can't test it).

Quoted 3 lines
drivers/media/i2c/ov5648.c +0 -0
 	/* V4L2 subdev register */
 
Signature · 3 lines
Kind regards,

Sakari Ailus
#2 lore raw

Hello Sakari,

Quoted 22 lines · Sakari Ailus

Hi Ondřej,

Thanks for the patch.

Quoted 17 lines · Ondřej Jirman

From: Ondrej Jirman <[email protected]>

It should be done when RPM is disabled.

---
 drivers/media/i2c/ov5648.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/i2c/ov5648.c +0 -0
index f0b839cd65f1..0643440a6f5d 100644
@@ -2566,8 +2566,8 @@ static int ov5648_probe(struct i2c_client *client)
 
 	/* Runtime PM */
 
Quoted 8 lines

drivers/media/i2c/ov5648.c static int ov5648_probe(struct i2c_client *client) · line 2570

Quoted 3 lines
drivers/media/i2c/ov5648.c +1 -1
-	pm_runtime_enable(sensor->dev);
 	pm_runtime_set_suspended(sensor->dev);
+	pm_runtime_enable(sensor->dev);

Runtime PM API usage in this driver appears to be very broken. :-( I guess it got merged just before we started paying more attention to Runtime PM as a whole. Either way, feel free to fix this all, I could provide a patch as well (but can't test it).

Ok, I'll review this more thoroughly. :)

Best regards,

	o.
Quoted 8 lines
Quoted 3 lines
drivers/media/i2c/ov5648.c +0 -0
 	/* V4L2 subdev register */
 
Signature · 3 lines
Kind regards,

Sakari Ailus