public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* [omap3isp] xclk deadlock
@ 2013-07-03  1:00 Jakub Piotr Cłapa
  2013-07-04 20:21 ` Jakub Piotr Cłapa
  0 siblings, 1 reply; 16+ messages in thread
From: Jakub Piotr Cłapa @ 2013-07-03  1:00 UTC (permalink / raw)
  To: linux-media; +Cc: Laurent Pinchart

Hi everyone,


Background:

I was trying to get the mt9p031 sensor working on a BeagleBoard xM with 
a patched 3.9.8 kernel[1] or with the Laurent Pinchart's omap3isp/xclk 
branch[2]. I had this hardware working quite well under linux 3.2.8 and 
3.2.24 with a patchset from Max Galemin but I had kernel crashes from 
time to time so I wanted to give a more recent kernel a try.

Unfortunatelly I ran into some serious problems. I debugged them as far 
as I could but I cannot even begin to think of fixing this on my own so 
I would be really grateful if somebody could point me in the right 
direction.



The problems:

1. I get a kernel deadlock when I run "media-ctl -p":

mt9p031_power_on calls clk_prepare_enable to get it's clock running
This, via isp_xclk_prepare -> omap3isp_get -> isp_enable_clocks results 
in another call to clk_prepare_enable which causes a deadlock because of 
the global prepare_lock in clk.c

2. Another thing is a lockdep warning during bootup:

It warns about mixing the ordering of prepare_lock & isp->isp_mutex. The 
cause is that isp_probe acquires the isp_mutex first and then proceeds 
to enable clocks (acquiring prepare_lock in the process). Later on when 
the mt9p031 is intialized from v4l2_device_register_subdev it starts 
with getting it's clock and later locks isp_mutex via omap3isp_get (the 
deadlock does not happen in this case because the ISP clocks were 
already enabled).



[1]: My patches agains vanilla 3.9.8 can be inspected here:
 
https://github.com/LoEE/buildroot/tree/daf8276e3629f9aa8540fdd3510859c811dd2d24/board/beagleboard/xm/kernel-patches
I have cherry-picked some omap3isp and mt9p031 patches from this mailing 
list (and reinvented at least one of them myself). Other patches (most 
of them) were taken from
  https://github.com/RobertCNelson/stable-kernel/tree/v3.9.x

[2]: I made one change (to get cpu_is_omap3630 defined):
diff --git a/arch/arm/mach-omap2/board-omap3beagle-camera.c 
b/arch/arm/mach-omap2/board-omap3beagle-camera.c
index bf84b48..cf5ad89e 100644
--- a/arch/arm/mach-omap2/board-omap3beagle-camera.c
+++ b/arch/arm/mach-omap2/board-omap3beagle-camera.c
@@ -18,6 +18,7 @@
  #include <media/omap3isp.h>

  #include "devices.h"
+#include "soc.h"

  #define MT9P031_RESET_GPIO     98


-- 
regards,
Jakub Piotr Cłapa
LoEE.pl

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

end of thread, other threads:[~2013-07-29  6:19 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-03  1:00 [omap3isp] xclk deadlock Jakub Piotr Cłapa
2013-07-04 20:21 ` Jakub Piotr Cłapa
2013-07-04 21:11   ` Laurent Pinchart
2013-07-04 22:36     ` Jakub Piotr Cłapa
2013-07-05 10:48       ` Laurent Pinchart
2013-07-12 14:44         ` Jakub Piotr Cłapa
2013-07-17 12:50           ` Laurent Pinchart
2013-07-17 22:17             ` Jakub Piotr Cłapa
2013-07-26 15:51               ` Laurent Pinchart
2013-07-26 23:51                 ` Jakub Piotr Cłapa
2013-07-26  7:50             ` Tomi Valkeinen
2013-07-26 15:37               ` [omapdss] fault in dispc_write_irqenable [was: Re: [omap3isp] xclk deadlock] Jakub Piotr Cłapa
2013-07-26 15:52                 ` Laurent Pinchart
2013-07-26 19:02                   ` Jakub Piotr Cłapa
2013-07-26 19:13                     ` Laurent Pinchart
2013-07-29  6:19                 ` Tomi Valkeinen

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