• Tony Lindgren's avatar
    usb: musb: Add missing pm_runtime_disable and drop 2430 PM timeout · 536d599d
    Tony Lindgren authored
    We are missing pm_runtime_disable() in 2430 glue layer. Further,
    we only need to enable PM runtime and disable it on exit. With
    musb_core.c doing PM, the glue layer as a parent will always be
    active when musb_core.c is active.
    
    This fixes host enumeration issues with some devices as reported
    by Ladislav Michl <ladis@linux-mips.org>.
    
    And holding an RPM reference while deregistering the child would
    lead to a crash in omap2430_runtime_suspend() which dereferences
    the now freed child's driver data on put as pointed out by
    Johan Hovold <johan@kernel.org>:
    
    Unable to handle kernel paging request at virtual address 6b6b6f17
    ...
    [<c05453d4>] (omap2430_runtime_suspend) from [<c0481410>]
     (pm_generic_runtime_suspend+0x3c/0x48)
    [<c0481410>] (pm_generic_runtime_suspend) from [<c0121028>]
     (_od_runtime_suspend+0x1c/0x30)
    [<c0121028>] (_od_runtime_suspend) from [<c04833b0>] (__rpm_callback+0x3c/0x70)
    [<c04833b0>] (__rpm_callback) from [<c0483414>] (rpm_callback+0x30/0x90)
    [<c0483414>] (rpm_callback) from [<c0483984>] (rpm_suspend+0x118/0x6b4)
    [<c0483984>] (rpm_suspend) from [<c04840f4>] (rpm_idle+0x104/0x440)
    [<c04840f4>] (rpm_idle) from [<c04844ac>] (__pm_runtime_idle+0x7c/0xb0)
    [<c04844ac>] (__pm_runtime_idle) from [<c0545458>] (omap2430_remove+0x38/0x58)
    [<c0545458>] (omap2430_remove) from [<c047b2bc>] (platform_drv_remove+0x34/0x4c)
    
    Note that if changes are needed to the autosuspend timeout, it should
    be done in musb_core.c.
    Reported-by: default avatarLadislav Michl <ladis@linux-mips.org>
    Fixes: 87326e85 ("usb: musb: Remove extra PM runtime calls from
    2430 glue layer")
    Tested-by: default avatarLadislav Michl <ladis@linux-mips.org>
    Reviewed-by: default avatarJohan Hovold <johan@kernel.org>
    Tested-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
    Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
    Signed-off-by: default avatarBin Liu <b-liu@ti.com>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    536d599d
omap2430.c 15.6 KB