Page MenuHomeFreeBSD

USBExperimental
ActivePublic

Details

Description

Groups related to USB stuff.

Recent Activity

Today

ptudor_ptudor.net updated the diff for D61065: cp2112: Check status errors and bound I2C waits.

Thanks, I've added LUMANATE (0x1009) to usbdevs and used USB_VENDOR_LUMANATE in both the HID quirk and cp2112_devs. The updated diff has full context.

Wed, Nov 4, 8:45 AM · USB, drivers
wulf accepted D61065: cp2112: Check status errors and bound I2C waits.
Wed, Nov 4, 5:17 AM · USB, drivers
ptudor_ptudor.net updated the diff for D61065: cp2112: Check status errors and bound I2C waits.

Thanks, I've removed the two comments and changed the timeout to USB_DEFAULT_TIMEOUT * SBT_1MS (five seconds). Each report wait and status loop retains its own absolute deadline.

Wed, Nov 4, 12:55 AM · USB, drivers

Yesterday

wulf added inline comments to D61065: cp2112: Check status errors and bound I2C waits.
Tue, Nov 3, 6:33 PM · USB, drivers
wulf added inline comments to D61065: cp2112: Check status errors and bound I2C waits.
Tue, Nov 3, 6:22 PM · USB, drivers
adrian added a comment to D61065: cp2112: Check status errors and bound I2C waits.

This /looks/ fine to me, but there's too much commenting for what's really self evident stuff.

Tue, Nov 3, 5:56 PM · USB, drivers

Mon, Nov 2

aokblast closed D52347: usb: support SSP and SSPx2 xHCI.
Mon, Nov 2, 3:03 AM · USB
aokblast closed D57204: usb: Add support for SSP and SSPx2 hubs.
Mon, Nov 2, 3:03 AM · USB
aokblast closed D57203: usb: Add SSPlus device capability descriptor.
Mon, Nov 2, 3:03 AM · USB
aokblast closed D57202: usb: Implement usbd_req_get_bos_descriptor helper.
Mon, Nov 2, 3:03 AM · USB
aokblast closed D57201: usb: Add get_ext_port_status helper function.
Mon, Nov 2, 3:03 AM · USB
aokblast closed D57200: usb: Add extended port status struct.
Mon, Nov 2, 3:03 AM · USB
aokblast closed D57199: usb: Add usb_bos_foreach helper.
Mon, Nov 2, 3:03 AM · USB
aokblast closed D57198: usb: support SSP/SSPx2 devices in all-speed consumers.
Mon, Nov 2, 3:03 AM · USB
aokblast closed D57197: usbdump: Support SSP and SSPx2 speed display.
Mon, Nov 2, 3:03 AM · USB
aokblast closed D57196: usbconfig: Add SSPx2 support.
Mon, Nov 2, 3:03 AM · USB
aokblast closed D57195: libusb: Add SSP and SSPx2 enum support.
Mon, Nov 2, 3:03 AM · USB
aokblast closed D57194: usb: Add SSP and SSPx2 speed and move USB_*_MAX into enum.
Mon, Nov 2, 3:03 AM · USB

Sat, Oct 31

adrian added a reviewer for D61065: cp2112: Check status errors and bound I2C waits: wulf.

@wulf any comments re: i2c'ness?

Sat, Oct 31, 9:08 PM · USB, drivers

Fri, Oct 9

obiwac closed D49453: USB4 initial work on suspend routine.
Fri, Oct 9, 5:34 PM · USB
ngie accepted D49453: USB4 initial work on suspend routine.
Fri, Oct 9, 4:51 PM · USB
obiwac updated the diff for D49453: USB4 initial work on suspend routine.

refer to bug

Fri, Oct 9, 10:45 AM · USB
ngie added a comment to D49453: USB4 initial work on suspend routine.

If you could mention the bug (once) in the code, that would be helpful and I'm happy to provide a ship-it.

Fri, Oct 9, 4:49 AM · USB

Wed, Oct 7

obiwac added inline comments to D49453: USB4 initial work on suspend routine.
Wed, Oct 7, 12:47 PM · USB
obiwac updated the diff for D49453: USB4 initial work on suspend routine.

Polling only for tSetSR now, instead of tSetSR 100 times. Note that Linux waits about 10 times tSetSR, but on my hardware just tSetSR works perfectly fine, and this is to-spec.

Wed, Oct 7, 12:46 PM · USB

Oct 2 2026

ngie added a comment to D49453: USB4 initial work on suspend routine.

My concerns are about the TODOs needing documentation in Bugzilla/the wiki. TODOs without followup issues clutter up source code, except for the person who has the context: in this case, you (while you remember what the TODOs mean).

Oct 2 2026, 4:03 PM · USB

Sep 14 2026

obiwac added inline comments to D49453: USB4 initial work on suspend routine.
Sep 14 2026, 4:24 PM · USB
obiwac updated the diff for D49453: USB4 initial work on suspend routine.

rebase + respond to comments

Sep 14 2026, 4:24 PM · USB

Sep 6 2026

bz added a comment to D57194: usb: Add SSP and SSPx2 speed and move USB_*_MAX into enum.

I do not see any changes to usb_transfer.c in the stack.
That likely means usbd_get_std_packet_size() array accesses may get out of bounds accesses?
If I am right, this should be addressed somewhere before this or other bits go in.

It is in https://reviews.freebsd.org/D57198.

Sep 6 2026, 4:15 PM · USB

Sep 5 2026

aokblast added a comment to D57194: usb: Add SSP and SSPx2 speed and move USB_*_MAX into enum.
In D57194#1363739, @bz wrote:
In D57194#1311193, @bz wrote:

Fantasic! You are solving one of my local TODOs :)

Can you make all these USB changes belonging together a stack in Phabricator?
It's a bit hard to grasp which all are there or belong together.
I'd be happy to at least scroll through them even if I cannot review them all in detail most likely.

% git show 9dbb804f59533d7d539200367394e4013714b02c
commit 9dbb804f59533d7d539200367394e4013714b02c
Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: Mon Feb 9 01:11:41 2026 +0000
Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: Sun May 24 15:53:58 2026 +0000

    TODO usb: add USB_SPEED_SUPER_PLUS to enum usb_dev_speed
    
    While nothing in our native USB stack uses the USB 3.1 "SUPERSPEED+"
    setting yet, a LinuxKPI based wireless driver does check for it.
    
    TODO: The arrays in usbd_get_std_packet_size() likely need to be updated.
    
    Sponsored by:   The FreeBSD Foundation
    MFC after:      3 days

diff --git sys/dev/usb/usb.h sys/dev/usb/usb.h
index 3e972f876c6a..f07eb9adfe40 100644
--- sys/dev/usb/usb.h
+++ sys/dev/usb/usb.h
@@ -755,8 +755,9 @@ enum usb_dev_speed {
        USB_SPEED_FULL,
        USB_SPEED_HIGH,
        USB_SPEED_SUPER,
+       USB_SPEED_SUPER_PLUS,
 };
-#define        USB_SPEED_MAX   (USB_SPEED_SUPER+1)
+#define        USB_SPEED_MAX   (USB_SPEED_SUPER_PLUS+1)
 
 /*
  * The "USB_REV" macros defines all the supported USB revisions.

Hi bz@, Thanks for your reply. I might not know what is the correct way to do so. But I think in the stack tab, all of my patches can be seen in here.

CleanShot 2026-05-25 at 15.23.44.png (1,508×866 px, 227 KB)

I do not see any changes to usb_transfer.c in the stack.
That likely means usbd_get_std_packet_size() array accesses may get out of bounds accesses?
If I am right, this should be addressed somewhere before this or other bits go in.

Sep 5 2026, 11:35 PM · USB
bz added a reviewer for D57320: usb: Refactor functions need lock: USB.
Sep 5 2026, 9:46 PM · USB
bz added inline comments to D56891: usb_hub: Trigger only chaged port on enumeration.
Sep 5 2026, 9:45 PM · USB
bz added a comment to D57194: usb: Add SSP and SSPx2 speed and move USB_*_MAX into enum.
In D57194#1311193, @bz wrote:

Fantasic! You are solving one of my local TODOs :)

Can you make all these USB changes belonging together a stack in Phabricator?
It's a bit hard to grasp which all are there or belong together.
I'd be happy to at least scroll through them even if I cannot review them all in detail most likely.

% git show 9dbb804f59533d7d539200367394e4013714b02c
commit 9dbb804f59533d7d539200367394e4013714b02c
Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: Mon Feb 9 01:11:41 2026 +0000
Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: Sun May 24 15:53:58 2026 +0000

    TODO usb: add USB_SPEED_SUPER_PLUS to enum usb_dev_speed
    
    While nothing in our native USB stack uses the USB 3.1 "SUPERSPEED+"
    setting yet, a LinuxKPI based wireless driver does check for it.
    
    TODO: The arrays in usbd_get_std_packet_size() likely need to be updated.
    
    Sponsored by:   The FreeBSD Foundation
    MFC after:      3 days

diff --git sys/dev/usb/usb.h sys/dev/usb/usb.h
index 3e972f876c6a..f07eb9adfe40 100644
--- sys/dev/usb/usb.h
+++ sys/dev/usb/usb.h
@@ -755,8 +755,9 @@ enum usb_dev_speed {
        USB_SPEED_FULL,
        USB_SPEED_HIGH,
        USB_SPEED_SUPER,
+       USB_SPEED_SUPER_PLUS,
 };
-#define        USB_SPEED_MAX   (USB_SPEED_SUPER+1)
+#define        USB_SPEED_MAX   (USB_SPEED_SUPER_PLUS+1)
 
 /*
  * The "USB_REV" macros defines all the supported USB revisions.

Hi bz@, Thanks for your reply. I might not know what is the correct way to do so. But I think in the stack tab, all of my patches can be seen in here.

CleanShot 2026-05-25 at 15.23.44.png (1,508×866 px, 227 KB)

Sep 5 2026, 9:41 PM · USB
bz requested changes to D57196: usbconfig: Add SSPx2 support.
Sep 5 2026, 9:38 PM · USB
bz accepted D57195: libusb: Add SSP and SSPx2 enum support.
Sep 5 2026, 9:36 PM · USB
bz accepted D57197: usbdump: Support SSP and SSPx2 speed display.
Sep 5 2026, 9:34 PM · USB
bz accepted D57194: usb: Add SSP and SSPx2 speed and move USB_*_MAX into enum.
Sep 5 2026, 8:23 PM · USB

Aug 25 2026

aokblast added a comment to D57146: xhci: Do not drop and add bits in xhci.
In D57146#1356729, @oh wrote:

This commit make cheap USB memory key to not attach - see below.
The commit works with Samsung memory keys.
Maybe this is correct and the necessary change to get the cheap noname USB memory keys to work needs to be done in some other place.

======= NOT WORKING ====

DEFAULT: xhci_cmd_set_tr_dequeue_prt err: 0 drop 0
xhci_cmd_set_tr_dequeue_prt err: 0 drop 0
DEFAULT: xhci_cmd_set_tr_dequeue_prt err: 0 drop 0
xhci_cmd_set_tr_dequeue_prt err: 0 drop 0
ugen0.4: <USB Disk 20> at usbus0
umass0 numa-domain 0 on uhub0
umass0: <USB Disk 20, class 0/0, rev 3.20/2.00, addr 5> on usbus0
umass0: SCSI over Bulk-Only; quirks = 0x0
umass0:3:0: Attached to scbus3
XHCI_EPCTX_0_EPSTATE_DISABLED - fallthrough
XHCI_EPCTX_0_EPSTATE_STOPPED
XHCI_EPCTX_0_EPSTATE_DISABLED - fallthrough
XHCI_EPCTX_0_EPSTATE_STOPPED

XHCI_EPCTX_0_EPSTATE_HALTED err 0 drop 0
XHCI_EPCTX_0_EPSTATE_STOPPED
DEFAULT: xhci_cmd_set_tr_dequeue_prt err: 0 drop 0

++ Repeat last 3 printout 8 times ++

XHCI_EPCTX_0_EPSTATE_HALTED err 0 drop 0
(da8:umass-sim0:0:0:0): got CAM status 0x444
(da8:umass-sim0:0:0:0): fatal error, failed to attach to device
XHCI_EPCTX_0_EPSTATE_STOPPED
DEFAULT: xhci_cmd_set_tr_dequeue_prt err: 0 drop 0
XHCI_EPCTX_0_EPSTATE_HALTED err 0 drop 0
XHCI_EPCTX_0_EPSTATE_STOPPED
(da8:umass-sim0:0:0:0): MODE SENSE for CACHE page command failed.
(da8:umass-sim0:0:0:0): Mode page 8 missing, disabling SYNCHRONIZE CACHE

REVERT COMMIT

DEFAULT: xhci_cmd_set_tr_dequeue_prt err: 0 drop 1
DEFAULT: xhci_cmd_set_tr_dequeue_prt err: 0 drop 1
ugen0.4: <USB Disk 20> at usbus0
umass0 numa-domain 0 on uhub2
umass0: <USB Disk 20, class 0/0, rev 3.20/2.00, addr 3> on usbus0
umass0: SCSI over Bulk-Only; quirks = 0x0
umass0:3:0: Attached to scbus3
XHCI_EPCTX_0_EPSTATE_DISABLED break
XHCI_EPCTX_0_EPSTATE_DISABLED break
XHCI_EPCTX_0_EPSTATE_HALTED err 0 drop 0
XHCI_EPCTX_0_EPSTATE_STOPPED
DEFAULT: xhci_cmd_set_tr_dequeue_prt err: 0 drop 1
DEFAULT: xhci_cmd_set_tr_dequeue_prt err: 0 drop 1
XHCI_EPCTX_0_EPSTATE_HALTED err 0 drop 0
XHCI_EPCTX_0_EPSTATE_STOPPED
DEFAULT: xhci_cmd_set_tr_dequeue_prt err: 0 drop 1
DEFAULT: xhci_cmd_set_tr_dequeue_prt err: 0 drop 1
XHCI_EPCTX_0_EPSTATE_HALTED err 0 drop 0
XHCI_EPCTX_0_EPSTATE_STOPPED
DEFAULT: xhci_cmd_set_tr_dequeue_prt err: 0 drop 1
DEFAULT: xhci_cmd_set_tr_dequeue_prt err: 0 drop 1
XHCI_EPCTX_0_EPSTATE_HALTED err 0 drop 0
XHCI_EPCTX_0_EPSTATE_STOPPED
DEFAULT: xhci_cmd_set_tr_dequeue_prt err: 0 drop 1
DEFAULT: xhci_cmd_set_tr_dequeue_prt err: 0 drop 1
XHCI_EPCTX_0_EPSTATE_HALTED err 0 drop 0
XHCI_EPCTX_0_EPSTATE_STOPPED
DEFAULT: xhci_cmd_set_tr_dequeue_prt err: 0 drop 1
DEFAULT: xhci_cmd_set_tr_dequeue_prt err: 0 drop 1
da8 at umass-sim0 bus 0 scbus3 target 0 lun 0
da8: <VendorC ProductCode 2.00> Removable Direct Access SPC-2 SCSI device
da8: Serial Number FC3056EA59044
da8: 400.000MB/s transfers
da8: 30000MB (61440000 512 byte sectors)
da8: quirks=0x2<NO_6_BYTE>
(da8:umass-sim0:0:0:0): CACHE PAGE TOO SHORT data len 3 desc len 0
(da8:umass-sim0:0:0:0): Mode page 8 missing, disabling SYNCHRONIZE CACHE

Aug 25 2026, 7:25 PM · USB

Aug 24 2026

oh added a comment to D57146: xhci: Do not drop and add bits in xhci.

This commit make cheap USB memory key to not attach - see below.
The commit works with Samsung memory keys.
Maybe this is correct and the necessary change to get the cheap noname USB memory keys to work needs to be done in some other place.

Aug 24 2026, 5:20 PM · USB

Aug 17 2026

seuros abandoned D58869: usb: skip root_mount_hold when root is not on USB.
Aug 17 2026, 12:49 PM · USB
imp requested changes to D58869: usb: skip root_mount_hold when root is not on USB.

I think this is generally a really bad idea.

> kenv | grep vfs
vfs.root.mountfrom="ufs:/dev/ada0p2"
vfs.root.mountfrom.options="rw"

So we almost always have a : in the path, since the boot loader adds it.
And I think it breaks asking for a root device (say if the root is supposed to be nda0, but that's broken, we may not have the thumb drive you plugged in detected before we get to mountroot prompt).
And many people have zpools on usb, even when booting from ada, so their pools will disappear if the boot path is faster.

Aug 17 2026, 12:46 PM · USB
seuros added a comment to D58869: usb: skip root_mount_hold when root is not on USB.

the root filesystem is on SATA, NVMe, or ZFS (which are never USB).

That's a bit of a bold claim because ZFS can use USB devices. Is it smart? Hell no. Is it possible? Yes. Also, you would need to deal with all GEOM layers, e.g., graid, gmirror, etc.

I understand what you're trying to solve, but I'm a bit skeptical of the approach being taken given how much things can be stacked on top of one another in FreeBSD from a storage perspective between cam (ctl anyone?), geom, and ZFS.

Aug 17 2026, 12:16 PM · USB
seuros updated the diff for D58869: usb: skip root_mount_hold when root is not on USB.

adress comments

Aug 17 2026, 12:13 PM · USB

Aug 16 2026

ngie added a comment to D58869: usb: skip root_mount_hold when root is not on USB.

Back in the day this also used to be a flat sleep for all of cam.. it was worse than it is currently.
I feel like better dependency tracking needs to be done to avoid this behavior.
Also... this might be deal with/benefit ukbd as back in the good old days (when there was a flat sleep), the mount root prompt would be unusable with USB keyboards, leaving the sysadmin with a wedged computer terminal asking for a root device and not being able to actually input anything on the keyboard to remedy that situation. Wash-rinse-repeat and the reboot cycle increases because power cycling sometimes reinitializes firmware and has to respin up drives in JBODs, etc (especially in the legacy BIOS and old UEFI days).
So yes, this is an inconvenience, but I would temper removing this based only on the names of functions, etc, alone.
Please go through git blame and see whether or not the change that added this code (functionally, not restylized it) was dealing with the case we think it should be dealing with (quiescing USB root devices) instead of dealing with the vfs_mountroot prompt.

Aug 16 2026, 11:57 PM · USB
ngie added a comment to D58869: usb: skip root_mount_hold when root is not on USB.

Back in the day this also used to be a flat sleep for all of cam.. it was worse than it is currently.
I feel like better dependency tracking needs to be done to avoid this behavior.
Also... this might be deal with/benefit ukbd as back in the good old days (when there was a flat sleep), the mount root prompt would be unusable with USB keyboards, leaving the sysadmin with a wedged computer terminal asking for a root device and not being able to actually input anything on the keyboard to remedy that situation. Wash-rinse-repeat and the reboot cycle increases because power cycling sometimes reinitializes firmware and has to respin up drives in JBODs, etc (especially in the legacy BIOS and old UEFI days).
So yes, this is an inconvenience, but I would temper removing this based only on the names of functions, etc, alone.
Please go through git blame and see whether or not the change that added this code (functionally, not restylized it) was dealing with the case we think it should be dealing with (quiescing USB root devices) instead of dealing with the vfs_mountroot prompt.

Aug 16 2026, 11:49 PM · USB
ngie added a comment to D58869: usb: skip root_mount_hold when root is not on USB.

the root filesystem is on SATA, NVMe, or ZFS (which are never USB).

Aug 16 2026, 11:31 PM · USB
seuros added a project to D58869: usb: skip root_mount_hold when root is not on USB: USB.
Aug 16 2026, 6:34 PM · USB

Aug 13 2026

emaste added inline comments to D49453: USB4 initial work on suspend routine.
Aug 13 2026, 6:20 PM · USB
ngie added a comment to D49453: USB4 initial work on suspend routine.

The changes seem reasonable. My general concerns with the change are just related to documentation, follow up and potential future collaboration (especially if I start helping out in this space in the next few months).

Aug 13 2026, 6:10 PM · USB
obiwac added a reviewer for D49453: USB4 initial work on suspend routine: ngie.
Aug 13 2026, 6:22 AM · USB