linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alan Stern <stern@rowland.harvard.edu>
To: Mathias Nyman <mathias.nyman@linux.intel.com>
Cc: Martin Thierer <mthierer@gmail.com>, linux-usb@vger.kernel.org
Subject: Re: Data toggles not reset on "set configuration" for ports handled by "xhci_hcd" driver
Date: Wed, 26 Aug 2020 10:37:07 -0400	[thread overview]
Message-ID: <20200826143707.GC400430@rowland.harvard.edu> (raw)
In-Reply-To: <b7b49077-de57-ef15-587a-a50486dfe372@linux.intel.com>

On Wed, Aug 26, 2020 at 11:37:50AM +0300, Mathias Nyman wrote:
> On 25.8.2020 18.10, Alan Stern wrote:
> > There's got to be a better way to do this, something that doesn't 
> > involve so much code duplication.  For instance, maybe we could make 
> > this routine and usb_set_configuration() both call a new 
> > __usb_set_config(), with an extra flag telling the routine whether to 
> > change the interface devices and bindings.
> 
> I agree that this needs cleaning up, this code was intended for testing.
> 
> It allows us to call usb_hcd_alloc_bandwidth() once with a configuration
> and with the old endpoint pointers still intact, leading to one configure
> endpoint command for xhci with the relevant drop and add endpoint flags set,
> all in one go.
> 
> Looks like the last part usb_disable_device() does similar endpoint code
> churning to flush, disable, drop, and remove endpoints. May we could start
> by turning that code into some useful helper first?

usb_disable_device() is _supposed_ to be the useful helper!  :-)  But 
yes, it could be split into two pieces.

I still think it would be worthwhile to combine usb_set_configuration() 
and usb_reset_configuration() into one routine, since they have to do a 
lot of the same things.

Alan Stern

  reply	other threads:[~2020-08-26 14:37 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
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 [this message]
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=20200826143707.GC400430@rowland.harvard.edu \
    --to=stern@rowland.harvard.edu \
    --cc=linux-usb@vger.kernel.org \
    --cc=mathias.nyman@linux.intel.com \
    --cc=mthierer@gmail.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).