All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mathias Nyman <mathias.nyman@linux.intel.com>
To: Seth Bollinger <seth.boll@gmail.com>, linux-usb@vger.kernel.org
Cc: sethb@digi.com
Subject: Re: HC died
Date: Tue, 21 Feb 2023 18:26:43 +0200	[thread overview]
Message-ID: <b13655bf-4a04-bece-71e4-698bfec83e2d@linux.intel.com> (raw)
In-Reply-To: <CA+JN8xMXu=sVQ2nyR9SgF25fquCZhH43wdsnuvfjDu+yGRv2yA@mail.gmail.com>

On 17.2.2023 16.21, Seth Bollinger wrote:
> Hello All,
> 
> We're experiencing a problem with our devices in the field where our
> customers attach problematic USB devices that are causing the xhci
> host controller to shut down with the "HC died; cleaning up" message.

Is this seen only on some specific xHC host controller?

> 
> I've narrowed this down to a timeout of the address device TRB on the
> command ring (currently 5 seconds).  It sometimes takes our hardware
> 9.6 to complete this TRB.  When the driver is trying to stop the cmd
> ring, the controller is busy for an additional 4.6 seconds.  This
> results in the "HC died" message and shutdown of the host controller.
> 
> If I bump the command ring timeout beyond the max TRB completion time,
> the host controller continues to be responsive and doesn't need to be
> shut down.
> 
> My knowledge of how the usb protocol should handle this problem isn't
> strong enough to know if there is a better solution than simply
> increasing the command ring default timeout.

Are these problematic devices USB 2 or USB 3 devices?

You could try playing with the Address device command BSR (block set
address request) flag and see if helps.
Xhci has two ways to get a slot from the Enabled to the Addressed state.

option 1: move slot from Enabled state to Addressed in one go:
Enabled --(Addr dev cmd, BSR=0)--> Addressed

option 2: move from Enabled state via Default state to Addressed state:
Enabled --(Addr dev cmd, BSR=1)--> Default --(Addr dev cmd, BSR=0)--> Addressed

I think the usb core "old_scheme_first" module parameter will end up doing this.

-Mathias


  reply	other threads:[~2023-02-21 16:25 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-17 14:21 HC died Seth Bollinger
2023-02-21 16:26 ` Mathias Nyman [this message]
2023-02-23 15:31   ` Seth Bollinger
2023-02-23 15:48     ` Alan Stern
2023-02-23 16:05       ` Seth Bollinger
2023-02-24 12:24         ` Mathias Nyman
2023-02-24 13:16           ` Seth Bollinger
2023-02-27 13:07             ` Mathias Nyman
2023-02-28 14:27               ` Seth Bollinger

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=b13655bf-4a04-bece-71e4-698bfec83e2d@linux.intel.com \
    --to=mathias.nyman@linux.intel.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=seth.boll@gmail.com \
    --cc=sethb@digi.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.