Linux-USB Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH 2/2] usb: gadget: net2280: Add workaround for AB chip Errata 11
@ 2019-08-23  3:15 Benjamin Herrenschmidt
  2019-08-27 11:21 ` guido
  0 siblings, 1 reply; 2+ messages in thread
From: Benjamin Herrenschmidt @ 2019-08-23  3:15 UTC (permalink / raw)
  To: linux-usb; +Cc: Guido Kiener, Felipe Balbi, Alan Stern

The errata description is:

Workaround for Default Duration of LFPS Handshake Signaling for
Device-Initiated U1 Exit is too short.

The default duration of the LFPS handshake generated by USB3380 for a device-initiated U1-exit may not be
long enough for certain SuperSpeed downstream ports (SuperSpeed hubs/hosts) to recognize. This could lead
to USB3380 entering the recovery state pre-maturely and ending up in the SS.Inactive state.

I have observed various enumeration failures, seemingly related to
lost transactions or SETUP status phases on modern hosts (typically
thunderbolt capable systems) without this workaround.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
 drivers/usb/gadget/udc/net2280.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/usb/gadget/udc/net2280.c b/drivers/usb/gadget/udc/net2280.c
index e0191146ba22..51efee21915f 100644
--- a/drivers/usb/gadget/udc/net2280.c
+++ b/drivers/usb/gadget/udc/net2280.c
@@ -2269,6 +2269,16 @@ static void usb_reinit_338x(struct net2280 *dev)
 	val |= 0x3 << HOT_RX_RESET_TS2;
 	writel(val, &dev->llregs->ll_tsn_counters_3);
 
+	/*
+	 * AB errata. Errata 11. Workaround for Default Duration of LFPS
+	 * Handshake Signaling for Device-Initiated U1 Exit is too short.
+	 * Without this, various enumeration failures observed with
+	 * modern superspeed hosts.
+	 */
+	val = readl(&dev->llregs->ll_lfps_timers_2);
+	writel((val & 0xffff0000) | LFPS_TIMERS_2_WORKAROUND_VALUE,
+	       &dev->llregs->ll_lfps_timers_2);
+
 	/*
 	 * Set Recovery Idle to Recover bit:
 	 * - On SS connections, setting Recovery Idle to Recover Fmw improves



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

* Re: [PATCH 2/2] usb: gadget: net2280: Add workaround for AB chip Errata 11
  2019-08-23  3:15 [PATCH 2/2] usb: gadget: net2280: Add workaround for AB chip Errata 11 Benjamin Herrenschmidt
@ 2019-08-27 11:21 ` guido
  0 siblings, 0 replies; 2+ messages in thread
From: guido @ 2019-08-27 11:21 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: linux-usb, Felipe Balbi, Alan Stern


Zitat von Benjamin Herrenschmidt <benh@kernel.crashing.org>:

> The errata description is:
>
> Workaround for Default Duration of LFPS Handshake Signaling for
> Device-Initiated U1 Exit is too short.
>
> The default duration of the LFPS handshake generated by USB3380 for  
> a device-initiated U1-exit may not be
> long enough for certain SuperSpeed downstream ports (SuperSpeed  
> hubs/hosts) to recognize. This could lead
> to USB3380 entering the recovery state pre-maturely and ending up in  
> the SS.Inactive state.
>
> I have observed various enumeration failures, seemingly related to
> lost transactions or SETUP status phases on modern hosts (typically
> thunderbolt capable systems) without this workaround.
>
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> ---
>  drivers/usb/gadget/udc/net2280.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
>
> diff --git a/drivers/usb/gadget/udc/net2280.c  
> b/drivers/usb/gadget/udc/net2280.c
> index e0191146ba22..51efee21915f 100644
> --- a/drivers/usb/gadget/udc/net2280.c
> +++ b/drivers/usb/gadget/udc/net2280.c
> @@ -2269,6 +2269,16 @@ static void usb_reinit_338x(struct net2280 *dev)
>  	val |= 0x3 << HOT_RX_RESET_TS2;
>  	writel(val, &dev->llregs->ll_tsn_counters_3);
>
> +	/*
> +	 * AB errata. Errata 11. Workaround for Default Duration of LFPS
> +	 * Handshake Signaling for Device-Initiated U1 Exit is too short.
> +	 * Without this, various enumeration failures observed with
> +	 * modern superspeed hosts.
> +	 */
> +	val = readl(&dev->llregs->ll_lfps_timers_2);
> +	writel((val & 0xffff0000) | LFPS_TIMERS_2_WORKAROUND_VALUE,
> +	       &dev->llregs->ll_lfps_timers_2);
> +
>  	/*
>  	 * Set Recovery Idle to Recover bit:
>  	 * - On SS connections, setting Recovery Idle to Recover Fmw improves

I'm ok with your patch sequence.

-Guido


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

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-23  3:15 [PATCH 2/2] usb: gadget: net2280: Add workaround for AB chip Errata 11 Benjamin Herrenschmidt
2019-08-27 11:21 ` guido

Linux-USB Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-usb/0 linux-usb/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-usb linux-usb/ https://lore.kernel.org/linux-usb \
		linux-usb@vger.kernel.org linux-usb@archiver.kernel.org
	public-inbox-index linux-usb


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-usb


AGPL code for this site: git clone https://public-inbox.org/ public-inbox