All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Turquette <mturquette@linaro.org>
To: Kevin Hilman <khilman@linaro.org>, Felipe Balbi <balbi@ti.com>,
	Roger Quadros <rogerq@ti.com>
Cc: linux-omap <linux-omap@vger.kernel.org>
Subject: Re: OMAP EHCI having clock problems?
Date: Thu, 14 Feb 2013 21:12:46 -0800	[thread overview]
Message-ID: <20130215051246.11471.99180@quantum> (raw)
In-Reply-To: <87halea4s3.fsf@linaro.org>

Quoting Kevin Hilman (2013-02-14 14:50:52)
> Any idea what's going on?

Looks like a couple of different things.

> [    0.515747] usbhs_omap usbhs_omap: ehci_logic_fck failed:-2

Seems like the clk_get lookup failed here in usbhs_omap_probe.  So from
this point on omap->ehci_logic_fck == -ENOENT.  This bogus value gets
passed into all of the clk apis, which leads us to the below error.

> [    0.516021] ------------[ cut here ]------------
> [    0.516082] WARNING: at /work/kernel/omap/dev/drivers/clk/clk.c:522 __clk_enable+0x8c/0x9c()
> [    0.516082] Modules linked in:
> [    0.516143] [<c00145a8>] (unwind_backtrace+0x0/0xf0) from [<c003bd6c>] (warn_slowpath_common+0x4c/0x64)
> [    0.516143] [<c003bd6c>] (warn_slowpath_common+0x4c/0x64) from [<c003bda0>] (warn_slowpath_null+0x1c/0x24)
> [    0.516174] [<c003bda0>] (warn_slowpath_null+0x1c/0x24) from [<c0412758>] (__clk_enable+0x8c/0x9c)
> [    0.516174] [<c0412758>] (__clk_enable+0x8c/0x9c) from [<c0412788>] (clk_enable+0x20/0x3c)
> [    0.516204] [<c0412788>] (clk_enable+0x20/0x3c) from [<c03317fc>] (usbhs_runtime_resume+0x60/0xa4)
> [    0.516235] [<c03317fc>] (usbhs_runtime_resume+0x60/0xa4) from [<c031b408>] (pm_generic_runtime_resume+0x2c/0x40)
> [    0.516265] [<c031b408>] (pm_generic_runtime_resume+0x2c/0x40) from [<c031f07c>] (__rpm_callback+0x34/0x70)
> [    0.516296] [<c031f07c>] (__rpm_callback+0x34/0x70) from [<c0320040>] (rpm_resume+0x3bc/0x648)
> [    0.516326] [<c0320040>] (rpm_resume+0x3bc/0x648) from [<c0320548>] (__pm_runtime_resume+0x48/0x60)
> [    0.516326] [<c0320548>] (__pm_runtime_resume+0x48/0x60) from [<c0331bf0>] (usbhs_omap_probe+0x200/0x840)
> [    0.516357] [<c0331bf0>] (usbhs_omap_probe+0x200/0x840) from [<c0317d24>] (platform_drv_probe+0x18/0x1c)
> [    0.516387] [<c0317d24>] (platform_drv_probe+0x18/0x1c) from [<c0316ae4>] (driver_probe_device+0x78/0x210)
> [    0.516387] [<c0316ae4>] (driver_probe_device+0x78/0x210) from [<c0316d10>] (__driver_attach+0x94/0x98)
> [    0.516418] [<c0316d10>] (__driver_attach+0x94/0x98) from [<c03153e4>] (bus_for_each_dev+0x50/0x7c)
> [    0.516448] [<c03153e4>] (bus_for_each_dev+0x50/0x7c) from [<c0316310>] (bus_add_driver+0x178/0x240)
> [    0.516448] [<c0316310>] (bus_add_driver+0x178/0x240) from [<c03171dc>] (driver_register+0x78/0x144)
> [    0.516479] [<c03171dc>] (driver_register+0x78/0x144) from [<c0317f14>] (platform_driver_probe+0x18/0x9c)
> [    0.516479] [<c0317f14>] (platform_driver_probe+0x18/0x9c) from [<c00086e4>] (do_one_initcall+0x34/0x178)
> [    0.516510] [<c00086e4>] (do_one_initcall+0x34/0x178) from [<c06ea8f8>] (kernel_init_freeable+0xfc/0x1cc)
> [    0.516571] [<c06ea8f8>] (kernel_init_freeable+0xfc/0x1cc) from [<c04d7a78>] (kernel_init+0x8/0xe4)
> [    0.516571] [<c04d7a78>] (kernel_init+0x8/0xe4) from [<c000dd10>] (ret_from_fork+0x14/0x24)
> [    0.516693] ---[ end trace e713e7725948e018 ]---

This WARN gets tripped when a clock is enabled but not prepared.  From
__clk_enable in drivers/clk/clk.c:

        if (WARN_ON(clk->prepare_count == 0))
                return -ESHUTDOWN;

So we're basically dereferencing a bogus struct clk pointer in
__clk_enable and the memory address of clk->prepare_count just happens
to be zero filled.

On a related note, even if the clk_get lookup did not fail this WARN
would still be hit since this driver never once calls clk_prepare.

Regards,
Mike


  reply	other threads:[~2013-02-15  5:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-14 22:50 OMAP EHCI having clock problems? Kevin Hilman
2013-02-15  5:12 ` Mike Turquette [this message]
2013-02-15  7:54 ` Roger Quadros
2013-02-15 15:54   ` Kevin Hilman
2013-02-15 16:04     ` Felipe Balbi
2013-02-18  9:49     ` Roger Quadros
2013-02-18 14:47       ` Kevin Hilman
2013-02-18 14:51         ` Roger Quadros

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=20130215051246.11471.99180@quantum \
    --to=mturquette@linaro.org \
    --cc=balbi@ti.com \
    --cc=khilman@linaro.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=rogerq@ti.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.