]> git.baikalelectronics.ru Git - kernel.git/commit
usb: musb: fix oops on musb_gadget_pullup
authorJohn Stultz <john.stultz@linaro.org>
Thu, 21 Jul 2011 00:09:34 +0000 (17:09 -0700)
committerFelipe Balbi <balbi@ti.com>
Fri, 12 Aug 2011 08:52:42 +0000 (11:52 +0300)
commitbfd5482505c36a0e0c9d12da300cb8df7194ba31
treec713fdba9768c87a6d253d838235dab11c0a30de
parent679e50d1a064b184b8af4b137151541d859d8512
usb: musb: fix oops on musb_gadget_pullup

an 'unhandled fault' is causes when a gadget driver calls
usb_gadget_connect() while the USB cable isn't plugged into
the OTG port.

the fault is caused by an access to MUSB's memory space
while its clock is turned off due to pm_runtime kicking
in.

in order to fix the fault, we enclose musb_gadget_pullup()
with pm_runtime_get_sync() ... pm_runtime_put() calls to
be sure we will always reach that path with clock turned on.

[ balbi@ti.com : simplified commit log; removed few things
which didn't belong there ]

Cc: stable@kernel.org
Reported-by: Zach Pfeffer <zach.pfeffer@linaro.org>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/musb/musb_gadget.c