On Thu Feb 11, 2021 at 04:24:25PM +0100, Marcus Glocker wrote:
> On Thu, Feb 11, 2021 at 07:15:57AM +0100, Rafael Sadowski wrote:
> 
> [...]
> > > Thank you.  Can you please run the same while plugin the keyboard/mouse
> > > directly to the host?  I would like to understand whether the issue is
> > > caused by the switch or naively by your device.
> > > 
> > 
> > Here it is:
> 
> OK, so it's the same basically.  I currently really have no idea why
> the UR_CLEAR_FEATURE for EPs is working on the most of the devices,
> but fail for some.  Therefore, if you back it out from uhidev(4), does
> the keyboard survive your switch restart again?
> 
> 
> Index: uhidev.c
> ===================================================================
> RCS file: /cvs/src/sys/dev/usb/uhidev.c,v
> retrieving revision 1.88
> diff -u -p -u -p -r1.88 uhidev.c
> --- uhidev.c  11 Feb 2021 06:55:10 -0000      1.88
> +++ uhidev.c  11 Feb 2021 15:20:37 -0000
> @@ -518,9 +518,6 @@ uhidev_open(struct uhidev *scd)
>       DPRINTF(("uhidev_open: isize=%d, ep=0x%02x\n", sc->sc_isize,
>           sc->sc_iep_addr));
>  
> -     /* Clear device endpoint toggle. */
> -     uhidev_clear_iface_eps(sc, sc->sc_iface);
> -
>       err = usbd_open_pipe_intr(sc->sc_iface, sc->sc_iep_addr,
>                 USBD_SHORT_XFER_OK, &sc->sc_ipipe, sc, sc->sc_ibuf,
>                 sc->sc_isize, uhidev_intr, USBD_DEFAULT_INTERVAL);
> @@ -530,8 +527,6 @@ uhidev_open(struct uhidev *scd)
>               error = EIO;
>               goto out1;
>       }
> -     /* Clear HC endpoint toggle. */
> -     usbd_clear_endpoint_toggle(sc->sc_ipipe);
>  
>       DPRINTF(("uhidev_open: sc->sc_ipipe=%p\n", sc->sc_ipipe));
>  
> @@ -557,8 +552,6 @@ uhidev_open(struct uhidev *scd)
>                       error = EIO;
>                       goto out2;
>               }
> -             /* Clear HC endpoint toggle. */
> -             usbd_clear_endpoint_toggle(sc->sc_opipe);
>  
>               DPRINTF(("uhidev_open: sc->sc_opipe=%p\n", sc->sc_opipe));
>  
> 

I worked out this issue with a USB-Hub between the KVM-Switch and the
devices (webcam, keyboard and mouse). dmesg (without the diff above):

OpenBSD 6.9-beta (GENERIC.MP) #331: Thu Feb 11 20:28:45 MST 2021
    dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP
real mem = 17023193088 (16234MB)
avail mem = 16491921408 (15727MB)
random: good seed from bootblocks
mpath0 at root
scsibus0 at mpath0: 256 targets
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 3.0 @ 0x8b1a8000 (89 entries)
bios0: vendor American Megatrends Inc. version "3801" date 03/14/2018
bios0: ASUSTeK COMPUTER INC. Z170-PRO
acpi0 at bios0: ACPI 6.0
acpi0: sleep states S0 S3 S4 S5
acpi0: tables DSDT FACP APIC FPDT DBG2 MCFG SSDT FIDT SSDT SSDT HPET SSDT SSDT 
UEFI SSDT LPIT WSMT SSDT SSDT DBGP
acpi0: wakeup devices PEG0(S4) PEGP(S4) PEG1(S4) PEGP(S4) PEG2(S4) PEGP(S4) 
SIO1(S3) PS2K(S4) PS2M(S4) RP09(S4) PXSX(S4) RP10(S4) PXSX(S4) RP11(S4) 
PXSX(S4) RP12(S4) [...]
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpimadt0 at acpi0 addr 0xfee00000: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz, 4012.26 MHz, 06-5e-03
cpu0: 
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,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,NXE,PAGE1GB,RDTSCP,LONG,LAHF,ABM,3DNOWP,PERF,ITSC,FSGSBASE,TSC_ADJUST,SGX,BMI1,HLE,AVX2,SMEP,BMI2,ERMS,INVPCID,RTM,MPX,RDSEED,ADX,SMAP,CLFLUSHOPT,PT,SRBDS_CTRL,MD_CLEAR,TSXFA,IBRS,IBPB,STIBP,L1DF,SSBD,SENSOR,ARAT,XSAVEOPT,XSAVEC,XGETBV1,XSAVES,MELTDOWN
cpu0: 256KB 64b/line 8-way L2 cache
cpu0: smt 0, core 0, package 0
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, IBE
cpu1 at mainbus0: apid 2 (application processor)
cpu1: Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz, 4010.77 MHz, 06-5e-03
cpu1: 
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,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,NXE,PAGE1GB,RDTSCP,LONG,LAHF,ABM,3DNOWP,PERF,ITSC,FSGSBASE,TSC_ADJUST,SGX,BMI1,HLE,AVX2,SMEP,BMI2,ERMS,INVPCID,RTM,MPX,RDSEED,ADX,SMAP,CLFLUSHOPT,PT,SRBDS_CTRL,MD_CLEAR,TSXFA,IBRS,IBPB,STIBP,L1DF,SSBD,SENSOR,ARAT,XSAVEOPT,XSAVEC,XGETBV1,XSAVES,MELTDOWN
cpu1: 256KB 64b/line 8-way L2 cache
cpu1: smt 0, core 1, package 0
cpu2 at mainbus0: apid 4 (application processor)
cpu2: Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz, 4010.77 MHz, 06-5e-03
cpu2: 
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,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,NXE,PAGE1GB,RDTSCP,LONG,LAHF,ABM,3DNOWP,PERF,ITSC,FSGSBASE,TSC_ADJUST,SGX,BMI1,HLE,AVX2,SMEP,BMI2,ERMS,INVPCID,RTM,MPX,RDSEED,ADX,SMAP,CLFLUSHOPT,PT,SRBDS_CTRL,MD_CLEAR,TSXFA,IBRS,IBPB,STIBP,L1DF,SSBD,SENSOR,ARAT,XSAVEOPT,XSAVEC,XGETBV1,XSAVES,MELTDOWN
cpu2: 256KB 64b/line 8-way L2 cache
cpu2: smt 0, core 2, package 0
cpu3 at mainbus0: apid 6 (application processor)
cpu3: Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz, 4010.77 MHz, 06-5e-03
cpu3: 
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,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,NXE,PAGE1GB,RDTSCP,LONG,LAHF,ABM,3DNOWP,PERF,ITSC,FSGSBASE,TSC_ADJUST,SGX,BMI1,HLE,AVX2,SMEP,BMI2,ERMS,INVPCID,RTM,MPX,RDSEED,ADX,SMAP,CLFLUSHOPT,PT,SRBDS_CTRL,MD_CLEAR,TSXFA,IBRS,IBPB,STIBP,L1DF,SSBD,SENSOR,ARAT,XSAVEOPT,XSAVEC,XGETBV1,XSAVES,MELTDOWN
cpu3: 256KB 64b/line 8-way L2 cache
cpu3: smt 0, core 3, package 0
ioapic0 at mainbus0: apid 2 pa 0xfec00000, version 20, 120 pins
acpimcfg0 at acpi0
acpimcfg0: addr 0xe0000000, bus 0-255
acpihpet0 at acpi0: 23999999 Hz
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus -1 (PEG0)
acpiprt2 at acpi0: bus -1 (PEG1)
acpiprt3 at acpi0: bus -1 (PEG2)
acpiprt4 at acpi0: bus 8 (RP09)
acpiprt5 at acpi0: bus -1 (RP10)
acpiprt6 at acpi0: bus -1 (RP11)
acpiprt7 at acpi0: bus -1 (RP12)
acpiprt8 at acpi0: bus -1 (RP13)
acpiprt9 at acpi0: bus 2 (RP01)
acpiprt10 at acpi0: bus -1 (RP02)
acpiprt11 at acpi0: bus -1 (RP03)
acpiprt12 at acpi0: bus -1 (RP04)
acpiprt13 at acpi0: bus -1 (RP05)
acpiprt14 at acpi0: bus -1 (RP06)
acpiprt15 at acpi0: bus -1 (RP07)
acpiprt16 at acpi0: bus -1 (RP08)
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)
acpiprt25 at acpi0: bus -1 (RP14)
acpiprt26 at acpi0: bus -1 (RP15)
acpiprt27 at acpi0: bus -1 (RP16)
acpiec0 at acpi0: not present
acpipci0 at acpi0 PCI0: 0x00000000 0x00000011 0x00000001
acpicmos0 at acpi0
"PNP0C14" at acpi0 not configured
acpibtn0 at acpi0: SLPB
"PNP0C14" at acpi0 not configured
"INT33A1" at acpi0 not configured
acpibtn1 at acpi0: PWRB
"PNP0C14" at acpi0 not configured
acpicpu0 at acpi0: C1(@1 halt!), PSS
acpicpu1 at acpi0: C1(@1 halt!), PSS
acpicpu2 at acpi0: C1(@1 halt!), PSS
acpicpu3 at acpi0: C1(@1 halt!), PSS
acpipwrres0 at acpi0: PG00, resource for PEG0
acpipwrres1 at acpi0: PG01, resource for PEG1
acpipwrres2 at acpi0: PG02, resource for PEG2
acpipwrres3 at acpi0: WRST
acpipwrres4 at acpi0: WRST
acpipwrres5 at acpi0: WRST
acpipwrres6 at acpi0: WRST
acpipwrres7 at acpi0: WRST
acpipwrres8 at acpi0: WRST
acpipwrres9 at acpi0: WRST
acpipwrres10 at acpi0: WRST
acpipwrres11 at acpi0: WRST
acpipwrres12 at acpi0: WRST
acpipwrres13 at acpi0: WRST
acpipwrres14 at acpi0: WRST
acpipwrres15 at acpi0: WRST
acpipwrres16 at acpi0: WRST
acpipwrres17 at acpi0: WRST
acpipwrres18 at acpi0: WRST
acpipwrres19 at acpi0: WRST
acpipwrres20 at acpi0: WRST
acpipwrres21 at acpi0: WRST
acpipwrres22 at acpi0: WRST
acpivideo0 at acpi0: GFX0
acpivout0 at acpivideo0: DD1F
cpu0: using VERW MDS workaround (except on vmm entry)
cpu0: Enhanced SpeedStep 4012 MHz: speeds: 4001, 4000, 3800, 3500, 3300, 3100, 
2900, 2600, 2400, 2200, 1900, 1700, 1500, 1300, 1000, 800 MHz
pci0 at mainbus0 bus 0
pchb0 at pci0 dev 0 function 0 "Intel Core 6G Host" rev 0x07
inteldrm0 at pci0 dev 2 function 0 "Intel HD Graphics 530" rev 0x06
drm0 at inteldrm0
inteldrm0: msi, SKYLAKE, gen 9
xhci0 at pci0 dev 20 function 0 "Intel 100 Series xHCI" rev 0x31: msi, xHCI 1.0
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 100 Series MEI" rev 0x31 at pci0 dev 22 function 0 not configured
ahci0 at pci0 dev 23 function 0 "Intel 100 Series AHCI" rev 0x31: msi, AHCI 
1.3.1
ahci0: port 0: 3.0Gb/s
ahci0: PHY offline on port 1
ahci0: port 2: 6.0Gb/s
ahci0: port 3: 3.0Gb/s
ahci0: port 4: 3.0Gb/s
ahci0: port 5: 3.0Gb/s
scsibus1 at ahci0: 32 targets
sd0 at scsibus1 targ 0 lun 0: <ATA, SAMSUNG HD103UJ, 1AA0> naa.50024e9001a9ac31
sd0: 953868MB, 512 bytes/sector, 1953523055 sectors
sd1 at scsibus1 targ 2 lun 0: <ATA, Samsung SSD 850, EMT0> naa.5002538d4166218d
sd1: 476940MB, 512 bytes/sector, 976773168 sectors, thin
sd2 at scsibus1 targ 3 lun 0: <ATA, WDC WD20EARS-00M, 51.0> naa.50014ee60085518a
sd2: 1907729MB, 512 bytes/sector, 3907029168 sectors
sd3 at scsibus1 targ 4 lun 0: <ATA, SAMSUNG HD103UJ, 1AA0> naa.50000f000b036843
sd3: 953869MB, 512 bytes/sector, 1953525168 sectors
sd4 at scsibus1 targ 5 lun 0: <ATA, SAMSUNG HD753LJ, 1AA0> naa.50000f0000034276
sd4: 715403MB, 512 bytes/sector, 1465147055 sectors
ppb0 at pci0 dev 27 function 0 "Intel 100 Series PCIE" rev 0xf1: msi
pci1 at ppb0 bus 1
ppb1 at pci0 dev 28 function 0 "Intel 100 Series PCIE" rev 0xf1: msi
pci2 at ppb1 bus 2
ppb2 at pci2 dev 0 function 0 vendor "Intel", unknown product 0x1578 rev 0x00
pci3 at ppb2 bus 3
ppb3 at pci3 dev 0 function 0 vendor "Intel", unknown product 0x1578 rev 0x00
pci4 at ppb3 bus 4
ppb4 at pci3 dev 1 function 0 vendor "Intel", unknown product 0x1578 rev 0x00: 
msi
pci5 at ppb4 bus 5
ppb5 at pci3 dev 2 function 0 vendor "Intel", unknown product 0x1578 rev 0x00
pci6 at ppb5 bus 6
xhci1 at pci6 dev 0 function 0 vendor "Intel", unknown product 0x15b6 rev 0x00: 
msi, xHCI 1.0
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 vendor "Intel", unknown product 0x1578 rev 0x00: 
msi
pci7 at ppb6 bus 7
ppb7 at pci0 dev 29 function 0 "Intel 100 Series PCIE" rev 0xf1: msi
pci8 at ppb7 bus 8
nvme0 at pci8 dev 0 function 0 "Samsung SM981/PM981 NVMe" rev 0x00: msix, NVMe 
1.3
nvme0: Samsung SSD 970 EVO Plus 1TB, firmware 2B2QEXM7, serial S4EWNMFN800087M
scsibus2 at nvme0: 2 targets, initiator 0
sd5 at scsibus2 targ 1 lun 0: <NVMe, Samsung SSD 970, 2B2Q>
sd5: 953869MB, 512 bytes/sector, 1953525168 sectors
pcib0 at pci0 dev 31 function 0 "Intel Z170 LPC" rev 0x31
"Intel 100 Series PMC" rev 0x31 at pci0 dev 31 function 2 not configured
azalia0 at pci0 dev 31 function 3 "Intel 100 Series HD Audio" rev 0x31: msi
azalia0: codecs: Realtek ALC1150, Intel/0x2809, using Realtek ALC1150
audio0 at azalia0
ichiic0 at pci0 dev 31 function 4 "Intel 100 Series SMBus" rev 0x31: apic 2 int 
16
iic0 at ichiic0
admtemp0 at iic0 addr 0x18: Xeon
em0 at pci0 dev 31 function 6 "Intel I219-V" rev 0x31: msi, address 
70:4d:7b:b2:b1:e7
isa0 at pcib0
isadma0 at isa0
com0 at isa0 port 0x3f8/8 irq 4: ns16550a, 16 byte fifo
pckbc0 at isa0 port 0x60/5 irq 1 irq 12
pckbd0 at pckbc0 (kbd slot)
wskbd0 at pckbd0: console keyboard
pcppi0 at isa0 port 0x61
spkr0 at pcppi0
vmm0 at mainbus0: VMX/EPT
efifb at mainbus0 not configured
uhub2 at uhub1 port 2 configuration 1 interface 0 "Terminus Technology USB 2.0 
Hub" rev 2.00/1.11 addr 2
uhub3 at uhub2 port 1 configuration 1 interface 0 "VIA Labs USB 2.0 HUB
" rev 2.00/85.70 addr 3
uhidev0 at uhub3 port 1 configuration 1 interface 0 "ZSA Technology Labs Inc 
ErgoDox EZ Shine" rev 1.10/0.01 addr 4
uhidev0: iclass 3/1
ukbd0 at uhidev0: 8 variable keys, 6 key codes
wskbd1 at ukbd0 mux 1
uhidev1 at uhub3 port 1 configuration 1 interface 1 "ZSA Technology Labs Inc 
ErgoDox EZ Shine" rev 1.10/0.01 addr 4
uhidev1: iclass 3/0, 5 report ids
uhid0 at uhidev1 reportid 3: input=2, output=0, feature=0
uhid1 at uhidev1 reportid 4: input=2, output=0, feature=0
ukbd1 at uhidev1 reportid 5: 128 variable keys, 0 key codes
wskbd2 at ukbd1 mux 1
uvideo0 at uhub3 port 2 configuration 1 interface 0 "Logitech Logitech 
StreamCam" rev 2.10/0.17 addr 5
video0 at uvideo0
uaudio0 at uhub3 port 2 configuration 1 interface 3 "Logitech Logitech 
StreamCam" rev 2.10/0.17 addr 5
uaudio0: class v1, high-speed, sync, channels: 0 play, 2 rec, 2 ctls
audio1 at uaudio0
uhidev2 at uhub3 port 2 configuration 1 interface 5 "Logitech Logitech 
StreamCam" rev 2.10/0.17 addr 5
uhidev2: iclass 3/0, 5 report ids
uhid2 at uhidev2 reportid 1: input=1, output=0, feature=0
uhid3 at uhidev2 reportid 2: input=1, output=0, feature=0
uhid4 at uhidev2 reportid 3: input=1, output=0, feature=0
uhid5 at uhidev2 reportid 4: input=1, output=0, feature=0
uhid6 at uhidev2 reportid 5: input=1, output=0, feature=0
ugen0 at uhub3 port 2 configuration 1 "Logitech Logitech StreamCam" rev 
2.10/0.17 addr 5
uhidev3 at uhub3 port 3 configuration 1 interface 0 "MOSART Semi. 2.4G Wireless 
Mouse" rev 1.10/81.13 addr 6
uhidev3: iclass 3/1, 5 report ids
ums0 at uhidev3 reportid 3: 5 buttons, Z and W dir
wsmouse0 at ums0 mux 0
uhid7 at uhidev3 reportid 5: input=5, output=6, feature=0
uhidev4 at uhub2 port 2 configuration 1 interface 0 
"??\^D??\^A?????????\^A????\^A?6??\^E?? " rev 2.00/0.01 addr 7
uhidev4: iclass 3/1
ukbd2 at uhidev4: 8 variable keys, 6 key codes
wskbd3 at ukbd2 mux 1
uhidev5 at uhub2 port 2 configuration 1 interface 1 
"??\^D??\^A?????????\^A????\^A?6??\^E?? " rev 2.00/0.01 addr 7
uhidev5: iclass 3/1, 1 report id
ums1 at uhidev5 reportid 1: 3 buttons, Z dir
wsmouse1 at ums1 mux 0
vscsi0 at root
scsibus3 at vscsi0: 256 targets
softraid0 at root
scsibus4 at softraid0: 256 targets
root on sd5a (18c223507fa8363e.a) swap on sd5b dump on sd5b
inteldrm0: 2560x1440, 32bpp
wsdisplay0 at inteldrm0 mux 1: console (std, vt100 emulation), using wskbd0
wskbd1: connecting to wsdisplay0
wskbd2: connecting to wsdisplay0
uhidev_clear_iface_eps: clear endpoints failed!
wskbd3: connecting to wsdisplay0
wsdisplay0: screen 1-5 added (std, vt100 emulation)
uhidev_clear_iface_eps: clear endpoints failed!
uhidev_clear_iface_eps: clear endpoints failed!
uhidev_clear_iface_eps: clear endpoints failed!

Reply via email to