public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* locking in OMAP ISP subdevs
@ 2011-05-09 12:32 Michael Jones
  2011-05-09 22:28 ` Laurent Pinchart
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Jones @ 2011-05-09 12:32 UTC (permalink / raw)
  To: Laurent Pinchart; +Cc: Linux Media Mailing List

Hi Laurent,

I can't find where the locking is handled for ISP subdev standard ioctls
like ccdc_v4l2_pad_ops.set_fmt().  Using the CCDC as an example, it
looks to me like the following sequence happens when e.g. format is set
on CCDC pad 0:

1. # media-ctl --set-format '"OMAP3 ISP CCDC":0 [Y8 640x480]'

2. v4l2-dev.c:v4l2_ioctl()

this calls vdev->fops->unlocked_ioctl, which was set to
v4l2-subdev.c:subdev_ioctl() in "v4l2_subdev_fops" in
v4l2-device.c:v4l2_device_register_subdev_nodes()

3. v4l2-subdev.c:subdev_ioctl()
4. video_usercopy()
5. v4l2-ioctl.c:__video_usercopy()
6. v4l2-subdev.c:subdev_do_ioctl()
7. ispccdc.c:ccdc_set_format()

ccdc_set_format() sets ccdc->formats[pad], access to which should be
serialized, but I don't see how this happens.  In the call sequence
above, the only opportunity I see is in (2), but only then if
ccdc->subdev.devnode.lock is set, which doesn't seem to be done.

Can you clarify this for me?  What mutex is held during a call to
ccdc_set_format()?

-Michael

MATRIX VISION GmbH, Talstrasse 16, DE-71570 Oppenweiler
Registergericht: Amtsgericht Stuttgart, HRB 271090
Geschaeftsfuehrer: Gerhard Thullner, Werner Armingeon, Uwe Furtner

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

* Re: locking in OMAP ISP subdevs
  2011-05-09 12:32 locking in OMAP ISP subdevs Michael Jones
@ 2011-05-09 22:28 ` Laurent Pinchart
  0 siblings, 0 replies; 2+ messages in thread
From: Laurent Pinchart @ 2011-05-09 22:28 UTC (permalink / raw)
  To: Michael Jones; +Cc: Linux Media Mailing List

Hi Michael,

On Monday 09 May 2011 14:32:09 Michael Jones wrote:
> Hi Laurent,
> 
> I can't find where the locking is handled for ISP subdev standard ioctls
> like ccdc_v4l2_pad_ops.set_fmt().  Using the CCDC as an example, it
> looks to me like the following sequence happens when e.g. format is set
> on CCDC pad 0:
> 
> 1. # media-ctl --set-format '"OMAP3 ISP CCDC":0 [Y8 640x480]'
> 
> 2. v4l2-dev.c:v4l2_ioctl()
> 
> this calls vdev->fops->unlocked_ioctl, which was set to
> v4l2-subdev.c:subdev_ioctl() in "v4l2_subdev_fops" in
> v4l2-device.c:v4l2_device_register_subdev_nodes()
> 
> 3. v4l2-subdev.c:subdev_ioctl()
> 4. video_usercopy()
> 5. v4l2-ioctl.c:__video_usercopy()
> 6. v4l2-subdev.c:subdev_do_ioctl()
> 7. ispccdc.c:ccdc_set_format()
> 
> ccdc_set_format() sets ccdc->formats[pad], access to which should be
> serialized, but I don't see how this happens.  In the call sequence
> above, the only opportunity I see is in (2), but only then if
> ccdc->subdev.devnode.lock is set, which doesn't seem to be done.
> 
> Can you clarify this for me?  What mutex is held during a call to
> ccdc_set_format()?

None. Patches are welcome :-)

-- 
Regards,

Laurent Pinchart

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

end of thread, other threads:[~2011-05-09 22:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-09 12:32 locking in OMAP ISP subdevs Michael Jones
2011-05-09 22:28 ` Laurent Pinchart

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox