diff mbox

[PATCHv3,1/2] USB: gadget: atmel_usba_udc: Fixed vbus_prev initial state

Message ID 1421601875-9436-2-git-send-email-sylvain.rochet@finsecur.com (mailing list archive)
State New, archived
Headers show

Commit Message

Sylvain Rochet Jan. 18, 2015, 5:24 p.m. UTC
If vbus gpio is high at init, we should set vbus_prev to true
accordingly to the current vbus state. Without that, we skip the first
vbus interrupt because the saved vbus state is not consistent.

Signed-off-by: Sylvain Rochet <sylvain.rochet@finsecur.com>
---
 drivers/usb/gadget/udc/atmel_usba_udc.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Nicolas Ferre Jan. 19, 2015, 2:09 p.m. UTC | #1
Le 18/01/2015 18:24, Sylvain Rochet a écrit :
> If vbus gpio is high at init, we should set vbus_prev to true
> accordingly to the current vbus state. Without that, we skip the first
> vbus interrupt because the saved vbus state is not consistent.
> 
> Signed-off-by: Sylvain Rochet <sylvain.rochet@finsecur.com>

Indeed:
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>

We can also add the following tags:
Fixes: 914a3f3b3754 ("USB: add atmel_usba_udc driver")
Cc: <stable@vger.kernel.org> # 2.6.x-ish

Bye,


> ---
>  drivers/usb/gadget/udc/atmel_usba_udc.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/usb/gadget/udc/atmel_usba_udc.c b/drivers/usb/gadget/udc/atmel_usba_udc.c
> index ce88237..e207d75 100644
> --- a/drivers/usb/gadget/udc/atmel_usba_udc.c
> +++ b/drivers/usb/gadget/udc/atmel_usba_udc.c
> @@ -1791,6 +1791,8 @@ static int atmel_usba_start(struct usb_gadget *gadget,
>  		toggle_bias(1);
>  		usba_writel(udc, CTRL, USBA_ENABLE_MASK);
>  		usba_writel(udc, INT_ENB, USBA_END_OF_RESET);
> +
> +		udc->vbus_prev = 1;
>  	}
>  	spin_unlock_irqrestore(&udc->lock, flags);
>  
>
Felipe Balbi Jan. 19, 2015, 6:55 p.m. UTC | #2
On Mon, Jan 19, 2015 at 03:09:44PM +0100, Nicolas Ferre wrote:
> Le 18/01/2015 18:24, Sylvain Rochet a écrit :
> > If vbus gpio is high at init, we should set vbus_prev to true
> > accordingly to the current vbus state. Without that, we skip the first
> > vbus interrupt because the saved vbus state is not consistent.
> > 
> > Signed-off-by: Sylvain Rochet <sylvain.rochet@finsecur.com>
> 
> Indeed:
> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
> 
> We can also add the following tags:
> Fixes: 914a3f3b3754 ("USB: add atmel_usba_udc driver")
> Cc: <stable@vger.kernel.org> # 2.6.x-ish

Please resend with the proper stable format. Also, this 2.6.x-ish should
be 2.6.24+, git describe helps a lot figuring these out.
Sylvain Rochet Jan. 20, 2015, 11:02 a.m. UTC | #3
Hello,

On Mon, Jan 19, 2015 at 12:55:47PM -0600, Felipe Balbi wrote:
> On Mon, Jan 19, 2015 at 03:09:44PM +0100, Nicolas Ferre wrote:
> > Le 18/01/2015 18:24, Sylvain Rochet a écrit :
> > > If vbus gpio is high at init, we should set vbus_prev to true
> > > accordingly to the current vbus state. Without that, we skip the first
> > > vbus interrupt because the saved vbus state is not consistent.
> > > 
> > > Signed-off-by: Sylvain Rochet <sylvain.rochet@finsecur.com>
> > 
> > Indeed:
> > Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
> > 
> > We can also add the following tags:
> > Fixes: 914a3f3b3754 ("USB: add atmel_usba_udc driver")
> > Cc: <stable@vger.kernel.org> # 2.6.x-ish
> 
> Please resend with the proper stable format. Also, this 2.6.x-ish should
> be 2.6.24+, git describe helps a lot figuring these out.

Unfortunately I failed to understand what I should do. The "Also" 
keyword means for me that there are two differents things to fix:

1. proper stable format
2. 2.6.x-ish ? 2.6.24+

  2. does not imply fixing 1., isn'it ?

I read SubmittingPatches thoroughly and I can't find a reference to 
stable format.

Sylvain
Nicolas Ferre Jan. 20, 2015, 11:11 a.m. UTC | #4
Le 20/01/2015 12:02, Sylvain Rochet a écrit :
> Hello,
> 
> On Mon, Jan 19, 2015 at 12:55:47PM -0600, Felipe Balbi wrote:
>> On Mon, Jan 19, 2015 at 03:09:44PM +0100, Nicolas Ferre wrote:
>>> Le 18/01/2015 18:24, Sylvain Rochet a écrit :
>>>> If vbus gpio is high at init, we should set vbus_prev to true
>>>> accordingly to the current vbus state. Without that, we skip the first
>>>> vbus interrupt because the saved vbus state is not consistent.
>>>>
>>>> Signed-off-by: Sylvain Rochet <sylvain.rochet@finsecur.com>
>>>
>>> Indeed:
>>> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
>>>
>>> We can also add the following tags:
>>> Fixes: 914a3f3b3754 ("USB: add atmel_usba_udc driver")
>>> Cc: <stable@vger.kernel.org> # 2.6.x-ish
>>
>> Please resend with the proper stable format. Also, this 2.6.x-ish should
>> be 2.6.24+, git describe helps a lot figuring these out.
> 
> Unfortunately I failed to understand what I should do. The "Also" 
> keyword means for me that there are two differents things to fix:
> 
> 1. proper stable format
> 2. 2.6.x-ish ? 2.6.24+
> 
>   2. does not imply fixing 1., isn'it ?

Well, I think it does. My understanding is that fixing '2' is the solution.


> I read SubmittingPatches thoroughly and I can't find a reference to 
> stable format.
> 
> Sylvain

Bye,
diff mbox

Patch

diff --git a/drivers/usb/gadget/udc/atmel_usba_udc.c b/drivers/usb/gadget/udc/atmel_usba_udc.c
index ce88237..e207d75 100644
--- a/drivers/usb/gadget/udc/atmel_usba_udc.c
+++ b/drivers/usb/gadget/udc/atmel_usba_udc.c
@@ -1791,6 +1791,8 @@  static int atmel_usba_start(struct usb_gadget *gadget,
 		toggle_bias(1);
 		usba_writel(udc, CTRL, USBA_ENABLE_MASK);
 		usba_writel(udc, INT_ENB, USBA_END_OF_RESET);
+
+		udc->vbus_prev = 1;
 	}
 	spin_unlock_irqrestore(&udc->lock, flags);