From: Greg KH <gregkh@linuxfoundation.org>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Thinh Nguyen <Thinh.Nguyen@synopsys.com>,
Khazhy Kumykov <khazhy@google.com>,
USB mailing list <linux-usb@vger.kernel.org>
Subject: Re: [PATCH] USB: core: Fix oversight in SuperSpeed initialization
Date: Sat, 12 Aug 2023 10:05:27 +0200 [thread overview]
Message-ID: <2023081204-concave-yoga-f6f0@gregkh> (raw)
In-Reply-To: <8809e6c5-59d5-4d2d-ac8f-6d106658ad73@rowland.harvard.edu>
On Fri, Aug 11, 2023 at 01:38:46PM -0400, Alan Stern wrote:
> Commit 85d07c556216 ("USB: core: Unite old scheme and new scheme
> descriptor reads") altered the way USB devices are enumerated
> following detection, and in the process it messed up the
> initialization of SuperSpeed (or faster) devices:
>
> [ 31.650759] usb 2-1: new SuperSpeed Plus Gen 2x1 USB device number 2 using xhci_hcd
> [ 31.663107] usb 2-1: device descriptor read/8, error -71
> [ 31.952697] usb 2-1: new SuperSpeed Plus Gen 2x1 USB device number 3 using xhci_hcd
> [ 31.965122] usb 2-1: device descriptor read/8, error -71
> [ 32.080991] usb usb2-port1: attempt power cycle
> ...
>
> The problem was caused by the commit forgetting that in SuperSpeed or
> faster devices, the device descriptor uses a logarithmic encoding of
> the bMaxPacketSize0 value. (For some reason I thought the 255 case in
> the switch statement was meant for these devices, but it isn't -- it
> was meant for Wireless USB and is no longer needed.)
>
> We can fix the oversight by testing for buf->bMaxPacketSize0 = 9
> (meaning 512, the actual maxpacket size for ep0 on all SuperSpeed
> devices) and straightening out the logic that checks and adjusts our
> initial guesses of the maxpacket value.
>
> Reported-and-tested-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
> Closes: https://lore.kernel.org/linux-usb/20230810002257.nadxmfmrobkaxgnz@synopsys.com/
> Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
> Fixes: 85d07c556216 ("USB: core: Unite old scheme and new scheme descriptor reads")
>
> ---
>
> drivers/usb/core/hub.c | 36 ++++++++++++++++++++++++------------
> 1 file changed, 24 insertions(+), 12 deletions(-)
Process nit, when you add a patch to an existing patch series like this,
when I run `b4` to download and apply the patch, it sucks in the
original patch series, not this add-on patch (which then of course fails
as the original patch series was already applied.)
So, if it's easy enough, can you just send add-on patches for stuff that
has been applied, as a new thread? That way the tools handle it
automatically and I don't have to hand edit/apply the patch?
thanks,
greg k-h
next prev parent reply other threads:[~2023-08-12 8:05 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-04 19:09 [PATCH 0/3] USB: core: Don't overwrite device descriptor during reinitialization Alan Stern
2023-08-04 19:10 ` [PATCH 1/3] USB: core: Unite old scheme and new scheme descriptor reads Alan Stern
2023-08-04 19:12 ` [PATCH 2/3] USB: core: Change usb_get_device_descriptor() API Alan Stern
2023-08-04 19:14 ` [PATCH 3/3] USB: core: Fix race by not overwriting udev->descriptor in hub_port_init() Alan Stern
2023-12-11 10:40 ` [REGRESSION] Re: [PATCH 1/3] USB: core: Unite old scheme and new scheme descriptor reads Christian Eggers
2023-12-11 16:21 ` Alan Stern
2023-12-12 8:01 ` Christian Eggers
2023-08-08 8:47 ` [PATCH 0/3] USB: core: Don't overwrite device descriptor during reinitialization Greg KH
2023-08-10 0:28 ` Thinh Nguyen
2023-08-10 1:47 ` Alan Stern
2023-08-10 16:34 ` Alan Stern
2023-08-10 22:39 ` Thinh Nguyen
2023-08-11 1:52 ` Alan Stern
2023-08-11 17:05 ` Thinh Nguyen
2023-08-11 17:38 ` [PATCH] USB: core: Fix oversight in SuperSpeed initialization Alan Stern
2023-08-12 8:05 ` Greg KH [this message]
2023-08-12 15:28 ` Alan Stern
2024-03-05 8:20 ` [REGRESSION] Re: [PATCH 0/3] USB: core: Don't overwrite device descriptor during reinitialization Jan Čermák
2024-03-06 21:08 ` Alan Stern
2024-03-07 16:17 ` Jan Čermák
2024-03-07 19:34 ` Alan Stern
2024-03-11 9:58 ` Jan Čermák
2024-03-11 14:43 ` Alan Stern
2024-03-12 8:57 ` Jan Čermák
2024-03-12 20:47 ` Alan Stern
2024-03-16 20:35 ` Alan Stern
2024-03-19 11:54 ` Jan Čermák
2024-03-19 16:03 ` Alan Stern
2024-03-27 13:24 ` Jan Čermák
2024-03-27 14:21 ` Alan Stern
2024-03-28 15:44 ` Alexander Dahl
2024-03-28 16:16 ` Alan Stern
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=2023081204-concave-yoga-f6f0@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=Thinh.Nguyen@synopsys.com \
--cc=khazhy@google.com \
--cc=linux-usb@vger.kernel.org \
--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