* Common clock framework: mutex recursion when calling clk_prepare from prepare handler
@ 2013-01-07 0:49 Laurent Pinchart
0 siblings, 0 replies; only message in thread
From: Laurent Pinchart @ 2013-01-07 0:49 UTC (permalink / raw)
To: linux-kernel, linux-arm-kernel, linux-omap; +Cc: mturquette
Hello,
I ran into a mutex recursion issue while trying to port the OMAP3 ISP driver
(drivers/media/platform/omap3isp) over to the common clock framework.
The OMAP3 ISP generates two programmable clocks named xclka and xclkb that are
routed out of the SoC. My goal is to expose them as common clock instances
through the common clock framework.
The xclk[ab] clocks are children of the cam_mclk clock. They are controlled
through ISP registers that sit in the cam_fclk clock domain. The cam_mclk and
cam_fclk clocks sit in separate power domains.
To program the xclk clocks I need to enable the cam_fclk clock. As xclk[ab]
are not descendants of the cam_fclk clock, this operation needs to be
performed manually. I thus call clk_prepare_enable on the cam_fclk clock in
the xclk[ab] prepare handler. This is where things break, as the common clock
framework takes the prepare_lock mutex in clk_prepare, which results in a
mutex recursion deadlock as the prepare_lock mutex isn't recursive.
What's the best way to solve this ? __clk_prepare (the unlocked version of
clk_prepare) isn't exported to drivers, and I'm not convinced it should be.
Turning prepare_lock into a recursive mutex might also work, but I'm not sure
what drawbacks this would have. Advices would be appreciated.
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2013-01-07 0:47 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-07 0:49 Common clock framework: mutex recursion when calling clk_prepare from prepare handler Laurent Pinchart
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).