]> git.baikalelectronics.ru Git - kernel.git/commit
usb: musb: gadget: Fix out-of-sync runtime pm calls
authorJarkko Nikula <jhnikula@gmail.com>
Fri, 29 Apr 2011 13:17:35 +0000 (16:17 +0300)
committerFelipe Balbi <balbi@ti.com>
Mon, 2 May 2011 09:34:33 +0000 (12:34 +0300)
commitd4d5999131827ac1b3827ec3a1be3fb1a4162725
treef7109dc93d436d74158c0e7ff9a93adc34b19aac
parent8470985f86b2732b5eeb24ba9f4cab037cfc6f13
usb: musb: gadget: Fix out-of-sync runtime pm calls

If cable is not connected to peripheral only board when initializing the
gadget driver, then runtime pm calls are out-of-sync and the musb cannot
idle with omap2430.c. This was noted on Nokia N900 where musb prevented the
CPU to be able to enter deeper retention idle state.

This was working in 2.6.38 before runtime pm conversions but there musb
smart standby/idle modes were configured statically where they are now
updated runtime depending on use and cable status.

Reason for out-of-sync is that runtime pm is activated in function
musb_gadget.c: usb_gadget_probe_driver but suspended only in OTG mode if
cable is not connected when initializing. In peripheral only mode this leads
to out-of-sync runtime pm since runtime pm remain active and is activated
another time in omap2430.c: musb_otg_notifications for VBUS Connect event
and thus cannot suspend for VBUS Disconnect event since the use count remains
active.

Fix this by moving cable status check and pm_runtime_put call in
usb_gadget_probe_driver out of is_otg_enabled block.

Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/musb/musb_gadget.c