mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-20 05:31:15 +00:00
usb: chipidea: otg: remove mutex unlock and lock while stop and start role
Wrongly release mutex lock during otg_statemachine may result in re-enter
otg_statemachine, which is not allowed, we should do next state transtition
after previous one completed.
Fixes: 826cfe751f
("usb: chipidea: add OTG fsm operation functions implementation")
Cc: <stable@vger.kernel.org> # v3.16+
Signed-off-by: Li Jun <jun.li@freescale.com>
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
8e779c6c4a
commit
a5a356cee8
1 changed files with 0 additions and 4 deletions
|
@ -520,7 +520,6 @@ static int ci_otg_start_host(struct otg_fsm *fsm, int on)
|
||||||
{
|
{
|
||||||
struct ci_hdrc *ci = container_of(fsm, struct ci_hdrc, fsm);
|
struct ci_hdrc *ci = container_of(fsm, struct ci_hdrc, fsm);
|
||||||
|
|
||||||
mutex_unlock(&fsm->lock);
|
|
||||||
if (on) {
|
if (on) {
|
||||||
ci_role_stop(ci);
|
ci_role_stop(ci);
|
||||||
ci_role_start(ci, CI_ROLE_HOST);
|
ci_role_start(ci, CI_ROLE_HOST);
|
||||||
|
@ -529,7 +528,6 @@ static int ci_otg_start_host(struct otg_fsm *fsm, int on)
|
||||||
hw_device_reset(ci);
|
hw_device_reset(ci);
|
||||||
ci_role_start(ci, CI_ROLE_GADGET);
|
ci_role_start(ci, CI_ROLE_GADGET);
|
||||||
}
|
}
|
||||||
mutex_lock(&fsm->lock);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -537,12 +535,10 @@ static int ci_otg_start_gadget(struct otg_fsm *fsm, int on)
|
||||||
{
|
{
|
||||||
struct ci_hdrc *ci = container_of(fsm, struct ci_hdrc, fsm);
|
struct ci_hdrc *ci = container_of(fsm, struct ci_hdrc, fsm);
|
||||||
|
|
||||||
mutex_unlock(&fsm->lock);
|
|
||||||
if (on)
|
if (on)
|
||||||
usb_gadget_vbus_connect(&ci->gadget);
|
usb_gadget_vbus_connect(&ci->gadget);
|
||||||
else
|
else
|
||||||
usb_gadget_vbus_disconnect(&ci->gadget);
|
usb_gadget_vbus_disconnect(&ci->gadget);
|
||||||
mutex_lock(&fsm->lock);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue