public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mathias Nyman <mathias.nyman@linux.intel.com>
To: yinbo.zhu@nxp.com
Cc: Mathias Nyman <mathias.nyman@intel.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"open list:USB XHCI DRIVER" <linux-usb@vger.kernel.org>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/2] usb: host: Implement workaround for Erratum A-009611
Date: Thu, 14 Sep 2017 15:19:03 +0300	[thread overview]
Message-ID: <59BA73B7.2080509@linux.intel.com> (raw)
In-Reply-To: <20170911094132.38456-1-yinbo.zhu@nxp.com>

On 11.09.2017 12:41, yinbo.zhu@nxp.com wrote:
> From: "yinbo.zhu" <yinbo.zhu@nxp.com>
>
> Description: This is a occasional problem where the software
> issues an End Transfer command while a USB transfer is in progress,
> resulting in the TxFIFO  being flushed when the lower layer is waiting
> for data,causing the super speed (SS) transmit to get blocked.
> If the End Transfer command is issued on an IN endpoint to
> flush out the pending transfers when the same IN endpoint
> is doing transfers on the USB, then depending upon the timing
> of the End Transfer (and the resulting internal FIFO flush),the
> lower layer (U3PTL/U3MAC) could get stuck waiting for data
> indefinitely. This blocks the transmission path on the SS, and no
> DP/ACK/ERDY/DEVNOTIF packets can be sent from the device.
> Impact: If this issue happens and the transmission gets blocked,
> then the USB host aborts and resets/re-enumerates the device.
> This unblocks the transmitt engine and the device functions normally.
>
> Workaround: Software must wait for all existing TRBs to complete before
> issuing End transfer command.

This doesn't seem like the correct way to solve the issue.
This workaround will prevent canceling URBs.

we need to stop the endpoint ring before we can touch the TRBs on the ring.
If we want to cancel a URB we need to either hop over its TRBs on the ring,
or turn them to no-ops. The canceled URB is only given back after this.

Imagine a USB camera queuing ~100 TRBs in advance, then user wants to change video
mode and cancel the pending URBs.
We would have to wait for the camera to finish these 100TRBs before doing anything.

Queuing a stop endpoint command is essential to canceling a URB, and we can't
wait for the ring to be empty before issuing it.

-Mathias

      parent reply	other threads:[~2017-09-14 12:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-11  9:41 [PATCH 1/2] usb: host: Implement workaround for Erratum A-009611 yinbo.zhu
2017-09-11 12:06 ` Greg Kroah-Hartman
2017-09-14 12:19 ` Mathias Nyman [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=59BA73B7.2080509@linux.intel.com \
    --to=mathias.nyman@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mathias.nyman@intel.com \
    --cc=yinbo.zhu@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox