Re: question about soc_camera_open
- Date: Tue, 9 Jun 2009 13:08:40 +0200 (CEST)
- From: Guennadi Liakhovetski <g.liakhovetski@xxxxxx>
- Subject: Re: question about soc_camera_open
On Tue, 9 Jun 2009, Kuninori Morimoto wrote:
> > > soc_camera_open use icd->current_fmt directly.
> > > It doesn't check if icd->current_fmt != NULL.
> > Which kernel version, resp., version of the soc-camera stack are you
> > using? What you describe would be a bug, but it shouldn't be present
> > neither in the soc-camera stack, converted to v4l2-subdev (see my last
> > series of 10 patches), nor in a partially converted stack.
> I use latest Paul's (for SH) git
> > is present in the current mainline. There's a call to
> > if (icd->ops->remove)
> > icd->ops->remove(icd);
> > missing on the "goto eiufmt;" error path. You'd just have to insert the
> > above call before the goto. Would you like to prepare a patch?
> why can I call soc_camera_open even if soc_camera_probe failed ?
For this very reason - because icd->ops->remove(icd) is not called if
soc_camera_init_user_formats() fails, which is a bug and should be fixed.
> I'm not sure why... but...
> following is my kernel panic story.
> 1) I use "soc_camera_platform" and "sh_mobile_ceu" driver.
> 2) soc_camera_platform_info :: bus_param = SOCAM_xxx;
> this bus_param is miss mach to sh_mobile_ceu.
> ex) if it use SOCAM_DATAWIDTH_4, sh_mobile_ceu can not use it.
> 3) soc_camera_bus_param_compatible will be return 0
> in sh_mobile_ceu_try_bus_param
> I think this behavior is correct
> 4) sh_mobile_ceu_get_formats return 0
> because sh_mobile_ceu_try_bus_param return 0
> 5) soc_camera_init_user_formats return -ENXIO
> because fmts is 0.
> then, icd->current_fmt is still NULL.
> 6) when I use mplayer, kernel panic occur on soc_camera_open.
> because .pixelformat = icd->current_fmt->fourcc will access NULL address
> but why can I call soc_camera_open ?
> Best regards
> Kuninori Morimoto
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
video4linux-list mailing list