stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] usb: dwc3: gadget: Remove FS bInterval_m1 limitation
@ 2021-04-15  0:40 Thinh Nguyen
  2021-04-15  6:25 ` Felipe Balbi
  2021-04-15  7:41 ` [PATCH v2] " Thinh Nguyen
  0 siblings, 2 replies; 5+ messages in thread
From: Thinh Nguyen @ 2021-04-15  0:40 UTC (permalink / raw)
  To: Felipe Balbi, Greg Kroah-Hartman, linux-usb; +Cc: John Youn, stable

The programming guide incorrectly stated that the DCFG.bInterval_m1 must
be set to 0 when operating in fullspeed. There's no such limitation for
all IPs.

Cc: <stable@vger.kernel.org>
Fixes: a1679af85b2a ("usb: dwc3: gadget: Fix setting of DEPCFG.bInterval_m1")
Signed-off-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
---
 drivers/usb/dwc3/gadget.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index 6227641f2d31..d87a29bd7d9b 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -608,12 +608,13 @@ static int dwc3_gadget_set_ep_config(struct dwc3_ep *dep, unsigned int action)
 		u8 bInterval_m1;
 
 		/*
-		 * Valid range for DEPCFG.bInterval_m1 is from 0 to 13, and it
-		 * must be set to 0 when the controller operates in full-speed.
+		 * Valid range for DEPCFG.bInterval_m1 is from 0 to 13.
+		 *
+		 * NOTE: The programming guide incorrectly stated bInterval_m1
+		 * must be set to 0 when operating in fullspeed. Internally the
+		 * controller does not have this limitation.
 		 */
 		bInterval_m1 = min_t(u8, desc->bInterval - 1, 13);
-		if (dwc->gadget->speed == USB_SPEED_FULL)
-			bInterval_m1 = 0;
 
 		if (usb_endpoint_type(desc) == USB_ENDPOINT_XFER_INT &&
 		    dwc->gadget->speed == USB_SPEED_FULL)

base-commit: 4b853c236c7b5161a2e444bd8b3c76fe5aa5ddcb
-- 
2.28.0


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

* Re: [PATCH] usb: dwc3: gadget: Remove FS bInterval_m1 limitation
  2021-04-15  0:40 [PATCH] usb: dwc3: gadget: Remove FS bInterval_m1 limitation Thinh Nguyen
@ 2021-04-15  6:25 ` Felipe Balbi
  2021-04-15  7:10   ` Thinh Nguyen
  2021-04-15  7:41 ` [PATCH v2] " Thinh Nguyen
  1 sibling, 1 reply; 5+ messages in thread
From: Felipe Balbi @ 2021-04-15  6:25 UTC (permalink / raw)
  To: Thinh Nguyen, Greg Kroah-Hartman, linux-usb; +Cc: John Youn, stable

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


Hi,

Thinh Nguyen <Thinh.Nguyen@synopsys.com> writes:
> The programming guide incorrectly stated that the DCFG.bInterval_m1 must
> be set to 0 when operating in fullspeed. There's no such limitation for
> all IPs.

do we have an updated Databook correcting this statement?

> Cc: <stable@vger.kernel.org>
> Fixes: a1679af85b2a ("usb: dwc3: gadget: Fix setting of DEPCFG.bInterval_m1")
> Signed-off-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
> ---
>  drivers/usb/dwc3/gadget.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
> index 6227641f2d31..d87a29bd7d9b 100644
> --- a/drivers/usb/dwc3/gadget.c
> +++ b/drivers/usb/dwc3/gadget.c
> @@ -608,12 +608,13 @@ static int dwc3_gadget_set_ep_config(struct dwc3_ep *dep, unsigned int action)
>  		u8 bInterval_m1;
>  
>  		/*
> -		 * Valid range for DEPCFG.bInterval_m1 is from 0 to 13, and it
> -		 * must be set to 0 when the controller operates in full-speed.
> +		 * Valid range for DEPCFG.bInterval_m1 is from 0 to 13.
> +		 *
> +		 * NOTE: The programming guide incorrectly stated bInterval_m1
> +		 * must be set to 0 when operating in fullspeed. Internally the
> +		 * controller does not have this limitation.

might be a good idea to refer to the section in this comment ;-)

-- 
balbi

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

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

* Re: [PATCH] usb: dwc3: gadget: Remove FS bInterval_m1 limitation
  2021-04-15  6:25 ` Felipe Balbi
@ 2021-04-15  7:10   ` Thinh Nguyen
  0 siblings, 0 replies; 5+ messages in thread
From: Thinh Nguyen @ 2021-04-15  7:10 UTC (permalink / raw)
  To: Felipe Balbi, Thinh Nguyen, Greg Kroah-Hartman, linux-usb
  Cc: John Youn, stable

Felipe Balbi wrote:
> 
> Hi,
> 
> Thinh Nguyen <Thinh.Nguyen@synopsys.com> writes:
>> The programming guide incorrectly stated that the DCFG.bInterval_m1 must
>> be set to 0 when operating in fullspeed. There's no such limitation for
>> all IPs.
> 
> do we have an updated Databook correcting this statement?

Not yet. We're in the process of updating the databook for this
particular issue.

> 
>> Cc: <stable@vger.kernel.org>
>> Fixes: a1679af85b2a ("usb: dwc3: gadget: Fix setting of DEPCFG.bInterval_m1")
>> Signed-off-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
>> ---
>>  drivers/usb/dwc3/gadget.c | 9 +++++----
>>  1 file changed, 5 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
>> index 6227641f2d31..d87a29bd7d9b 100644
>> --- a/drivers/usb/dwc3/gadget.c
>> +++ b/drivers/usb/dwc3/gadget.c
>> @@ -608,12 +608,13 @@ static int dwc3_gadget_set_ep_config(struct dwc3_ep *dep, unsigned int action)
>>  		u8 bInterval_m1;
>>  
>>  		/*
>> -		 * Valid range for DEPCFG.bInterval_m1 is from 0 to 13, and it
>> -		 * must be set to 0 when the controller operates in full-speed.
>> +		 * Valid range for DEPCFG.bInterval_m1 is from 0 to 13.
>> +		 *
>> +		 * NOTE: The programming guide incorrectly stated bInterval_m1
>> +		 * must be set to 0 when operating in fullspeed. Internally the
>> +		 * controller does not have this limitation.
> 
> might be a good idea to refer to the section in this comment ;-)
> 

I can resend with the section number.

BR,
Thinh

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

* [PATCH v2] usb: dwc3: gadget: Remove FS bInterval_m1 limitation
  2021-04-15  0:40 [PATCH] usb: dwc3: gadget: Remove FS bInterval_m1 limitation Thinh Nguyen
  2021-04-15  6:25 ` Felipe Balbi
@ 2021-04-15  7:41 ` Thinh Nguyen
  2021-04-15 10:45   ` Felipe Balbi
  1 sibling, 1 reply; 5+ messages in thread
From: Thinh Nguyen @ 2021-04-15  7:41 UTC (permalink / raw)
  To: Felipe Balbi, Greg Kroah-Hartman, linux-usb; +Cc: John Youn, stable

The programming guide incorrectly stated that the DCFG.bInterval_m1 must
be set to 0 when operating in fullspeed. There's no such limitation for
all IPs. See DWC_usb3x programming guide section 3.2.2.1.

Cc: <stable@vger.kernel.org>
Fixes: a1679af85b2a ("usb: dwc3: gadget: Fix setting of DEPCFG.bInterval_m1")
Signed-off-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
---
 Changes in v2:
 - Noted programming guide section number

 drivers/usb/dwc3/gadget.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index 6227641f2d31..3609311b24f1 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -608,12 +608,14 @@ static int dwc3_gadget_set_ep_config(struct dwc3_ep *dep, unsigned int action)
 		u8 bInterval_m1;
 
 		/*
-		 * Valid range for DEPCFG.bInterval_m1 is from 0 to 13, and it
-		 * must be set to 0 when the controller operates in full-speed.
+		 * Valid range for DEPCFG.bInterval_m1 is from 0 to 13.
+		 *
+		 * NOTE: The programming guide incorrectly stated bInterval_m1
+		 * must be set to 0 when operating in fullspeed. Internally the
+		 * controller does not have this limitation. See DWC_usb3x
+		 * programming guide section 3.2.2.1.
 		 */
 		bInterval_m1 = min_t(u8, desc->bInterval - 1, 13);
-		if (dwc->gadget->speed == USB_SPEED_FULL)
-			bInterval_m1 = 0;
 
 		if (usb_endpoint_type(desc) == USB_ENDPOINT_XFER_INT &&
 		    dwc->gadget->speed == USB_SPEED_FULL)

base-commit: 4b853c236c7b5161a2e444bd8b3c76fe5aa5ddcb
-- 
2.28.0


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

* Re: [PATCH v2] usb: dwc3: gadget: Remove FS bInterval_m1 limitation
  2021-04-15  7:41 ` [PATCH v2] " Thinh Nguyen
@ 2021-04-15 10:45   ` Felipe Balbi
  0 siblings, 0 replies; 5+ messages in thread
From: Felipe Balbi @ 2021-04-15 10:45 UTC (permalink / raw)
  To: Thinh Nguyen, Greg Kroah-Hartman, linux-usb; +Cc: John Youn, stable

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

Thinh Nguyen <Thinh.Nguyen@synopsys.com> writes:

> The programming guide incorrectly stated that the DCFG.bInterval_m1 must
> be set to 0 when operating in fullspeed. There's no such limitation for
> all IPs. See DWC_usb3x programming guide section 3.2.2.1.
>
> Cc: <stable@vger.kernel.org>
> Fixes: a1679af85b2a ("usb: dwc3: gadget: Fix setting of DEPCFG.bInterval_m1")
> Signed-off-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>

thanks for updating

Acked-by: Felipe Balbi <balbi@kernel.org>

-- 
balbi

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

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

end of thread, other threads:[~2021-04-15 10:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-15  0:40 [PATCH] usb: dwc3: gadget: Remove FS bInterval_m1 limitation Thinh Nguyen
2021-04-15  6:25 ` Felipe Balbi
2021-04-15  7:10   ` Thinh Nguyen
2021-04-15  7:41 ` [PATCH v2] " Thinh Nguyen
2021-04-15 10:45   ` Felipe Balbi

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).