提交 8ae8090c 编写于 作者: K Kishon Vijay Abraham I 提交者: Felipe Balbi

usb: gadget: udc-core: fix asymmetric calls in remove_driver

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.

Cc: stable@vger.kernel.org
Signed-off-by: NPartha Basak <p-basak2@ti.com>
Signed-off-by: NKishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: NFelipe Balbi <balbi@ti.com>
上级 3006dc8c
...@@ -264,8 +264,8 @@ static void usb_gadget_remove_driver(struct usb_udc *udc) ...@@ -264,8 +264,8 @@ static void usb_gadget_remove_driver(struct usb_udc *udc)
if (udc_is_newstyle(udc)) { if (udc_is_newstyle(udc)) {
udc->driver->disconnect(udc->gadget); udc->driver->disconnect(udc->gadget);
udc->driver->unbind(udc->gadget); udc->driver->unbind(udc->gadget);
usb_gadget_udc_stop(udc->gadget, udc->driver);
usb_gadget_disconnect(udc->gadget); usb_gadget_disconnect(udc->gadget);
usb_gadget_udc_stop(udc->gadget, udc->driver);
} else { } else {
usb_gadget_stop(udc->gadget, udc->driver); usb_gadget_stop(udc->gadget, udc->driver);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册