* [PATCH 0/2] Fix PM on imx214 error paths
@ 2025-01-16 11:46 Sakari Ailus
2025-01-16 11:46 ` [PATCH 1/2] Revert "media: imx214: Fix the error handling in imx214_probe()" Sakari Ailus
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: Sakari Ailus @ 2025-01-16 11:46 UTC (permalink / raw)
To: linux-media; +Cc: André Apitzsch, Ricardo Ribalda
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(-)
--
2.39.5
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 1/2] Revert "media: imx214: Fix the error handling in imx214_probe()"
2025-01-16 11:46 [PATCH 0/2] Fix PM on imx214 error paths Sakari Ailus
@ 2025-01-16 11:46 ` Sakari Ailus
2025-01-16 11:47 ` [PATCH 2/2] media: i2c: imx214: Rectify probe error handling related to runtime PM Sakari Ailus
2025-01-20 19:57 ` [PATCH 0/2] Fix PM on imx214 error paths André Apitzsch
2 siblings, 0 replies; 9+ messages in thread
From: Sakari Ailus @ 2025-01-16 11:46 UTC (permalink / raw)
To: linux-media; +Cc: André Apitzsch, Ricardo Ribalda
This reverts commit 9bc92332cc3f06fda3c6e2423995ca2da0a7ec9a.
Revert this "fix" as it's not really helpful but makes backporting a
proper fix harder.
Fixes: 9bc92332cc3f ("media: imx214: Fix the error handling in imx214_probe()")
Cc: stable@vger.kernel.org # for >= v6.12
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
drivers/media/i2c/imx214.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/media/i2c/imx214.c b/drivers/media/i2c/imx214.c
index 4962cfe7c83d..10b6ad66d126 100644
--- a/drivers/media/i2c/imx214.c
+++ b/drivers/media/i2c/imx214.c
@@ -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;
}
--
2.39.5
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 2/2] media: i2c: imx214: Rectify probe error handling related to runtime PM
2025-01-16 11:46 [PATCH 0/2] Fix PM on imx214 error paths Sakari Ailus
2025-01-16 11:46 ` [PATCH 1/2] Revert "media: imx214: Fix the error handling in imx214_probe()" Sakari Ailus
@ 2025-01-16 11:47 ` Sakari Ailus
2025-01-20 19:57 ` [PATCH 0/2] Fix PM on imx214 error paths André Apitzsch
2 siblings, 0 replies; 9+ messages in thread
From: Sakari Ailus @ 2025-01-16 11:47 UTC (permalink / raw)
To: linux-media; +Cc: André Apitzsch, Ricardo Ribalda
There 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.
Fixes: 436190596241 ("media: imx214: Add imx214 camera sensor driver")
Cc: stable@vger.kernel.org # for >= v6.12
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
drivers/media/i2c/imx214.c | 24 +++++++++++++++---------
1 file changed, 15 insertions(+), 9 deletions(-)
diff --git a/drivers/media/i2c/imx214.c b/drivers/media/i2c/imx214.c
index 10b6ad66d126..6a393e18267f 100644
--- a/drivers/media/i2c/imx214.c
+++ b/drivers/media/i2c/imx214.c
@@ -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[] = {
--
2.39.5
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 0/2] Fix PM on imx214 error paths
2025-01-16 11:46 [PATCH 0/2] Fix PM on imx214 error paths Sakari Ailus
2025-01-16 11:46 ` [PATCH 1/2] Revert "media: imx214: Fix the error handling in imx214_probe()" Sakari Ailus
2025-01-16 11:47 ` [PATCH 2/2] media: i2c: imx214: Rectify probe error handling related to runtime PM Sakari Ailus
@ 2025-01-20 19:57 ` André Apitzsch
2025-01-22 12:04 ` Sakari Ailus
2 siblings, 1 reply; 9+ messages in thread
From: André Apitzsch @ 2025-01-20 19:57 UTC (permalink / raw)
To: Sakari Ailus, linux-media; +Cc: Ricardo Ribalda
Hi Sakari,
Am Donnerstag, dem 16.01.2025 um 13:46 +0200 schrieb Sakari Ailus:
> 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 <git@apitzsch.eu>
Shall I send a new version of my patches rebased on yours or can my
patches be taken from your "devel" branch?
Regards,
André
>
> 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(-)
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 0/2] Fix PM on imx214 error paths
2025-01-20 19:57 ` [PATCH 0/2] Fix PM on imx214 error paths André Apitzsch
@ 2025-01-22 12:04 ` Sakari Ailus
2025-01-22 21:00 ` André Apitzsch
0 siblings, 1 reply; 9+ messages in thread
From: Sakari Ailus @ 2025-01-22 12:04 UTC (permalink / raw)
To: André Apitzsch; +Cc: linux-media, Ricardo Ribalda
Hi André,
On Mon, Jan 20, 2025 at 08:57:39PM +0100, André Apitzsch wrote:
> Hi Sakari,
>
> Am Donnerstag, dem 16.01.2025 um 13:46 +0200 schrieb Sakari Ailus:
> > 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 <git@apitzsch.eu>
>
> 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.
--
Kind regards,
Sakari Ailus
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 0/2] Fix PM on imx214 error paths
2025-01-22 12:04 ` Sakari Ailus
@ 2025-01-22 21:00 ` André Apitzsch
2025-01-23 7:44 ` Sakari Ailus
0 siblings, 1 reply; 9+ messages in thread
From: André Apitzsch @ 2025-01-22 21:00 UTC (permalink / raw)
To: Sakari Ailus; +Cc: linux-media, Ricardo Ribalda
Hi Sakari,
Am Mittwoch, dem 22.01.2025 um 12:04 +0000 schrieb Sakari Ailus:
> Hi André,
>
> On Mon, Jan 20, 2025 at 08:57:39PM +0100, André Apitzsch wrote:
> > Hi Sakari,
> >
> > Am Donnerstag, dem 16.01.2025 um 13:46 +0200 schrieb Sakari Ailus:
> > > 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 <git@apitzsch.eu>
> >
> > 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é
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 0/2] Fix PM on imx214 error paths
2025-01-22 21:00 ` André Apitzsch
@ 2025-01-23 7:44 ` Sakari Ailus
2025-02-05 22:17 ` André Apitzsch
0 siblings, 1 reply; 9+ messages in thread
From: Sakari Ailus @ 2025-01-23 7:44 UTC (permalink / raw)
To: André Apitzsch; +Cc: linux-media, Ricardo Ribalda
On Wed, Jan 22, 2025 at 10:00:54PM +0100, André Apitzsch wrote:
> Hi Sakari,
>
> Am Mittwoch, dem 22.01.2025 um 12:04 +0000 schrieb Sakari Ailus:
> > Hi André,
> >
> > On Mon, Jan 20, 2025 at 08:57:39PM +0100, André Apitzsch wrote:
> > > Hi Sakari,
> > >
> > > Am Donnerstag, dem 16.01.2025 um 13:46 +0200 schrieb Sakari Ailus:
> > > > 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 <git@apitzsch.eu>
> > >
> > > 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!
--
Sakari Ailus
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 0/2] Fix PM on imx214 error paths
2025-01-23 7:44 ` Sakari Ailus
@ 2025-02-05 22:17 ` André Apitzsch
2025-02-05 23:26 ` Sakari Ailus
0 siblings, 1 reply; 9+ messages in thread
From: André Apitzsch @ 2025-02-05 22:17 UTC (permalink / raw)
To: Sakari Ailus; +Cc: linux-media, Ricardo Ribalda
Hi Sakari,
Am Donnerstag, dem 23.01.2025 um 07:44 +0000 schrieb Sakari Ailus:
> On Wed, Jan 22, 2025 at 10:00:54PM +0100, André Apitzsch wrote:
> > Hi Sakari,
> >
> > Am Mittwoch, dem 22.01.2025 um 12:04 +0000 schrieb Sakari Ailus:
> > > Hi André,
> > >
> > > On Mon, Jan 20, 2025 at 08:57:39PM +0100, André Apitzsch wrote:
> > > > Hi Sakari,
> > > >
> > > > Am Donnerstag, dem 16.01.2025 um 13:46 +0200 schrieb Sakari
> > > > Ailus:
> > > > > 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 <git@apitzsch.eu>
> > > >
> > > > 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é
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 0/2] Fix PM on imx214 error paths
2025-02-05 22:17 ` André Apitzsch
@ 2025-02-05 23:26 ` Sakari Ailus
0 siblings, 0 replies; 9+ messages in thread
From: Sakari Ailus @ 2025-02-05 23:26 UTC (permalink / raw)
To: André Apitzsch; +Cc: linux-media, Ricardo Ribalda
Hi André,
On Wed, Feb 05, 2025 at 11:17:33PM +0100, André Apitzsch wrote:
> Hi Sakari,
>
> Am Donnerstag, dem 23.01.2025 um 07:44 +0000 schrieb Sakari Ailus:
> > On Wed, Jan 22, 2025 at 10:00:54PM +0100, André Apitzsch wrote:
> > > Hi Sakari,
> > >
> > > Am Mittwoch, dem 22.01.2025 um 12:04 +0000 schrieb Sakari Ailus:
> > > > Hi André,
> > > >
> > > > On Mon, Jan 20, 2025 at 08:57:39PM +0100, André Apitzsch wrote:
> > > > > Hi Sakari,
> > > > >
> > > > > Am Donnerstag, dem 16.01.2025 um 13:46 +0200 schrieb Sakari
> > > > > Ailus:
> > > > > > 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 <git@apitzsch.eu>
> > > > >
> > > > > 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?
It'll still take a while but shouldn't be long.
--
Sakari Ailus
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2025-02-05 23:26 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-16 11:46 [PATCH 0/2] Fix PM on imx214 error paths Sakari Ailus
2025-01-16 11:46 ` [PATCH 1/2] Revert "media: imx214: Fix the error handling in imx214_probe()" Sakari Ailus
2025-01-16 11:47 ` [PATCH 2/2] media: i2c: imx214: Rectify probe error handling related to runtime PM Sakari Ailus
2025-01-20 19:57 ` [PATCH 0/2] Fix PM on imx214 error paths André Apitzsch
2025-01-22 12:04 ` Sakari Ailus
2025-01-22 21:00 ` André Apitzsch
2025-01-23 7:44 ` Sakari Ailus
2025-02-05 22:17 ` André Apitzsch
2025-02-05 23:26 ` Sakari Ailus
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox