[Cbe-oss-dev] [PATCH 2/5] usb: PS3 EHCI HC NAK work-around

Alan Stern stern at rowland.harvard.edu
Wed Nov 16 03:52:06 EST 2011


On Tue, 15 Nov 2011, Geoff Levand wrote:

> PS3 EHCI HC errata fix 236 - During high speed bulk out and high speed control
> out transfers the PS3 EHCI HC will issue an OUT token on the USB bus when a
> device responds with a NAK.  The USB 2.0 standard specifies that a PING token
> must be output.  The work-around is for the HC driver to initialize the
> RL (NAK count reload) field of the queue head to a non-zero value.

This can't be right.  The RL field is already initialized to 
EHCI_TUNE_RL_HS, which is #defined as 4.

Maybe for PS3 EHCI you want to #define it as 2 instead.

> Signed-off-by: Geoff Levand <geoff at infradead.org>
> ---
>  drivers/usb/host/ehci-hcd.c |    1 +
>  drivers/usb/host/ehci-q.c   |    1 +
>  2 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
> index 3ff9f82..e43cb5a 100644
> --- a/drivers/usb/host/ehci-hcd.c
> +++ b/drivers/usb/host/ehci-hcd.c
> @@ -620,6 +620,7 @@ static int ehci_init(struct usb_hcd *hcd)
>  	hw = ehci->async->hw;
>  	hw->hw_next = QH_NEXT(ehci, ehci->async->qh_dma);
>  	hw->hw_info1 = cpu_to_hc32(ehci, QH_HEAD);
> +	hw->hw_info1 |= cpu_to_hc32(ehci, (2 << 28));	/* RL = 2 */

Unnecessary; the ring-head QH is never used for any transfers.

>  	hw->hw_token = cpu_to_hc32(ehci, QTD_STS_HALT);
>  	hw->hw_qtd_next = EHCI_LIST_END(ehci);
>  	ehci->async->qh_state = QH_STATE_LINKED;
> diff --git a/drivers/usb/host/ehci-q.c b/drivers/usb/host/ehci-q.c
> index 4e4066c..7794c7a 100644
> --- a/drivers/usb/host/ehci-q.c
> +++ b/drivers/usb/host/ehci-q.c
> @@ -911,6 +911,7 @@ qh_make (
>  
>  	case USB_SPEED_HIGH:		/* no TT involved */
>  		info1 |= (2 << 12);	/* EPS "high" */
> +		info1 |= (2 << 28);	/* RL = 2 */
>  		if (type == PIPE_CONTROL) {
>  			info1 |= (EHCI_TUNE_RL_HS << 28);

The line you just added isn't needed, because of this line here.  
Furthermore, RL isn't used with interrupt transfers, and setting it to
a nonzero value in an interrupt QH might not be safe.

Alan Stern



More information about the cbe-oss-dev mailing list