linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mathias Nyman <mathias.nyman@linux.intel.com>
To: Alan Stern <stern@rowland.harvard.edu>,
	Martin Thierer <mthierer@gmail.com>
Cc: linux-usb@vger.kernel.org
Subject: Re: Data toggles not reset on "set configuration" for ports handled by "xhci_hcd" driver
Date: Mon, 24 Aug 2020 13:22:02 +0300	[thread overview]
Message-ID: <d11a91f5-2bb8-01ce-c8b8-4512a2cf2793@linux.intel.com> (raw)
In-Reply-To: <20200821170106.GB256196@rowland.harvard.edu>

On 21.8.2020 20.01, Alan Stern wrote:
> On Fri, Aug 21, 2020 at 06:34:55PM +0200, Martin Thierer wrote:
>> I read the usb 2.0 specs and generally came to the same conclusion,
>> except I wasn't 100% sure because 9.1.1.5 talks about "configuring" in
>> the context of bringing a device into the "configured" state, which
>> one could argue isn't really the case if a "set configuration" message
>> is sent to a device that is already configured with the exact same
>> configuration.
> 
> Nonsense.  The text explicitly says "configuration involves correctly 
> processing a SetConfiguration() request with a non-zero configuration 
> value."  There's no requirement about what state the device was in 
> previously.
> 
>>> Together these should explain the correct behavior.
>>
>> I'm not sure I understand what you're implying here. That the kernel's
>> behaviour is correct or not?
> 
> That the EHCI behavior is correct and the xHCI behavior is wrong.

True, xHCI doesn't reset the toggle in this case.
xHC only keeps track of added or dropped endpoints, it doesn't track
which configuration or interface is set.

If the SetConfiguration() request doesn't cause any endpoint add/drop change
then xhci driver won't do anything.
To reset the toggle we should mark the endpoints as both dropped and added,
and issue a configure endpoint xhci command. 

The same xhci codepath is called from other places as well, I need to check
a change like this won't cause any other issues

-Mathias
 

  reply	other threads:[~2020-08-24 10:18 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-21 12:30 Data toggles not reset on "set configuration" for ports handled by "xhci_hcd" driver Martin Thierer
2020-08-21 16:03 ` Alan Stern
2020-08-21 16:34   ` Martin Thierer
2020-08-21 17:01     ` Alan Stern
2020-08-24 10:22       ` Mathias Nyman [this message]
2020-08-24 13:10         ` Martin Thierer
2020-08-24 13:48           ` Mathias Nyman
2020-08-24 14:13             ` Mathias Nyman
2020-08-25  8:00               ` Martin Thierer
2020-08-25 11:53                 ` Mathias Nyman
2020-08-25 15:10                   ` Alan Stern
2020-08-26  8:37                     ` Mathias Nyman
2020-08-26 14:37                       ` Alan Stern
2020-08-26  7:40                   ` Martin Thierer
2020-08-26  8:40                     ` Mathias Nyman
2020-08-28 13:10                       ` Mathias Nyman
2020-08-28 15:55                         ` Alan Stern
2020-08-31  6:37                           ` Mathias Nyman
2020-08-28 18:04                         ` Martin Thierer
2020-08-31  6:41                           ` Mathias Nyman
2020-08-31  9:35                             ` Martin Thierer

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=d11a91f5-2bb8-01ce-c8b8-4512a2cf2793@linux.intel.com \
    --to=mathias.nyman@linux.intel.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=mthierer@gmail.com \
    --cc=stern@rowland.harvard.edu \
    /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).