public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
To: ext Kevin Hilman <khilman@deeprootsystems.com>
Cc: linux-omap@vger.kernel.org
Subject: Re: Bug in linux omap clock framework?
Date: Mon, 08 Dec 2008 09:59:38 +0200	[thread overview]
Message-ID: <1228723178.8668.6.camel@tubuntu> (raw)
In-Reply-To: <877i6ejxb4.fsf@deeprootsystems.com>

On Fri, 2008-12-05 at 10:23 -0800, ext Kevin Hilman wrote:
> <Tomi.Valkeinen@nokia.com> writes:
> 
> > Hi,
> >
> > I have had strange clk_enable() crashes with DSS2, and now I managed to
> > isolate it. With the included patch, on OMAP3 SDP board, with default
> > kernel config, I always get the crash below. In this example case it
> > happens at specific time on boot, but with DSS2 it happens randomly at
> > runtime, when I enable the DSS clocks.
> >
> > diff --git a/drivers/video/omap/omapfb_main.c
> > b/drivers/video/omap/omapfb_main.c
> > index 3bb4247..2d5ef0d 100644
> > --- a/drivers/video/omap/omapfb_main.c
> > +++ b/drivers/video/omap/omapfb_main.c
> > @@ -27,6 +27,7 @@
> >  #include <linux/platform_device.h>
> >  #include <linux/mm.h>
> >  #include <linux/uaccess.h>
> > +#include <linux/clk.h>
> >  
> >  #include <mach/dma.h>
> >  #include <mach/omapfb.h>
> > @@ -1806,6 +1807,18 @@ static int omapfb_probe(struct platform_device
> > *pdev)
> >  {
> >         BUG_ON(fbdev_pdev != NULL);
> >  
> > +       {
> > +               struct clk *c1, *c2;
> > +               c1 = clk_get(&pdev->dev, "dss_ick");
> > +               c2 = clk_get(&pdev->dev, "dss1_fck");
> > +               while(1) {
> > +                       clk_enable(c1);
> > +                       clk_enable(c2);
> > +                       clk_disable(c1);
> > +                       clk_disable(c2);
> > +               }
> > +       }
> > +
> >         /* Delay actual initialization until the LCD is registered */
> >         fbdev_pdev = pdev;
> >         if (fbdev_panel != NULL)
> > @@ -1958,7 +1971,7 @@ module_param_named(rotate, def_rotate, uint,
> > 0664);
> >  module_param_named(mirror, def_mirror, uint, 0664);
> >  module_param_named(manual_update, manual_update, bool, 0664);
> >  
> > -module_init(omapfb_init);
> > +late_initcall(omapfb_init);
> >  module_exit(omapfb_cleanup);
> >  
> >  MODULE_DESCRIPTION("TI OMAP framebuffer driver");
> >
> >
> > And the crash:
> >
> >
> >
> > <1>Unhandled fault: external abort on non-linefetch (0x1028) at
> > 0xd8200098
> > Unhandled fault: external abort on non-linefetch (0x1028) at 0xd8200098
> > Internal error: : 1028 [#1]
> > Internal error: : 1028 [#1]
> > Modules linked in:Modules linked in:
> >
> > CPU: 0    Not tainted  (2.6.28-rc6-omap1-05264-g1705711-dirty #6)
> > CPU: 0    Not tainted  (2.6.28-rc6-omap1-05264-g1705711-dirty #6)
> > PC is at __irq_svc+0x34/0x80
> > PC is at __irq_svc+0x34/0x80
> > LR is at _omap2_clk_enable+0xa0/0xe0
> > LR is at _omap2_clk_enable+0xa0/0xe0
> 
> What looks to be happening is an interrupt is firing in the middle of
> your clk_enable() call, and accesses to the Interrupt controller
> registers are triggering a fault.
> 
> As a temporary workaround, could you try wrapping your clk_enable() 
> with an IRQ save/restore?  Something like:
> 
>   local_irq_save(flags);
>   clk_enable(c);
>   local_irq_restore(flags);
> 
> If this works, then we need to investigate in more detail which
> interrupt is firing, and why the INTC registers are not accessible.

No, I get the same error with irq_saves also. However, if I wrap the
whole while loop inside local_irq_save, then it doesn't crash.

So this does crash:

		while(1) {
			local_irq_save(flags);
			clk_enable(c1);
			local_irq_restore(flags);

			local_irq_save(flags);
			clk_disable(c1);
			local_irq_restore(flags);
		}

And this doesn't:

		local_irq_save(flags);
		while(1) {
			clk_enable(c1);
			clk_disable(c1);
		}

 Tomi



  reply	other threads:[~2008-12-08  7:59 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-05 14:49 Bug in linux omap clock framework? Tomi.Valkeinen
2008-12-05 18:23 ` Kevin Hilman
2008-12-08  7:59   ` Tomi Valkeinen [this message]
2008-12-06 23:51 ` Paul Walmsley
2008-12-08  8:59   ` Tomi Valkeinen
2008-12-08  9:24     ` Paul Walmsley
2008-12-08  9:36       ` Tomi Valkeinen
2008-12-09 13:58       ` Tomi Valkeinen
2008-12-09 23:14         ` Paul Walmsley
2008-12-10  3:04           ` Igor Stoppa
2008-12-10  7:02             ` Paul Walmsley
2008-12-10  7:37         ` Högander Jouni
2008-12-10  7:59           ` Tomi Valkeinen
2008-12-10  8:44             ` Högander Jouni
2008-12-10  8:57               ` Tomi Valkeinen
2008-12-10 10:44                 ` Högander Jouni
2008-12-10 11:53                   ` Tomi Valkeinen
2008-12-11  9:19         ` Högander Jouni
2008-12-11 16:17           ` Paul Walmsley
2008-12-12  7:48             ` Tomi Valkeinen
2008-12-09  9:15   ` 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=1228723178.8668.6.camel@tubuntu \
    --to=tomi.valkeinen@nokia.com \
    --cc=khilman@deeprootsystems.com \
    --cc=linux-omap@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