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: <sta...@vger.kernel.org> # v3.16+
> Signed-off-by: Li Jun <jun...@freescale.com>
> 
> Changes for v2:
> - Add Cc tag for sta...@vger.kernel.org

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 linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to