linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mathias Nyman <mathias.nyman@linux.intel.com>
To: Rob Weber <rob@gnarbox.com>, mathias.nyman@intel.com
Cc: linux-usb@vger.kernel.org
Subject: Re: xHCI Driver Compliance Test Support
Date: Mon, 24 Jun 2019 09:15:24 +0300	[thread overview]
Message-ID: <fc2609bc-2441-0293-1eca-3781af410414@linux.intel.com> (raw)
In-Reply-To: <20190619190307.GA18466@coops>

Hi

On 19.6.2019 22.03, Rob Weber wrote:
> Hi Mathias,
> 
> I am working on running our custom USB dual-role product through some
> compliance testing. It seems that the SoC and host controller are
> not responding to the LFPS signaling and timeout that is supposed to
> automatically begin the compliance test sequence.
> 
> I'm currently running a 4.9.115 kernel, and I'm afraid I might be
> missing some critical patches for compliance test support. I noticed
> these two patches came up in a google search:
> 
> https://patchwork.kernel.org/patch/10415345/
> https://www.spinics.net/lists/linux-usb/msg160002.html
> 
> Besides these patches, is there anything else that comes to mind that I
> might need to do to start compliance testing? I'm about to build a more
> recent kernel to see if that improves my situation as well.

If xHC hw has a "Compliance Transition Capability" (CTC) bit set in the
HCCPARAMS2 register then ports won't go to compliance unless software
specifically allows it.

see xhci spec section 4.19.1.2.4.1 for more details.

Compliance can be allowed either with a SetPortFeature(PORT_LINK_STATE) request,
or via debugfs.

To allow compliance using debugfs, first check port is in disabled state:

# cat /sys/kernel/debug/usb/xhci/0000:00:15.0/ports/port01/portsc
Powered Not-connected Disabled Link:RxDetect PortSpeed:0 Change: Wake:

enable compliance by writing "compliance" to the port:
# echo compliance > /sys/kernel/debug/usb/xhci/0000:00:15.0/ports/port01/portsc

This needs to be done for that specific port, and after every port warm reset.

After 1st LFPS timeout the port should go to compliance, can be read from portsc

Also make sure you don't have XHCI_COMP_MODE_QUIRK or XHCI_MISSING_CAS quirks set,
these try to recover ports that accidentally enter compliance mode in normal use.

> 
> Just for reference, our product uses an intel atom z8550 SoC that uses
> an xHCI host controller and a dwc3 device controller. Our platform also
> uses a USB 3.0 redriver. The datasheet for this redriver (tusb542)
> indicates that it's internal LFPS controller supports full USB 3.0
> compliance requirements.
> 

z8550 is Cherry Trail? I unfortunately don't have those around anymore.

-Mathias

  reply	other threads:[~2019-06-24  6:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-19 19:03 xHCI Driver Compliance Test Support Rob Weber
2019-06-24  6:15 ` Mathias Nyman [this message]
2019-06-24 20:09   ` Rob Weber

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=fc2609bc-2441-0293-1eca-3781af410414@linux.intel.com \
    --to=mathias.nyman@linux.intel.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=mathias.nyman@intel.com \
    --cc=rob@gnarbox.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;
as well as URLs for NNTP newsgroup(s).