mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nicolai Buchwitz <nb@tipi-net.de>
To: Michal Pecio <michal.pecio@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Steve Bayless <steve_bayless@keysight.com>,
	Guido Kiener <guido@kiener-muenchen.de>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	stable@vger.kernel.org, Mathias Nyman <mathias.nyman@intel.com>
Subject: Re: [PATCH 0/4] usb: usbtmc: fix undersized high-speed bulk packets on xHCI
Date: Sat, 24 Oct 2026 13:17:11 +0200	[thread overview]
Message-ID: <bc5865736052c55683b2d3f2eeca0e01@tipi-net.de> (raw)
In-Reply-To: <20261023202645.7bf4827a.michal.pecio@gmail.com>

On 23.10.2026 20:26, Michal Pecio wrote:
> On Wed, 21 Oct 2026 11:34:19 +0200, Nicolai Buchwitz wrote:
>> I checked on Windows 11 (Intel xHCI, WinUSB + libusb): same
>> descriptors as on Linux (HS, bulk wMaxPacketSize 64), and a single
>> 4096 byte bulk IN read returns the complete 110 byte reply, so it
>> seems, that Windows programs the 64 bytes into the endpoint instead
>> of forcing 512.
> 
> Yes, that's what it seems to be doing. I passed a fake storage device
> with weird endpoints to Windows 10 in QEMU and with some debug tracing
> (slot/ep context hexdumps are my addition) I see this:
> 
> usb_xhci_fetch_trb addr 0x0000000139a3c450, CR_CONFIGURE_ENDPOINT, p 
> 0x000000013a18d000, s 0x00000000, c 0x01003001
> usb_xhci_slot_ctx addr 0x000000013a18d020, c 0x68000000 0x00000000 
> 0x00000000 0x00000000
> usb_xhci_ep_ctx addr 0x000000013a18d0a0, ep 4, c 0x00000000 0x00400016 
> 0x39a3cc01 0x00000001 0x00000000
> usb_xhci_ep_ctx addr 0x000000013a18d1c0, ep 13, c 0x00000000 0x00400036 
> 0x375ff001 0x00000001 0x00000000
> 
> The 0x0040 in the second field is packet size, and it becomes 0x0400
> when I change to 1024, or 0x0002 with 2050. Windows blindly copies
> those eleven bits here and only gets upset if they are all zero, then
> it resets and enumerates again a few times.
> 
> I don't have any out of spec device, so I tunned a Cypress FX2 into
> one - it exactly replays every received packet back to the host. I
> found that power of two sizes from 1 to 512 work, except on Etron HCs
> which only take 512. Guess we could have an exception for those.
> 
> So this seems very viable. I will turn it into a proper patch and see
> what the maintainers think. Seems better than patching class drivers.

Thanks! If you need something testing with the devices I have at hand, 
please let me know.

Regards,
Nicolai

  reply	other threads:[~2026-10-24 11:17 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-20 14:33 Nicolai Buchwitz
2026-10-20 14:33 ` [PATCH 1/4] usb: usbtmc: handle undersized high-speed bulk IN packets Nicolai Buchwitz
2026-10-20 14:33 ` [PATCH 2/4] usb: usbtmc: handle undersized high-speed bulk OUT packets Nicolai Buchwitz
2026-10-20 14:33 ` [PATCH 3/4] usb: usbtmc: add Rigol DP800 and DS1000Z to the packet I/O quirk table Nicolai Buchwitz
2026-10-20 14:33 ` [PATCH 4/4] usb: usbtmc: send a ZLP after a full last packet in packet I/O mode Nicolai Buchwitz
2026-10-20 16:42 ` [PATCH 0/4] usb: usbtmc: fix undersized high-speed bulk packets on xHCI Michal Pecio
2026-10-20 18:33   ` Nicolai Buchwitz
2026-10-20 21:12     ` guido
2026-10-21  7:46       ` Nicolai Buchwitz
2026-10-21 12:29         ` Guido Kiener
2026-10-20 22:56     ` Michal Pecio
2026-10-21  7:42       ` Nicolai Buchwitz
2026-10-21  9:34       ` Nicolai Buchwitz
2026-10-23 18:26         ` Michal Pecio
2026-10-24 11:17           ` Nicolai Buchwitz [this message]
2026-10-24 20:23             ` Michal Pecio

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=bc5865736052c55683b2d3f2eeca0e01@tipi-net.de \
    --to=nb@tipi-net.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=guido@kiener-muenchen.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mathias.nyman@intel.com \
    --cc=michal.pecio@gmail.com \
    --cc=stable@vger.kernel.org \
    --cc=steve_bayless@keysight.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

all inboxes | Powered by JetHome®