From: "Jakub Piotr Cłapa" <jpc-ml@zenburn.net>
To: linux-media <linux-media@vger.kernel.org>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Subject: [omap3isp] xclk deadlock
Date: Wed, 03 Jul 2013 03:00:06 +0200 [thread overview]
Message-ID: <51D37796.2000601@zenburn.net> (raw)
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
next reply other threads:[~2013-07-03 1:00 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-03 1:00 Jakub Piotr Cłapa [this message]
2013-07-04 20:21 ` [omap3isp] xclk deadlock 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=51D37796.2000601@zenburn.net \
--to=jpc-ml@zenburn.net \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox