projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8e779c6
)
usb: chipidea: otg: remove mutex unlock and lock while stop and start role
author
Li Jun
<
[email protected]
>
Sun, 12 Apr 2015 09:51:02 +0000
(17:51 +0800)
committer
Greg Kroah-Hartman
<
[email protected]
>
Tue, 28 Apr 2015 10:51:30 +0000
(12:51 +0200)
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: 826cfe751f3e ("usb: chipidea: add OTG fsm operation functions implementation")
Cc: <
[email protected]
> # v3.16+
Signed-off-by: Li Jun <
[email protected]
>
Signed-off-by: Peter Chen <
[email protected]
>
Signed-off-by: Greg Kroah-Hartman <
[email protected]
>
drivers/usb/chipidea/otg_fsm.c
patch
|
blob
|
history
diff --git
a/drivers/usb/chipidea/otg_fsm.c
b/drivers/usb/chipidea/otg_fsm.c
index 083acf45ad5aba6cc9e0fe6c9c7d94b3e0fcd85c..19d655a743b55eb8e17f4308bc722a40bfe4e505 100644
(file)
--- a/
drivers/usb/chipidea/otg_fsm.c
+++ b/
drivers/usb/chipidea/otg_fsm.c
@@
-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);
- mutex_unlock(&fsm->lock);
if (on) {
ci_role_stop(ci);
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);
ci_role_start(ci, CI_ROLE_GADGET);
}
- mutex_lock(&fsm->lock);
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);
- mutex_unlock(&fsm->lock);
if (on)
usb_gadget_vbus_connect(&ci->gadget);
else
usb_gadget_vbus_disconnect(&ci->gadget);
- mutex_lock(&fsm->lock);
return 0;
}