]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
usb: gadget: udc-core: fix asymmetric calls in remove_driver
authorKishon Vijay Abraham I <kishon@ti.com>
Wed, 21 Mar 2012 16:04:30 +0000 (21:34 +0530)
committerBen Hutchings <ben@decadent.org.uk>
Fri, 11 May 2012 12:14:03 +0000 (13:14 +0100)
commit 8ae8090c82eb407267001f75b3d256b3bd4ae691 upstream.

During modprobe of gadget driver, pullup is called after
udc_start. In order to make the exit path symmetric when
removing a gadget driver, call pullup before ->udc_stop.

This is needed to avoid issues with PM where udc_stop
disables the module completely (put IP in reset state,
cut functional and interface clocks, and so on), which
prevents us from accessing the IP's address space,
thus creating the possibility of an abort exception
when we try to access IP's address space after clocks
are off.

Signed-off-by: Partha Basak <p-basak2@ti.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/usb/gadget/udc-core.c

index 93b03738c1b1c8ff1330071ea171b88296c5644c..d73ccfe0f8f6e0dc1ff414d9f781ec7c23d8f4c8 100644 (file)
@@ -212,8 +212,8 @@ static void usb_gadget_remove_driver(struct usb_udc *udc)
        if (udc_is_newstyle(udc)) {
                udc->driver->disconnect(udc->gadget);
                udc->driver->unbind(udc->gadget);
-               usb_gadget_udc_stop(udc->gadget, udc->driver);
                usb_gadget_disconnect(udc->gadget);
+               usb_gadget_udc_stop(udc->gadget, udc->driver);
        } else {
                usb_gadget_stop(udc->gadget, udc->driver);
        }