All of lore.kernel.org
 help / color / mirror / Atom feed
* [BACKPORT v3.18] media: ov6650: Fix sensor possibly not detected on probe
@ 2019-03-29 21:20 Janusz Krzysztofik
  2019-03-30  5:47 ` Greg KH
  0 siblings, 1 reply; 3+ messages in thread
From: Janusz Krzysztofik @ 2019-03-29 21:20 UTC (permalink / raw)
  To: Sasha Levin; +Cc: Hans Verkuil, stable, Janusz Krzysztofik

After removal of clock_start() from before soc_camera_init_i2c() in
soc_camera_probe() by commit 9aea470b399d ("[media] soc-camera: switch
I2C subdevice drivers to use v4l2-clk") introduced in v3.11, the ov6650
driver could no longer probe the sensor successfully because its clock
was no longer turned on in advance.  The issue was initially worked
around by adding that missing clock_start() equivalent to OMAP1 camera
interface driver - the only user of this sensor - but a propoer fix
should be rather implemented in the sensor driver code itself.

Fix the issue by inserting a delay between the clock is turned on and
the sensor I2C registers are read for the first time.

Fixes: 9aea470b399d ("[media] soc-camera: switch I2C subdevice drivers to use v4l2-clk")
Signed-off-by: Janusz Krzysztofik <jmkrzyszt@gmail.com>
Cc: stable@vger.kernel.org
---
Rebased on 3.18, should apply cleanly on 4.4 and 4.9 as well.

I dropped the comment on the patch being tested on an out of tree
omap1_camera driver mainly because that driver is still in the tree
in those kernel versions.

 drivers/media/i2c/soc_camera/ov6650.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/media/i2c/soc_camera/ov6650.c b/drivers/media/i2c/soc_camera/ov6650.c
index ab01598ec83f..c0e25bf55fb8 100644
--- a/drivers/media/i2c/soc_camera/ov6650.c
+++ b/drivers/media/i2c/soc_camera/ov6650.c
@@ -829,6 +829,8 @@ static int ov6650_video_probe(struct i2c_client *client)
 	if (ret < 0)
 		return ret;
 
+	msleep(20);
+
 	/*
 	 * check and show product ID and manufacturer ID
 	 */
-- 
2.19.2


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

* Re: [BACKPORT v3.18] media: ov6650: Fix sensor possibly not detected on probe
  2019-03-29 21:20 [BACKPORT v3.18] media: ov6650: Fix sensor possibly not detected on probe Janusz Krzysztofik
@ 2019-03-30  5:47 ` Greg KH
  2019-03-30 10:34   ` Janusz Krzysztofik
  0 siblings, 1 reply; 3+ messages in thread
From: Greg KH @ 2019-03-30  5:47 UTC (permalink / raw)
  To: Janusz Krzysztofik; +Cc: Sasha Levin, Hans Verkuil, stable

On Fri, Mar 29, 2019 at 10:20:05PM +0100, Janusz Krzysztofik wrote:
> After removal of clock_start() from before soc_camera_init_i2c() in
> soc_camera_probe() by commit 9aea470b399d ("[media] soc-camera: switch
> I2C subdevice drivers to use v4l2-clk") introduced in v3.11, the ov6650
> driver could no longer probe the sensor successfully because its clock
> was no longer turned on in advance.  The issue was initially worked
> around by adding that missing clock_start() equivalent to OMAP1 camera
> interface driver - the only user of this sensor - but a propoer fix
> should be rather implemented in the sensor driver code itself.
> 
> Fix the issue by inserting a delay between the clock is turned on and
> the sensor I2C registers are read for the first time.
> 
> Fixes: 9aea470b399d ("[media] soc-camera: switch I2C subdevice drivers to use v4l2-clk")
> Signed-off-by: Janusz Krzysztofik <jmkrzyszt@gmail.com>
> Cc: stable@vger.kernel.org
> ---
> Rebased on 3.18, should apply cleanly on 4.4 and 4.9 as well.
> 
> I dropped the comment on the patch being tested on an out of tree
> omap1_camera driver mainly because that driver is still in the tree
> in those kernel versions.
> 
>  drivers/media/i2c/soc_camera/ov6650.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/media/i2c/soc_camera/ov6650.c b/drivers/media/i2c/soc_camera/ov6650.c
> index ab01598ec83f..c0e25bf55fb8 100644
> --- a/drivers/media/i2c/soc_camera/ov6650.c
> +++ b/drivers/media/i2c/soc_camera/ov6650.c
> @@ -829,6 +829,8 @@ static int ov6650_video_probe(struct i2c_client *client)
>  	if (ret < 0)
>  		return ret;
>  
> +	msleep(20);
> +
>  	/*
>  	 * check and show product ID and manufacturer ID
>  	 */
> -- 
> 2.19.2
> 

What is the git commit id of this patch in Linus's tree?

thanks,

greg k-h

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

* Re: [BACKPORT v3.18] media: ov6650: Fix sensor possibly not detected on probe
  2019-03-30  5:47 ` Greg KH
@ 2019-03-30 10:34   ` Janusz Krzysztofik
  0 siblings, 0 replies; 3+ messages in thread
From: Janusz Krzysztofik @ 2019-03-30 10:34 UTC (permalink / raw)
  To: Greg KH; +Cc: Sasha Levin, Hans Verkuil, stable

Hi Greg,

On Saturday, March 30, 2019 6:47:12 AM CET Greg KH wrote:
> On Fri, Mar 29, 2019 at 10:20:05PM +0100, Janusz Krzysztofik wrote:
> > After removal of clock_start() from before soc_camera_init_i2c() in
> > soc_camera_probe() by commit 9aea470b399d ("[media] soc-camera: switch
> > I2C subdevice drivers to use v4l2-clk") introduced in v3.11, the ov6650
> > driver could no longer probe the sensor successfully because its clock
> > was no longer turned on in advance.  The issue was initially worked
> > around by adding that missing clock_start() equivalent to OMAP1 camera
> > interface driver - the only user of this sensor - but a propoer fix
> > should be rather implemented in the sensor driver code itself.
> > 
> > Fix the issue by inserting a delay between the clock is turned on and
> > the sensor I2C registers are read for the first time.
> > 
> > Fixes: 9aea470b399d ("[media] soc-camera: switch I2C subdevice drivers to 
use v4l2-clk")
> > Signed-off-by: Janusz Krzysztofik <jmkrzyszt@gmail.com>
> > Cc: stable@vger.kernel.org
> > ---
> > Rebased on 3.18, should apply cleanly on 4.4 and 4.9 as well.
> > 
> > I dropped the comment on the patch being tested on an out of tree
> > omap1_camera driver mainly because that driver is still in the tree
> > in those kernel versions.
> > 
> >  drivers/media/i2c/soc_camera/ov6650.c | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/drivers/media/i2c/soc_camera/ov6650.c b/drivers/media/i2c/
soc_camera/ov6650.c
> > index ab01598ec83f..c0e25bf55fb8 100644
> > --- a/drivers/media/i2c/soc_camera/ov6650.c
> > +++ b/drivers/media/i2c/soc_camera/ov6650.c
> > @@ -829,6 +829,8 @@ static int ov6650_video_probe(struct i2c_client 
*client)
> >  	if (ret < 0)
> >  		return ret;
> >  
> > +	msleep(20);
> > +
> >  	/*
> >  	 * check and show product ID and manufacturer ID
> >  	 */
> 
> What is the git commit id of this patch in Linus's tree?

Not yet in Linus' tree, but already applied by Sakari Ailus in his 
https://git.linuxtv.org/sailus/media_tree.git/, 
id=cea17210dc0ee140289d900144662e70ea8aa623.

FYI, I submitted this backport in order to address the following request from 
the following automated off-list response to my original submission 
(https://www.spinics.net/lists/stable/msg293064.html).

> [This is an automated email]
> 
> This commit has been processed because it contains a "Fixes:" tag,
> fixing commit: 9aea470b399d [media] soc-camera: switch I2C subdevice drivers 
to use v4l2-clk.
> 
> The bot has tested the following trees: v5.0.4, v4.19.31, v4.14.108, 
v4.9.165, v4.4.177, v3.18.137.
> 
> v5.0.4: Build OK!
> v4.19.31: Build OK!
> v4.14.108: Build OK!
> v4.9.165: Failed to apply! Possible dependencies:
>     Unable to calculate
> 
> v4.4.177: Failed to apply! Possible dependencies:
>     Unable to calculate
> 
> v3.18.137: Failed to apply! Possible dependencies:
>     Unable to calculate
> 
> 
> How should we proceed with this patch?

The reason was the driver moved into a different directory in 4.14.

Inspired by your request, I've just learned how such info on original commit 
should be included in the commit message. I can resend with that added as soon 
as the patch lands in Linus' tree if you wish.

Thanks,
Janusz




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

end of thread, other threads:[~2019-03-30 10:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-29 21:20 [BACKPORT v3.18] media: ov6650: Fix sensor possibly not detected on probe Janusz Krzysztofik
2019-03-30  5:47 ` Greg KH
2019-03-30 10:34   ` Janusz Krzysztofik

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.