Skip to contentSkip to conversation

Patch "usb: chipidea: otg: remove mutex unlock and lock while stop and start role" has been added to the 4.0-stable tree

PATCH [email protected] 1 participant 1 message May 9, 2015

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

usb: chipidea: otg: remove mutex unlock and lock while stop and start role

to the 4.0-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
usb-chipidea-otg-remove-mutex-unlock-and-lock-while-stop-and-start-role.patch
and it can be found in the queue-4.0 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From a5a356cee89f86ff86cc3ce24136ca1f802c1bf1 Mon Sep 17 00:00:00 2001

From: Li Jun <[email protected]>
Date: Sun, 12 Apr 2015 17:51:02 +0800
Subject: usb: chipidea: otg: remove mutex unlock and lock while stop and start role

From: Li Jun <[email protected]>

commit a5a356cee89f86ff86cc3ce24136ca1f802c1bf1 upstream.

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")
---
 drivers/usb/chipidea/otg_fsm.c |    4 ----
 1 file changed, 4 deletions(-)
drivers/usb/chipidea/otg_fsm.c +0 -4
@@ -537,7 +537,6 @@ static int ci_otg_start_host(struct otg_
 {
 	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);
@@ -546,7 +545,6 @@ static int ci_otg_start_host(struct otg_
 		hw_device_reset(ci);
 		ci_role_start(ci, CI_ROLE_GADGET);
 	}
-	mutex_lock(&fsm->lock);
 	return 0;
 }
 
@@ -554,12 +552,10 @@ static int ci_otg_start_gadget(struct ot
 {
 	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;
 }

Patches currently in stable-queue which might be from [email protected] are

queue-4.0/usb-chipidea-otg-remove-mutex-unlock-and-lock-while-stop-and-start-role.patch