>Synopsis:      JHL6540 Thunderbolt xHCI hotplug blocks system for ~30s
>Category:      kernel
>Environment:
        System      : OpenBSD 8.0
        Details     : OpenBSD 8.0 (GENERIC.MP) #80: Sat Oct  3 05:53:01 MDT 2026
                         
[email protected]:/usr/src/sys/arch/amd64/compile/GENERIC.MP

        Architecture: OpenBSD.amd64
        Machine     : amd64
>Description:
        Plugging a USB-C monitor with a USB-C hub into the Thunderbolt/USB-C 
port on
        a ThinkPad X1 Carbon Gen 8 stalls the whole system for about 28-30 
seconds.
        The monitor is detected as DP-2 with 3840x2160 modes, and its USB 2.0
        hub (keyboard/mouse) enumerates on xhci0. The Thunderbolt xHCI (xhci1)
        never responds and never enumerates a downstream device.

        Relevant dmesg after plugging the monitor:

          ppb2 at pci2 dev 0 function 0 "Intel JHL6540 Thunderbolt" rev 0x02
          pci3 at ppb2 bus 6
          ppb3 at pci3 dev 0 function 0 "Intel JHL6540 Thunderbolt" rev 0x02: 
msi
          pci4 at ppb3 bus 7
          ppb4 at pci3 dev 1 function 0 "Intel JHL6540 Thunderbolt" rev 0x02: 
msi
          pci5 at ppb4 bus 15
          ppb5 at pci3 dev 2 function 0 "Intel JHL6540 Thunderbolt" rev 0x02: 
msi
          pci6 at ppb5 bus 19
          xhci1 at pci6 dev 0 function 0 "Intel JHL6540 Thunderbolt" rev 0x02: 
msi, xHCI 1.10
          usb1 at xhci1: USB revision 3.0
          uhub1 at usb1 configuration 1 interface 0 "Intel xHCI root hub" rev 
3.00/1.00 addr 1
          ppb6 at pci3 dev 4 function 0 "Intel JHL6540 Thunderbolt" rev 0x02: 
msi
          pci7 at ppb6 bus 46
          xhci1: command ring abort timeout
          uhub1: device problem, disabling port 1
          xhci1: command ring abort timeout
          uhub1: device problem, disabling port 2
          xhci1: command ring abort timeout
          uhub1: device problem, disabling port 3
          xhci1: command ring abort timeout
          uhub1: device problem, disabling port 4
          EDID block 0 (tag 0x00) checksum is invalid, remainder is 125
          ...
          uhub2 at uhub0 port 2 configuration 1 interface 0 "Generic 4-Port USB 
2.0 Hub" rev 2.10/1.50 addr 4
          uhub3 at uhub2 port 1 configuration 1 interface 0 "Genesys Logic 
USB2.0 Hub" rev 2.00/89.32 addr 5
          uhidev0 at uhub3 port 2 configuration 1 interface 1 "Cypress 
Semiconductor Samsung Type-C Monitor" rev 2.01/0.00 addr 6
          ...

        On unplug:

          pci7 detached
          ppb6 detached
          uhub1 detached
          usb1 detached
          xhci1: command ring abort timeout
          xhci1: reset timeout
          xhci1 detached
          pci6 detached
          ppb5 detached
          ...

        The EDID checksum errors appear to be transient; DP-2 is detected
        after the monitor wakes. The xhci1 timeouts are separate from the
        display path.

        Measured with a 50ms CLOCK_MONOTONIC sampler (Perl script below).
        Eight stalls of about 3.4s each, about 28s total. The Xorg process
        was in state D/wfct during the stalls, and the sampler also stopped,
        so the stall is not limited to Xorg.

        The wall-clock sampler showed gaps of 8s, 3s, 3s, 4s, 3s, and 7s.

        The attached dmesg is the boot dmesg; the hotplug excerpt is above.

>How-To-Repeat:
        1. On a ThinkPad X1 Carbon Gen 8, run OpenBSD 8.0-current GENERIC.MP.
        2. Plug a Samsung USB-C monitor/hub (USB VID 04e8 PID f649) into
           the Thunderbolt/USB-C port. Leaving the monitor asleep or on
           another input may make the EDID stalls more likely.
        3. The system stalls for about 28-30s. dmesg shows the xhci1
           command ring abort timeouts and the four disabled ports.
        4. Unplug the monitor; xhci1 reset timeouts follow. Save-state
           timeouts also appear on suspend.

        A Perl loop sampled CLOCK_MONOTONIC every 50ms before, during,
        and after the plug:

          perl -MTime::HiRes=clock_gettime,CLOCK_MONOTONIC,sleep -e '
            open my $fh, ">", "/tmp/freeze.clock" or die $!;
            $fh->autoflush(1);
            while (1) {
              printf $fh "%.3f\n", clock_gettime(CLOCK_MONOTONIC);
              sleep 0.05;
            }
          ' &

        CLOCK_MONOTONIC is unaffected by wall-clock changes, so a gap in
        the file is real elapsed time during which the loop could not run.
        The gaps were extracted with:

          perl -e 'open my $f, "<", "/tmp/freeze.clock" or die $!;
            my $p; while (<$f>) { chomp; my $t = $_;
            printf "gap %.3fs\n", $t - $p if defined $p && $t - $p > 0.25;
            $p = $t; }'

        A second loop logged `date +%s` and `ps -axo pid,stat,wchan,comm`
        once per second. `vmstat 1` and `tail -f /var/log/messages` also ran.

>Fix:
        Workaround: restrict the xhci driver to the PCH controller so it
        never binds to the Thunderbolt xHCI. Add to /etc/bsd.re-config:

          change xhci*
          y
          20
          0
          0

        The entry becomes `xhci* at pci* dev 0x14 function 0`, which matches
        xhci0 at pci0 dev 20 function 0 and skips the JHL6540 xHCI at dev 0
        function 0. This should leave the monitor detected as DP-2 and its
        USB 2.0 hub working; I have not boot-tested this workaround. The
        Thunderbolt USB 3.x path is lost, but no downstream device
        enumerates there.

        A quirk to skip the JHL6540 xHCI would also avoid the timeouts.

        The EDID/DRM stalls are a separate issue; a similar ~3s userland
        stall was reported on tech@ in March 2022 under the subject
        "slow xrandr / DRM_IOCTL_MODE_GETCONNECTOR".

dmesg:
OpenBSD 8.0 (GENERIC.MP) #80: Sat Oct  3 05:53:01 MDT 2026
    [email protected]:/usr/src/sys/arch/amd64/compile/GENERIC.MP
real mem = 8351608832 (7964MB)
avail mem = 8075915264 (7701MB)
random: good seed from bootblocks
mpath0 at root
scsibus0 at mpath0: 256 targets
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 3.2 @ 0x76aac000 (72 entries)
bios0: vendor LENOVO version "N2WET24W (1.14 )" date 10/15/2020
bios0: LENOVO 20U9CTO1WW
efi0 at bios0: UEFI 2.7
efi0: Lenovo rev 0x1140
acpi0 at bios0: ACPI 6.1
acpi0: sleep states S0ix S3 S4 S5
acpi0: tables DSDT FACP SSDT SSDT SSDT SSDT SSDT TPM2 SSDT HPET APIC MCFG ECDT 
SSDT SSDT SSDT NHLT BOOT SSDT LPIT WSMT SSDT DBGP DBG2 POAT BATB DMAR UEFI FPDT
acpi0: wakeup devices GLAN(S4) XHC_(S3) XDCI(S4) HDAS(S4) RP01(S4) PXSX(S4) 
RP02(S4) PXSX(S4) PXSX(S4) RP04(S4) PXSX(S4) RP05(S4) PXSX(S4) RP06(S4) 
PXSX(S4) RP07(S4) [...]
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpihpet0 at acpi0: 23999999 Hz
acpimadt0 at acpi0 addr 0xfee00000: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: Intel(R) Core(TM) i5-10210U CPU @ 1.60GHz, 1786.62 MHz, 06-8e-0c, patch 
00000100
cpu0: cpuid 1 
edx=bfebfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE>
 
ecx=77fafbbf<SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,SDBG,FMA3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,DEADLINE,AES,XSAVE,AVX,F16C,RDRAND>
cpu0: cpuid 6 eax=27f7<SENSOR,ARAT,PTS> ecx=9<EFFFREQ>
cpu0: cpuid 7.0 
ebx=29c67af<FSGSBASE,TSC_ADJUST,SGX,BMI1,AVX2,SMEP,BMI2,ERMS,INVPCID,MPX,RDSEED,ADX,SMAP,CLFLUSHOPT,PT>
 edx=bc000600<SRBDS_CTRL,MD_CLEAR,IBRS,IBPB,STIBP,L1DF,SSBD>
cpu0: cpuid a vers=4, gp=4, gpwidth=48, ff=3, ffwidth=48
cpu0: cpuid d.1 eax=f<XSAVEOPT,XSAVEC,XGETBV1,XSAVES>
cpu0: cpuid 80000001 edx=2c100800<NXE,PAGE1GB,RDTSCP,LONG> 
ecx=121<LAHF,ABM,3DNOWP>
cpu0: cpuid 80000007 edx=100<ITSC>
cpu0: msr 
10a=a0a0c2b<IBRS_ALL,SKIP_L1DFL,MDS_NO,MISC_PKG_CT,ENERGY_FILT,FB_CLEAR,RRSBA,GDS_CTRL,RFDS_NO>
cpu0: 32KB 64b/line 8-way D-cache, 32KB 64b/line 8-way I-cache, 256KB 64b/line 
4-way L2 cache, 6MB 64b/line 12-way L3 cache
cpu0: smt 0, core 0, package 0, type P
mtrr: Pentium Pro MTRR support, 10 var ranges, 88 fixed ranges
cpu0: apic clock running at 24MHz
cpu0: mwait min=64, max=64, C-substates=0.2.1.2.4.1.1.1, IBE
cpu1 at mainbus0: apid 2 (application processor)
cpu1: Intel(R) Core(TM) i5-10210U CPU @ 1.60GHz, 1555.66 MHz, 06-8e-0c, patch 
00000100
cpu1: smt 0, core 1, package 0, type P
cpu2 at mainbus0: apid 4 (application processor)
cpu2: Intel(R) Core(TM) i5-10210U CPU @ 1.60GHz, 1496.52 MHz, 06-8e-0c, patch 
00000100
cpu2: smt 0, core 2, package 0, type P
cpu3 at mainbus0: apid 6 (application processor)
cpu3: Intel(R) Core(TM) i5-10210U CPU @ 1.60GHz, 1496.52 MHz, 06-8e-0c, patch 
00000100
cpu3: smt 0, core 3, package 0, type P
cpu4 at mainbus0: apid 1 (application processor)
cpu4: Intel(R) Core(TM) i5-10210U CPU @ 1.60GHz, 1496.52 MHz, 06-8e-0c, patch 
00000100
cpu4: smt 1, core 0, package 0, type SP
cpu5 at mainbus0: apid 3 (application processor)
cpu5: Intel(R) Core(TM) i5-10210U CPU @ 1.60GHz, 1496.52 MHz, 06-8e-0c, patch 
00000100
cpu5: smt 1, core 1, package 0, type SP
cpu6 at mainbus0: apid 5 (application processor)
cpu6: Intel(R) Core(TM) i5-10210U CPU @ 1.60GHz, 1496.52 MHz, 06-8e-0c, patch 
00000100
cpu6: smt 1, core 2, package 0, type SP
cpu7 at mainbus0: apid 7 (application processor)
cpu7: Intel(R) Core(TM) i5-10210U CPU @ 1.60GHz, 1496.52 MHz, 06-8e-0c, patch 
00000100
cpu7: smt 1, core 3, package 0, type SP
ioapic0 at mainbus0: apid 2 pa 0xfec00000, version 20, 120 pins
acpimcfg0 at acpi0
acpimcfg0: addr 0xf0000000, bus 0-127
acpiec0 at acpi0
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus -1 (RP01)
acpiprt2 at acpi0: bus -1 (RP02)
acpiprt3 at acpi0: bus -1 (RP03)
acpiprt4 at acpi0: bus -1 (RP04)
acpiprt5 at acpi0: bus -1 (RP05)
acpiprt6 at acpi0: bus -1 (RP06)
acpiprt7 at acpi0: bus -1 (RP07)
acpiprt8 at acpi0: bus -1 (RP08)
acpiprt9 at acpi0: bus 3 (RP09)
acpiprt10 at acpi0: bus -1 (RP10)
acpiprt11 at acpi0: bus -1 (RP11)
acpiprt12 at acpi0: bus -1 (RP12)
acpiprt13 at acpi0: bus 5 (RP13)
acpiprt14 at acpi0: bus -1 (RP14)
acpiprt15 at acpi0: bus -1 (RP15)
acpiprt16 at acpi0: bus -1 (RP16)
acpiprt17 at acpi0: bus -1 (RP17)
acpiprt18 at acpi0: bus -1 (RP18)
acpiprt19 at acpi0: bus -1 (RP19)
acpiprt20 at acpi0: bus -1 (RP20)
acpiprt21 at acpi0: bus -1 (RP21)
acpiprt22 at acpi0: bus -1 (RP22)
acpiprt23 at acpi0: bus -1 (RP23)
acpiprt24 at acpi0: bus -1 (RP24)
acpipci0 at acpi0 PCI0: 0x00000010 0x00000011 0x00000000
acpithinkpad0 at acpi0: version 2.0
acpiac0 at acpi0: AC unit online
acpibat0 at acpi0: BAT0 model "5B10W13930" serial <redacted> type LiP oem "LGC"
"INT33D3" at acpi0 not configured
"LEN0111" at acpi0 not configured
"LEN0100" at acpi0 not configured
"INT3403" at acpi0 not configured
"INT3403" at acpi0 not configured
"LEN0130" at acpi0 not configured
acpicmos0 at acpi0
"LEN0071" at acpi0 not configured
"LEN0300" at acpi0 not configured
pchgpio0 at acpi0 GPI0 addr 0xfd6e0000/0x10000 0xfd6d0000/0x10000 
0xfd6a0000/0x10000 irq 14, 320 pins
"SYNA8006" at acpi0 not configured
"PNP0C14" at acpi0 not configured
acpibtn0 at acpi0: SLPB(wakeup)
"PNP0C14" at acpi0 not configured
"PNP0C14" at acpi0 not configured
intelpmc0 at acpi0: PEPD
state 0: 0x7f:1:2:0x00:0x0000000000000060
counter: 0x7f:64:0:0x00:0x0000000000000632
frequency: 0
state 1: 0x7f:1:2:0x00:0x0000000000000060
counter: 0x00:32:0:0x03:0x00000000fe00193c
frequency: 9580
inthid0 at acpi0: HIDD
acpibtn1 at acpi0: LID_(wakeup)
"PNP0C14" at acpi0 not configured
"PNP0C14" at acpi0 not configured
"PNP0C14" at acpi0 not configured
"PNP0C14" at acpi0 not configured
"PNP0C14" at acpi0 not configured
"INT3400" at acpi0 not configured
tpm0 at acpi0 TPM_ 2.0 (TIS) addr 0xfed40000/0x5000, device 0x0000104a rev 0x4e
"USBC000" at acpi0 not configured
acpipwrres0 at acpi0: PUBS, resource for XHC_
acpipwrres1 at acpi0: BTPR, resource for HS10
acpipwrres2 at acpi0: USBC, resource for XDCI
acpipwrres3 at acpi0: PXP_, resource for RP01, PXSX
acpipwrres4 at acpi0: V0PR
acpipwrres5 at acpi0: V1PR
acpipwrres6 at acpi0: V2PR
acpipwrres7 at acpi0: WRST
acpicpu0 at acpi0: C3(200@1034 mwait.1@0x60), C2(200@151 mwait.1@0x33), 
C1(1000@1 mwait.1), PSS
acpicpu1 at acpi0: C3(200@1034 mwait.1@0x60), C2(200@151 mwait.1@0x33), 
C1(1000@1 mwait.1), PSS
acpicpu2 at acpi0: C3(200@1034 mwait.1@0x60), C2(200@151 mwait.1@0x33), 
C1(1000@1 mwait.1), PSS
acpicpu3 at acpi0: C3(200@1034 mwait.1@0x60), C2(200@151 mwait.1@0x33), 
C1(1000@1 mwait.1), PSS
acpicpu4 at acpi0: C3(200@1034 mwait.1@0x60), C2(200@151 mwait.1@0x33), 
C1(1000@1 mwait.1), PSS
acpicpu5 at acpi0: C3(200@1034 mwait.1@0x60), C2(200@151 mwait.1@0x33), 
C1(1000@1 mwait.1), PSS
acpicpu6 at acpi0: C3(200@1034 mwait.1@0x60), C2(200@151 mwait.1@0x33), 
C1(1000@1 mwait.1), PSS
acpicpu7 at acpi0: C3(200@1034 mwait.1@0x60), C2(200@151 mwait.1@0x33), 
C1(1000@1 mwait.1), PSS
acpitz0 at acpi0
acpitz0: critical temperature is 128 degC
acpipwrres8 at acpi0: PIN_
acpipwrres9 at acpi0: PINP
acpivideo0 at acpi0: GFX0
acpivout0 at acpivideo0: DD1F
cpu0: Enhanced SpeedStep 1786 MHz: speeds: 2101, 2100, 2000, 1900, 1700, 1600, 
1500, 1400, 1200, 1100, 1000, 800, 700, 600, 500, 400 MHz
pci0 at mainbus0 bus 0
pchb0 at pci0 dev 0 function 0 "Intel Core 10G Host" rev 0x0c
inteldrm0 at pci0 dev 2 function 0 "Intel UHD Graphics" rev 0x02
drm0 at inteldrm0
inteldrm0: msi, COMETLAKE, gen 9
"Intel Core 6G Thermal" rev 0x0c at pci0 dev 4 function 0 not configured
"Intel Core GMM" rev 0x00 at pci0 dev 8 function 0 not configured
pchtemp0 at pci0 dev 18 function 0 "Intel 400 Series Thermal" rev 0x00
xhci0 at pci0 dev 20 function 0 "Intel 400 Series xHCI" rev 0x00: msi, xHCI 1.10
usb0 at xhci0: USB revision 3.0
uhub0 at usb0 configuration 1 interface 0 "Intel xHCI root hub" rev 3.00/1.00 
addr 1
"Intel 400 Series Shared SRAM" rev 0x00 at pci0 dev 20 function 2 not configured
iwx0 at pci0 dev 20 function 3 "Intel Wi-Fi 6 AX201" rev 0x00, msix
dwiic0 at pci0 dev 21 function 0 "Intel 400 Series I2C" rev 0x00: apic 2 int 16
iic0 at dwiic0
dwiic1 at pci0 dev 21 function 1 "Intel 400 Series I2C" rev 0x00: apic 2 int 17
iic1 at dwiic1
ihidev0 at iic1 addr 0x2c gpio 100, vendor 0x6cb product 0xcd8b, SYNA8006
ihidev0: 15 report ids
imt0 at ihidev0: clickpad, 5 contacts
wsmouse0 at imt0 mux 0
ims0 at ihidev0 reportid 2: 2 buttons
wsmouse1 at ims0 mux 0
hid at ihidev0 reportid 6 not configured
hid at ihidev0 reportid 7 not configured
hid at ihidev0 reportid 9 not configured
hid at ihidev0 reportid 10 not configured
hid at ihidev0 reportid 11 not configured
hid at ihidev0 reportid 12 not configured
hid at ihidev0 reportid 13 not configured
hid at ihidev0 reportid 14 not configured
hid at ihidev0 reportid 15 not configured
"Intel 400 Series MEI" rev 0x00 at pci0 dev 22 function 0 not configured
ppb0 at pci0 dev 29 function 0 "Intel 400 Series PCIE" rev 0xf0: msi
pci1 at ppb0 bus 3
nvme0 at pci1 dev 0 function 0 "SanDisk WD Black" rev 0x00: msix, NVMe 1.3
nvme0: WDC PC SN730 SDBQNTY-256G-1001, firmware 11170101, serial <redacted>
scsibus1 at nvme0: 2 targets, initiator 0
sd0 at scsibus1 targ 1 lun 0: <NVMe, WDC PC SN730 SDB, 1117>
sd0: 244198MB, 512 bytes/sector, 500118192 sectors
ppb1 at pci0 dev 29 function 4 "Intel 400 Series PCIE" rev 0xf0: msi
pci2 at ppb1 bus 5
pcib0 at pci0 dev 31 function 0 "Intel 400 Series LPC" rev 0x00
azalia0 at pci0 dev 31 function 3 "Intel 400 Series HD Audio" rev 0x00: msi
azalia0: codecs: Realtek ALC285, Intel/0x280b, using Realtek ALC285
audio0 at azalia0
ichiic0 at pci0 dev 31 function 4 "Intel 400 Series SMBus" rev 0x00: apic 2 int 
16
iic2 at ichiic0
ichiic0: abort failed, status 0x41<BUSY,INUSE>
"Intel 400 Series SPI" rev 0x00 at pci0 dev 31 function 5 not configured
em0 at pci0 dev 31 function 6 "Intel I219-V" rev 0x00: msi, address <redacted>
isa0 at pcib0
isadma0 at isa0
pckbc0 at isa0 port 0x60/5 irq 1 irq 12
pckbd0 at pckbc0 (kbd slot)
wskbd0 at pckbd0: console keyboard
pms0 at pckbc0 (aux slot)
wsmouse2 at pms0 mux 0
pcppi0 at isa0 port 0x61
spkr0 at pcppi0
vmm0 at mainbus0: VMX/EPT
efifb at mainbus0 not configured
iwx0: restrict all mbufs to low memory
uvideo0 at uhub0 port 8 configuration 1 interface 0 "Sonix Technology Co., Ltd. 
Integrated Camera" rev 2.01/4.07 addr 2
video0 at uvideo0
ugen0 at uhub0 port 9 "Synaptics Fingerprint Reader" rev 2.00/0.00 addr 3
vscsi0 at root
scsibus2 at vscsi0: 256 targets
softraid0 at root
scsibus3 at softraid0: 256 targets
root on sd0a (<redacted>) swap on sd0b dump on sd0b
inteldrm0: 2560x1440, 32bpp
wsdisplay0 at inteldrm0 mux 1: console (std, vt100 emulation), using wskbd0
wsdisplay0: screen 1-5 added (std, vt100 emulation)
iwx0: hw rev 0x350, fw 77.30b1cbd8.0, address <redacted>

usbdevs:
Controller /dev/usb0:
addr 01: 8086:0000 Intel, xHCI root hub
         super speed, self powered, config 1, rev 1.00
         driver: uhub0
addr 02: 04f2:b67d Sonix Technology Co., Ltd., Integrated Camera
         high speed, power 500 mA, config 1, rev 4.07
         driver: uvideo0
addr 03: 06cb:00bd Synaptics, Fingerprint Reader
         full speed, power 100 mA, config 1, rev 0.00, iSerial <redacted>
         driver: ugen0
addr 04: 0bda:5411 Generic, 4-Port USB 2.0 Hub
         high speed, self powered, config 1, rev 1.50
         driver: uhub2
addr 05: 05e3:0608 Genesys Logic, USB2.0 Hub
         high speed, self powered, config 1, rev 89.32
         driver: uhub3
addr 07: 045e:082c Microsoft, Microsoft Ergonomic Keyboard
         low speed, power 100 mA, config 1, rev 1.09, iSerial <redacted>
         driver: uhidev1
         driver: uhidev2
addr 08: 045e:07a5 Microsoft, Microsoft\M-. 2.4GHz Transceiver v9.0
         full speed, power 100 mA, config 1, rev 7.97
         driver: uhidev3
         driver: uhidev4
         driver: uhidev5
Controller /dev/usb1:
addr 01: 8086:0000 Intel, xHCI root hub
         super speed, self powered, config 1, rev 1.00
         driver: uhub1

Reply via email to