Re: [PATCH] OMAP3: ISP: Fix unbalanced use of omap3isp_get().

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Laurent,
> This won't work. Let's assume the following sequence of events:
>
> - Userspace opens the sensor subdev device node
> - The sensor driver calls to board code to turn the sensor clock on
> - Board code calls to the ISP driver to turn XCLK on
> - The ISP driver calls isp_enable_clocks()
> ...
> - Userspace opens an ISP video device node
> - The ISP driver calls isp_get(), incrementing the reference count
> - Userspace closes the ISP video device node
> - The ISP driver calls isp_put(), decrementing the reference count
> - The reference count reaches 0, the ISP driver calls isp_disable_clocks()
>
> The sensor will then loose its clock, even though the sensor subdev device
> node is still opened.

Of course, you are right, I hadn't thought of it this way.

> Could you please explain why the existing code doesn't work on your hardware ?

Apparently, it is a mistake related to the sensor driver. Sorry about that.

Just one question.
As I can see from mt9v032 driver, open callback is used to enable
clock and close callback is used to disable clock.
Does this mean that if sensor device node is not held open video won't work?
i.e, the following wouldn't work since (2) opens the sensor (enables
clock) and closes it again (disables clock) and (3) only opens CCDC
device node (enables clock with a wrong setting, since it was
previously set to 0 by (2) ) :

(1)  ./media-ctl -r -l '"mt9p031 2-0048":0->"OMAP3 ISP CCDC":0[1],
"OMAP3 ISP CCDC":1->"OMAP3 ISP CCDC output":0[1]'
(2)  ./media-ctl -f '"mt9p031 2-0048":0[SGRBG8 320x240], "OMAP3 ISP
CCDC":1[SGRBG8 320x240]'
(3)  ./yavta  -f SGRBG8 -s 320x240 -n 4 --capture=100 --skip 3 -F
`./media-ctl -e "OMAP3 ISP CCDC output"

-- 
Javier Martin
Vista Silicon S.L.
CDTUC - FASE C - Oficina S-345
Avda de los Castros s/n
39005- Santander. Cantabria. Spain
+34 942 25 32 60
www.vista-silicon.com
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux