Commit 732a4af8 authored by Stephen Boyd's avatar Stephen Boyd Committed by Peter Chen

usb: chipidea: Remove locking in ci_udc_start()

We don't call hw_device_reset() with the ci->lock held, so it
doesn't seem like this lock here is protecting anything. Let's
just remove it. This allows us to call sleeping functions like
phy_init() from within the CI_HDRC_CONTROLLER_RESET_EVENT hook.
Acked-by: default avatarPeter Chen <peter.chen@nxp.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarStephen Boyd <stephen.boyd@linaro.org>
Signed-off-by: default avatarPeter Chen <peter.chen@nxp.com>
parent b90a17c5
...@@ -1725,7 +1725,6 @@ static int ci_udc_start(struct usb_gadget *gadget, ...@@ -1725,7 +1725,6 @@ static int ci_udc_start(struct usb_gadget *gadget,
struct usb_gadget_driver *driver) struct usb_gadget_driver *driver)
{ {
struct ci_hdrc *ci = container_of(gadget, struct ci_hdrc, gadget); struct ci_hdrc *ci = container_of(gadget, struct ci_hdrc, gadget);
unsigned long flags;
int retval = -ENOMEM; int retval = -ENOMEM;
if (driver->disconnect == NULL) if (driver->disconnect == NULL)
...@@ -1752,7 +1751,6 @@ static int ci_udc_start(struct usb_gadget *gadget, ...@@ -1752,7 +1751,6 @@ static int ci_udc_start(struct usb_gadget *gadget,
pm_runtime_get_sync(&ci->gadget.dev); pm_runtime_get_sync(&ci->gadget.dev);
if (ci->vbus_active) { if (ci->vbus_active) {
spin_lock_irqsave(&ci->lock, flags);
hw_device_reset(ci); hw_device_reset(ci);
} else { } else {
usb_udc_vbus_handler(&ci->gadget, false); usb_udc_vbus_handler(&ci->gadget, false);
...@@ -1761,7 +1759,6 @@ static int ci_udc_start(struct usb_gadget *gadget, ...@@ -1761,7 +1759,6 @@ static int ci_udc_start(struct usb_gadget *gadget,
} }
retval = hw_device_state(ci, ci->ep0out->qh.dma); retval = hw_device_state(ci, ci->ep0out->qh.dma);
spin_unlock_irqrestore(&ci->lock, flags);
if (retval) if (retval)
pm_runtime_put_sync(&ci->gadget.dev); pm_runtime_put_sync(&ci->gadget.dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment