Re: [PATCH v2 1/1] usb: chipidea: otg: remove mutex unlock and lock while stop and start role

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Mar 26, 2015 at 04:09:46PM +0800, Li Jun wrote:
> 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: <stable@xxxxxxxxxxxxxxx> # v3.16+
> Signed-off-by: Li Jun <jun.li@xxxxxxxxxxxxx>
> 
> Changes for v2:
> - Add Cc tag for stable@xxxxxxxxxxxxxxx

You may need to add change log after "---", otherwise, the
change log will be showed in commit log which is not expected.
I have changed and applied it, thanks.

> 
> ---
>  drivers/usb/chipidea/otg_fsm.c | 4 ----
>  1 file changed, 4 deletions(-)
> 
> diff --git a/drivers/usb/chipidea/otg_fsm.c b/drivers/usb/chipidea/otg_fsm.c
> index 82b1e23..789dd76 100644
> --- a/drivers/usb/chipidea/otg_fsm.c
> +++ b/drivers/usb/chipidea/otg_fsm.c
> @@ -531,7 +531,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);
> @@ -540,7 +539,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;
>  }
>  
> @@ -548,12 +546,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;
>  }
> -- 
> 1.9.1
> 

-- 

Best Regards,
Peter Chen
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]