[PATCH v2] ARM: davinci: da8xx: Fix sleeping function called from invalid context
Sekhar Nori
nsekhar at ti.com
Thu Dec 1 06:17:12 PST 2016
On Tuesday 29 November 2016 10:18 PM, Alexandre Bailon wrote:
> Everytime the usb20 phy is enabled, there is a
> "sleeping function called from invalid context" BUG.
>
> clk_enable() from arch/arm/mach-davinci/clock.c uses spin_lock_irqsave()
> before to invoke the callback usb20_phy_clk_enable().
"before invocation of the callback"? (doesn't read right otherwise)
> usb20_phy_clk_enable() uses clk_get() and clk_enable_prepapre()
clk_prepare_enable()
> which may sleep.
> Move clk_get() to da8xx_register_usb20_phy_clk() and
> replace clk_prepare_enable() by clk_enable().
>
> Signed-off-by: Alexandre Bailon <abailon at baylibre.com>
> @@ -287,9 +281,15 @@ int __init da8xx_register_usb20_phy_clk(bool use_usb_refclkin)
> struct clk *parent;
> int ret = 0;
>
> + usb20_clk = clk_get(&da8xx_usb20_dev.dev, "usb20");
> + if (IS_ERR(usb20_clk))
> + return PTR_ERR(parent);
Typo here. Should be PTR_ERR(usb20_clk)
Thanks,
Sekhar
More information about the linux-arm-kernel
mailing list