u-boot.lists.denx.de archive mirror
 help / color / mirror / Atom feed
* [PATCH] usb: gadget: dwc2_udc_otg: set ep's desc during enable/disable
@ 2022-01-06 15:02 Gary Bisson
  2022-01-06 15:21 ` Neil Armstrong
  2022-01-09  1:28 ` Tom Rini
  0 siblings, 2 replies; 5+ messages in thread
From: Gary Bisson @ 2022-01-06 15:02 UTC (permalink / raw)
  To: u-boot
  Cc: lukma, marex, peter.chen, jun.li, peng.fan, narmstrong, Gary Bisson

Fastboot support has been broken on platforms using dwc2 controller
since the gadget gets its max packet size from it.
This patch is the equivalent of 723fd5668ff which fixed the same issue
but for the chipidea controller.

Fixes: 27c9141b111 ("usb: gadget: fastboot: use correct max packet size")

Signed-off-by: Gary Bisson <gary.bisson@boundarydevices.com>
---
 drivers/usb/gadget/dwc2_udc_otg.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/usb/gadget/dwc2_udc_otg.c b/drivers/usb/gadget/dwc2_udc_otg.c
index 2f318144421..fb10884755b 100644
--- a/drivers/usb/gadget/dwc2_udc_otg.c
+++ b/drivers/usb/gadget/dwc2_udc_otg.c
@@ -655,6 +655,7 @@ static int dwc2_ep_enable(struct usb_ep *_ep,
 		return -ESHUTDOWN;
 	}
 
+	_ep->desc = desc;
 	ep->stopped = 0;
 	ep->desc = desc;
 	ep->pio_irqs = 0;
@@ -695,6 +696,7 @@ static int dwc2_ep_disable(struct usb_ep *_ep)
 	/* Nuke all pending requests */
 	nuke(ep, -ESHUTDOWN);
 
+	_ep->desc = NULL;
 	ep->desc = 0;
 	ep->stopped = 1;
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] usb: gadget: dwc2_udc_otg: set ep's desc during enable/disable
  2022-01-06 15:02 [PATCH] usb: gadget: dwc2_udc_otg: set ep's desc during enable/disable Gary Bisson
@ 2022-01-06 15:21 ` Neil Armstrong
  2022-01-06 19:55   ` Marek Vasut
  2022-01-09  1:28 ` Tom Rini
  1 sibling, 1 reply; 5+ messages in thread
From: Neil Armstrong @ 2022-01-06 15:21 UTC (permalink / raw)
  To: Gary Bisson, u-boot
  Cc: lukma, marex, peter.chen, jun.li, peng.fan, u-boot-amlogic

Hi,

On 06/01/2022 16:02, Gary Bisson wrote:
> Fastboot support has been broken on platforms using dwc2 controller
> since the gadget gets its max packet size from it.
> This patch is the equivalent of 723fd5668ff which fixed the same issue
> but for the chipidea controller.
> 
> Fixes: 27c9141b111 ("usb: gadget: fastboot: use correct max packet size")
> 
> Signed-off-by: Gary Bisson <gary.bisson@boundarydevices.com>
> ---
>  drivers/usb/gadget/dwc2_udc_otg.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/usb/gadget/dwc2_udc_otg.c b/drivers/usb/gadget/dwc2_udc_otg.c
> index 2f318144421..fb10884755b 100644
> --- a/drivers/usb/gadget/dwc2_udc_otg.c
> +++ b/drivers/usb/gadget/dwc2_udc_otg.c
> @@ -655,6 +655,7 @@ static int dwc2_ep_enable(struct usb_ep *_ep,
>  		return -ESHUTDOWN;
>  	}
>  
> +	_ep->desc = desc;
>  	ep->stopped = 0;
>  	ep->desc = desc;

Indeed the _ep and ep was confusing when looking code

>  	ep->pio_irqs = 0;
> @@ -695,6 +696,7 @@ static int dwc2_ep_disable(struct usb_ep *_ep)
>  	/* Nuke all pending requests */
>  	nuke(ep, -ESHUTDOWN);
>  
> +	_ep->desc = NULL;
>  	ep->desc = 0;
>  	ep->stopped = 1;
>  
> 

An off-tree patch removed from our Yukawa backlog, thanks !

Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>

Neil

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] usb: gadget: dwc2_udc_otg: set ep's desc during enable/disable
  2022-01-06 15:21 ` Neil Armstrong
@ 2022-01-06 19:55   ` Marek Vasut
  2022-01-07 15:25     ` Mattijs Korpershoek
  0 siblings, 1 reply; 5+ messages in thread
From: Marek Vasut @ 2022-01-06 19:55 UTC (permalink / raw)
  To: Neil Armstrong, Gary Bisson, u-boot, Tom Rini
  Cc: lukma, peter.chen, jun.li, peng.fan, u-boot-amlogic

On 1/6/22 16:21, Neil Armstrong wrote:
> Hi,
> 
> On 06/01/2022 16:02, Gary Bisson wrote:
>> Fastboot support has been broken on platforms using dwc2 controller
>> since the gadget gets its max packet size from it.
>> This patch is the equivalent of 723fd5668ff which fixed the same issue
>> but for the chipidea controller.
>>
>> Fixes: 27c9141b111 ("usb: gadget: fastboot: use correct max packet size")
>>
>> Signed-off-by: Gary Bisson <gary.bisson@boundarydevices.com>
>> ---
>>   drivers/usb/gadget/dwc2_udc_otg.c | 2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/usb/gadget/dwc2_udc_otg.c b/drivers/usb/gadget/dwc2_udc_otg.c
>> index 2f318144421..fb10884755b 100644
>> --- a/drivers/usb/gadget/dwc2_udc_otg.c
>> +++ b/drivers/usb/gadget/dwc2_udc_otg.c
>> @@ -655,6 +655,7 @@ static int dwc2_ep_enable(struct usb_ep *_ep,
>>   		return -ESHUTDOWN;
>>   	}
>>   
>> +	_ep->desc = desc;
>>   	ep->stopped = 0;
>>   	ep->desc = desc;
> 
> Indeed the _ep and ep was confusing when looking code
> 
>>   	ep->pio_irqs = 0;
>> @@ -695,6 +696,7 @@ static int dwc2_ep_disable(struct usb_ep *_ep)
>>   	/* Nuke all pending requests */
>>   	nuke(ep, -ESHUTDOWN);
>>   
>> +	_ep->desc = NULL;
>>   	ep->desc = 0;
>>   	ep->stopped = 1;
>>   
>>
> 
> An off-tree patch removed from our Yukawa backlog, thanks !
> 
> Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>

+CC Tom, can you pick this one for CURRENT 2022.01 release?

Thank you

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] usb: gadget: dwc2_udc_otg: set ep's desc during enable/disable
  2022-01-06 19:55   ` Marek Vasut
@ 2022-01-07 15:25     ` Mattijs Korpershoek
  0 siblings, 0 replies; 5+ messages in thread
From: Mattijs Korpershoek @ 2022-01-07 15:25 UTC (permalink / raw)
  To: Marek Vasut, Neil Armstrong, Gary Bisson, u-boot, Tom Rini
  Cc: lukma, peter.chen, jun.li, peng.fan, u-boot-amlogic

Hi Gary,

Thank you for your patch.

Marek Vasut <marex@denx.de> writes:

> On 1/6/22 16:21, Neil Armstrong wrote:
>> Hi,
>> 
>> On 06/01/2022 16:02, Gary Bisson wrote:
>>> Fastboot support has been broken on platforms using dwc2 controller
>>> since the gadget gets its max packet size from it.
>>> This patch is the equivalent of 723fd5668ff which fixed the same issue
>>> but for the chipidea controller.
>>>
>>> Fixes: 27c9141b111 ("usb: gadget: fastboot: use correct max packet size")
>>>
>>> Signed-off-by: Gary Bisson <gary.bisson@boundarydevices.com>
>>> ---
>>>   drivers/usb/gadget/dwc2_udc_otg.c | 2 ++
>>>   1 file changed, 2 insertions(+)
>>>
>>> diff --git a/drivers/usb/gadget/dwc2_udc_otg.c b/drivers/usb/gadget/dwc2_udc_otg.c
>>> index 2f318144421..fb10884755b 100644
>>> --- a/drivers/usb/gadget/dwc2_udc_otg.c
>>> +++ b/drivers/usb/gadget/dwc2_udc_otg.c
>>> @@ -655,6 +655,7 @@ static int dwc2_ep_enable(struct usb_ep *_ep,
>>>   		return -ESHUTDOWN;
>>>   	}
>>>   
>>> +	_ep->desc = desc;
>>>   	ep->stopped = 0;
>>>   	ep->desc = desc;
>> 
>> Indeed the _ep and ep was confusing when looking code
>> 
>>>   	ep->pio_irqs = 0;
>>> @@ -695,6 +696,7 @@ static int dwc2_ep_disable(struct usb_ep *_ep)
>>>   	/* Nuke all pending requests */
>>>   	nuke(ep, -ESHUTDOWN);
>>>   
>>> +	_ep->desc = NULL;
>>>   	ep->desc = 0;
>>>   	ep->stopped = 1;
>>>   
>>>
>> 
>> An off-tree patch removed from our Yukawa backlog, thanks !
>> 
>> Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
I can confirm this fixes flashing issues on VIM3/VIM3L boards when
flashing AOSP(yukawa) with fastboot.

Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
>
> +CC Tom, can you pick this one for CURRENT 2022.01 release?
>
> Thank you

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] usb: gadget: dwc2_udc_otg: set ep's desc during enable/disable
  2022-01-06 15:02 [PATCH] usb: gadget: dwc2_udc_otg: set ep's desc during enable/disable Gary Bisson
  2022-01-06 15:21 ` Neil Armstrong
@ 2022-01-09  1:28 ` Tom Rini
  1 sibling, 0 replies; 5+ messages in thread
From: Tom Rini @ 2022-01-09  1:28 UTC (permalink / raw)
  To: Gary Bisson
  Cc: u-boot, lukma, marex, peter.chen, jun.li, peng.fan, narmstrong

[-- Attachment #1: Type: text/plain, Size: 616 bytes --]

On Thu, Jan 06, 2022 at 04:02:08PM +0100, Gary Bisson wrote:

> Fastboot support has been broken on platforms using dwc2 controller
> since the gadget gets its max packet size from it.
> This patch is the equivalent of 723fd5668ff which fixed the same issue
> but for the chipidea controller.
> 
> Fixes: 27c9141b111 ("usb: gadget: fastboot: use correct max packet size")
> 
> Signed-off-by: Gary Bisson <gary.bisson@boundarydevices.com>
> Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
> Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>

Applied to u-boot/master, thanks!

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-01-09  1:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-06 15:02 [PATCH] usb: gadget: dwc2_udc_otg: set ep's desc during enable/disable Gary Bisson
2022-01-06 15:21 ` Neil Armstrong
2022-01-06 19:55   ` Marek Vasut
2022-01-07 15:25     ` Mattijs Korpershoek
2022-01-09  1:28 ` Tom Rini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).