Re: [ 45/62] usb: musb: omap: fix crash when musb glue (omap) gets initialized

Ben Hutchings
2012-04-26T00:41:12Z

On Tue, Apr 24, 2012 at 03:33:26PM -0700, Greg KH wrote:
> 3.3-stable review patch. If anyone has any objections, please let me know.
>
> ------------------
>
> From: Kishon Vijay Abraham I <kishon@ti.com>
>
> commit 3006dc8c627d738693e910c159630e4368c9e86c upstream.
>
> pm_runtime_enable is being called after omap2430_musb_init. Hence
> pm_runtime_get_sync in omap2430_musb_init does not have any effect (does
> not enable clocks) resulting in a crash during register access. It is
> fixed here.
>
> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
> Signed-off-by: Felipe Balbi <balbi@ti.com>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>
> ---
> drivers/usb/musb/omap2430.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> --- a/drivers/usb/musb/omap2430.c
> +++ b/drivers/usb/musb/omap2430.c
> @@ -451,14 +451,14 @@ static int __init omap2430_probe(struct
> goto err2;
> }
>
> + pm_runtime_enable(&pdev->dev);
> +
> ret = platform_device_add(musb);
> if (ret) {
> dev_err(&pdev->dev, "failed to register musb device\n");

This failure path now needs a call to pm_runtime_disable().

Ben.

> goto err2;
> }
>
> - pm_runtime_enable(&pdev->dev);
> -
> return 0;
>
> err2:

--
Ben Hutchings
We get into the habit of living before acquiring the habit of thinking.
- Albert Camus