Fix PM on imx214 error paths
Sakari Ailus
maintainercover Fix PM on imx214 error paths
Hi André,
I'm posting this separately as it seems to be backportable, your set needs to go on the top. I've pushed that to my "devel" branch in my git.linuxtv.org tree <URL:https://git.linuxtv.org/sailus/media_tree.git/>, please let me know if you see problems.
Sakari Ailus (2):
Revert "media: imx214: Fix the error handling in imx214_probe()"
media: i2c: imx214: Rectify probe error handling related to runtime PM
drivers/media/i2c/imx214.c | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-)
Signature · 1 line
2.39.5
Sakari Ailus
maintainerPATCH 1/2 Revert "media: imx214: Fix the error handling in imx214_probe()"
This reverts commit 9bc92332cc3f06fda3c6e2423995ca2da0a7ec9a.
Revert this "fix" as it's not really helpful but makes backporting a proper fix harder.
--- drivers/media/i2c/imx214.c | 1 - 1 file changed, 1 deletion(-)
drivers/media/i2c/imx214.c +0 -1
@@ -1114,7 +1114,6 @@ static int imx214_probe(struct i2c_client *client)v4l2_ctrl_handler_free (&imx214->ctrls); error_power_off:pm_runtime_disable (imx214->dev); -regulator_bulk_disable (IMX214_NUM_SUPPLIES , imx214->supplies);return ret; }
Signature · 1 line
2.39.5
Sakari Ailus
maintainerPATCH 2/2 media: i2c: imx214: Rectify probe error handling related to runtime PM
In reply to Sakari AilusThere were multiple issues in the driver's probe function related to error handling:
- Device's PM runtime status wasn't reverted to suspended on some errors in probe.
- Runtime PM was left enabled for the device on some probe errors.
- Device was left powered on if a probe failure happened or when it was removed when it was powered on.
- An extra pm_runtime_set_suspended() was issued in driver's remove function when the device was suspended.
Fix these bugs.
--- drivers/media/i2c/imx214.c | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-)
drivers/media/i2c/imx214.c +15 -9
@@ -1075,10 +1075,6 @@ static int imx214_probe(struct i2c_client *client)*/ imx214_power_on (imx214->dev); -pm_runtime_set_active (imx214->dev); -pm_runtime_enable (imx214->dev); -pm_runtime_idle (imx214->dev); - ret =imx214_ctrls_init (imx214);if (ret <0 ) goto error_power_off;
@@ -1099,21 +1095,30 @@ static int imx214_probe(struct i2c_client *client)imx214_entity_init_state (&imx214->sd,NULL ); +pm_runtime_set_active (imx214->dev); +pm_runtime_enable (imx214->dev); + ret =v4l2_async_register_subdev_sensor (&imx214->sd);if (ret <0 ) {dev_err (dev,"could not register v4l2 device\n" ); goto free_entity; } +pm_runtime_idle (imx214->dev); +return 0 ; free_entity: +pm_runtime_disable (imx214->dev); +pm_runtime_set_suspended (&client->dev);media_entity_cleanup (&imx214->sd.entity); + free_ctrl:mutex_destroy (&imx214->mutex);v4l2_ctrl_handler_free (&imx214->ctrls); + error_power_off: -pm_runtime_disable (imx214->dev); +imx214_power_off (imx214->dev);return ret; }
@@ -1126,11 +1131,12 @@ static void imx214_remove(struct i2c_client *client)v4l2_async_unregister_subdev (&imx214->sd);media_entity_cleanup (&imx214->sd.entity);v4l2_ctrl_handler_free (&imx214->ctrls); - -pm_runtime_disable (&client->dev); -pm_runtime_set_suspended (&client->dev); -mutex_destroy (&imx214->mutex); +pm_runtime_disable (&client->dev); +if (!pm_runtime_status_suspended (&client->dev)) { +imx214_power_off (imx214->dev); +pm_runtime_set_suspended (&client->dev); + } }static const struct of_device_id imx214_of_match[] = {
Signature · 1 line
2.39.5
Hi Sakari,
Am Donnerstag, dem 16.01.2025 um 13:46 +0200 schrieb Sakari Ailus:
Quoted 7 lines
Hi André,
I'm posting this separately as it seems to be backportable, your set needs to go on the top. I've pushed that to my "devel" branch in my git.linuxtv.org tree <URL:https://git.linuxtv.org/sailus/media_tree.git/>, please let me know if you see problems.
The patches look good to me. I don't see any problems, but I haven't tested the error paths. That's why no "Tested-by".
Shall I send a new version of my patches rebased on yours or can my patches be taken from your "devel" branch?
Regards,
André
Quoted 9 lines
Sakari Ailus (2):
Revert "media: imx214: Fix the error handling inimx214_probe()"
media: i2c: imx214: Rectify probe error handling related to runtime PMdrivers/media/i2c/imx214.c | 25 +++++++++++++++----------
1 file changed, 15 insertions(+), 10 deletions(-)
Sakari Ailus
maintainerHi André,
Quoted 11 lines · André Apitzsch
Hi Sakari,
Am Donnerstag, dem 16.01.2025 um 13:46 +0200 schrieb Sakari Ailus:
Quoted 7 lines
Hi André,
I'm posting this separately as it seems to be backportable, your set needs to go on the top. I've pushed that to my "devel" branch in my git.linuxtv.org tree <URL:https://git.linuxtv.org/sailus/media_tree.git/>, please let me know if you see problems.
Quoted 7 lines
The patches look good to me. I don't see any problems, but I haven't tested the error paths. That's why no "Tested-by".
Acked-by André Apitzsch <[email protected]>Shall I send a new version of my patches rebased on yours or can my patches be taken from your "devel" branch?
If you're fine with the result of my rebase, there's no need to.
Signature · 3 lines
Kind regards, Sakari Ailus
Hi Sakari,
Am Mittwoch, dem 22.01.2025 um 12:04 +0000 schrieb Sakari Ailus:
Quoted 20 lines
Hi André,
Quoted 17 lines · André Apitzsch
Hi Sakari,
Am Donnerstag, dem 16.01.2025 um 13:46 +0200 schrieb Sakari Ailus:
Quoted 9 lines
Hi André,
I'm posting this separately as it seems to be backportable, your set
needs to go on the top. I've pushed that to my "devel" branch in my
git.linuxtv.org tree <URL:https://git.linuxtv.org/sailus/media_tree.git/>, please let me know if you see problems.The patches look good to me. I don't see any problems, but I haven't
tested the error paths. That's why no "Tested-by".
Quoted 7 lines
Quoted 4 lines
Acked-by André Apitzsch <[email protected]>Shall I send a new version of my patches rebased on yours or can my patches be taken from your "devel" branch?
If you're fine with the result of my rebase, there's no need to.
I'm fine with that.
André
Sakari Ailus
maintainerQuoted 23 lines · André Apitzsch
Hi Sakari,
Am Mittwoch, dem 22.01.2025 um 12:04 +0000 schrieb Sakari Ailus:
Quoted 20 lines
Hi André,
Quoted 17 lines · André Apitzsch
Hi Sakari,
Am Donnerstag, dem 16.01.2025 um 13:46 +0200 schrieb Sakari Ailus:
Quoted 9 lines
Hi André,
I'm posting this separately as it seems to be backportable, your set
needs to go on the top. I've pushed that to my "devel" branch in my
git.linuxtv.org tree <URL:https://git.linuxtv.org/sailus/media_tree.git/>, please let me know if you see problems.The patches look good to me. I don't see any problems, but I haven't
tested the error paths. That's why no "Tested-by".
Quoted 8 lines
Quoted 7 lines
Quoted 4 lines
Acked-by André Apitzsch <[email protected]>Shall I send a new version of my patches rebased on yours or can my patches be taken from your "devel" branch?
If you're fine with the result of my rebase, there's no need to.
I'm fine with that.
Ack, thanks!
Signature · 1 line
Sakari Ailus
Hi Sakari,
Am Donnerstag, dem 23.01.2025 um 07:44 +0000 schrieb Sakari Ailus:
Quoted 24 lines · André Apitzsch
Quoted 23 lines
Hi Sakari,
Am Mittwoch, dem 22.01.2025 um 12:04 +0000 schrieb Sakari Ailus:
Quoted 20 lines
Hi André,
Quoted 17 lines · André Apitzsch
Hi Sakari,
Am Donnerstag, dem 16.01.2025 um 13:46 +0200 schrieb Sakari Ailus:
Quoted 7 lines
Hi André,
I'm posting this separately as it seems to be backportable, your set needs to go on the top. I've pushed that to my "devel" branch in my git.linuxtv.org tree <URL:https://git.linuxtv.org/sailus/media_tree.git/>, please let me know if you see problems.
The patches look good to me. I don't see any problems, but I haven't tested the error paths. That's why no "Tested-by".
Acked-by André Apitzsch <[email protected]>
Quoted 9 lines
Quoted 6 lines
Quoted 5 lines
Quoted 2 lines
Shall I send a new version of my patches rebased on yours or can my patches be taken from your "devel" branch?
If you're fine with the result of my rebase, there's no need to.
I'm fine with that.
Ack, thanks!
What is missing to get your and my imx214 changes into next?
Regards,
André
Sakari Ailus
maintainerHi André,
Quoted 30 lines · André Apitzsch
Hi Sakari,
Am Donnerstag, dem 23.01.2025 um 07:44 +0000 schrieb Sakari Ailus:
Quoted 27 lines · André Apitzsch
Quoted 26 lines
Hi Sakari,
Am Mittwoch, dem 22.01.2025 um 12:04 +0000 schrieb Sakari Ailus:
Quoted 23 lines
Hi André,
Quoted 19 lines · André Apitzsch
Hi Sakari,
Am Donnerstag, dem 16.01.2025 um 13:46 +0200 schrieb Sakari Ailus:
Quoted 7 lines
Hi André,
I'm posting this separately as it seems to be backportable, your set needs to go on the top. I've pushed that to my "devel" branch in my git.linuxtv.org tree <URL:https://git.linuxtv.org/sailus/media_tree.git/>, please let me know if you see problems.
The patches look good to me. I don't see any problems, but I haven't tested the error paths. That's why no "Tested-by".
Acked-by André Apitzsch <[email protected]>Shall I send a new version of my patches rebased on yours or can my patches be taken from your "devel" branch?
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
Quoted 2 lines
If you're fine with the result of my rebase, there's no need to.
I'm fine with that.
Ack, thanks!
What is missing to get your and my imx214 changes into next?
It'll still take a while but shouldn't be long.
Signature · 1 line
Sakari Ailus