[PATCH 0/4] usb: gadget: dummy_hcd: fixes found while testing virtio-usb

Igor Skalkin <[email protected]> Fri, 7 Aug 2026 09:54:34 +0200
Newsgroups org.kernel.vger.linux-usb,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
This series fixes several bugs in dummy_hcd found while testing a
virtio-usb transport under a type-1 hypervisor, using two Linux VMs:

         host VM                            guest VM
    +----------------+                  +----------------+
    |    testusb     |                  |     g_zero     |
    +-------|--------+                  +--------^-------+
            v                                     |
    +----------------+                  +----------------+
    |   dummy_hcd    |                  |   dummy_hcd    |
    |  (host port)   |<---- virtio ---->| (virtual UDC)  |
    +----------------+                  +----------------+

Most of the failures we hit were in our own virtio-usb code, but
after switching the testing from HighSpeed to SuperSpeed a few
issues traced back to dummy_hcd itself:

 - patch 1 fixes an incorrect SuperSpeed ep0 maxpacket value
 - patch 2 fixes a false -EOVERFLOW reported for legitimate bounded
   IN completions
 - patch 3 fixes broken SG transfer handling when a URB is serviced
   across multiple chunks
 - patch 4 sets no_sg_constraint, since dummy_hcd has no hardware DMA
   alignment requirement and should not reject SG URBs based on
   maxpacket alignment

Igor Skalkin (4):
  usb: gadget: dummy_hcd: fix SuperSpeed ep0 maxpacket
  usb: gadget: dummy_hcd: fix false overflow on bounded IN
  usb: gadget: dummy_hcd: fix SG transfer handling across chunks
  usb: gadget: dummy_hcd: set no_sg_constraint on the host controller

 drivers/usb/gadget/udc/dummy_hcd.c | 72 +++++++++++++-----------------
 1 file changed, 30 insertions(+), 42 deletions(-)

-- 
2.49.0