Unplugging USB touchpad panics kernel

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Unplugging USB touchpad panics kernel

Edd Barrett-3
Hi,

If I unplug the following device, the kernel crashes every time:
```
uhidev5 at uhub0 port 1 configuration 1 interface 0 "HAILUCK CO.,LTD Usb Touch" rev 1.10/1.00 addr 7
uhidev5: iclass 3/1
ukbd3 at uhidev5: 8 variable keys, 6 key codes
wskbd4 at ukbd3 mux 1
wskbd4: connecting to wsdisplay0
uhidev6 at uhub0 port 1 configuration 1 interface 1 "HAILUCK CO.,LTD Usb Touch" rev 1.10/1.00 addr 7
uhidev6: iclass 3/0, 189 report ids
umt0 at uhidev6: clickpad, 4 contacts
wsmouse1 at umt0 mux 0
ums1 at uhidev6 reportid 1: 5 buttons, Z and W dir
wsmouse2 at ums1 mux 0
```

I'd been using this device for a week or so prior without issue, and I
did a fair amount of plugging/unplugging when I was getting the
wsconsctl settings right. I upgraded my snapshot today, so this may be
the root of the problem, but I can't be sure. My old snapshot was a week
or two old.

I also noticed that my tapping settings stopped working with the upgrade
(wsconstctl mouse1.tp.tapping=3,1,2). That's probably another issue.

I tried different USB ports and cables just in case, but no change.

Photos of ddb info (sorry, no serial):
https://theunixzoo.co.uk/random/IMG_20210316_201134_HDR.jpg
https://theunixzoo.co.uk/random/IMG_20210316_201355_HDR.jpg
https://theunixzoo.co.uk/random/IMG_20210316_201418_HDR.jpg

(I forgot to do a `ps`. I can get that if needed. The crash is easily
reproducible).

dmesg (problem device plugged in last):
```
OpenBSD 6.9-beta (GENERIC.MP) #408: Mon Mar 15 23:47:27 MDT 2021
    [hidden email]:/usr/src/sys/arch/amd64/compile/GENERIC.MP
real mem = 25691017216 (24500MB)
avail mem = 24897015808 (23743MB)
random: good seed from bootblocks
mpath0 at root
scsibus0 at mpath0: 256 targets
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.8 @ 0xec1f0 (88 entries)
bios0: vendor American Megatrends Inc. version "1304" date 07/11/2014
bios0: ASUS All Series
acpi0 at bios0: ACPI 5.0
acpi0: sleep states S0 S3 S4 S5
acpi0: tables DSDT FACP APIC FPDT SSDT SSDT SSDT MCFG HPET SSDT SSDT
acpi0: wakeup devices PEG0(S4) PEGP(S4) PEG1(S4) PEGP(S4) PEG2(S4) PEGP(S4) RP01(S4) PXSX(S4) PXSX(S4) PXSX(S4) RP05(S4) PXSX(S4) PXSX(S4) PXSX(S4) PXSX(S4) RP04(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-4790K CPU @ 4.00GHz, 3998.23 MHz, 06-3c-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,PERF,ITSC,FSGSBASE,TSC_ADJUST,BMI1,AVX2,SMEP,BMI2,ERMS,INVPCID,SRBDS_CTRL,MD_CLEAR,IBRS,IBPB,STIBP,L1DF,SSBD,SENSOR,ARAT,XSAVEOPT,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 99MHz
cpu0: mwait min=64, max=64, C-substates=0.2.1.2.4, IBE
cpu1 at mainbus0: apid 2 (application processor)
cpu1: Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz, 3997.69 MHz, 06-3c-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,PERF,ITSC,FSGSBASE,TSC_ADJUST,BMI1,AVX2,SMEP,BMI2,ERMS,INVPCID,SRBDS_CTRL,MD_CLEAR,IBRS,IBPB,STIBP,L1DF,SSBD,SENSOR,ARAT,XSAVEOPT,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-4790K CPU @ 4.00GHz, 3997.70 MHz, 06-3c-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,PERF,ITSC,FSGSBASE,TSC_ADJUST,BMI1,AVX2,SMEP,BMI2,ERMS,INVPCID,SRBDS_CTRL,MD_CLEAR,IBRS,IBPB,STIBP,L1DF,SSBD,SENSOR,ARAT,XSAVEOPT,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-4790K CPU @ 4.00GHz, 3997.69 MHz, 06-3c-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,PERF,ITSC,FSGSBASE,TSC_ADJUST,BMI1,AVX2,SMEP,BMI2,ERMS,INVPCID,SRBDS_CTRL,MD_CLEAR,IBRS,IBPB,STIBP,L1DF,SSBD,SENSOR,ARAT,XSAVEOPT,MELTDOWN
cpu3: 256KB 64b/line 8-way L2 cache
cpu3: smt 0, core 3, package 0
ioapic0 at mainbus0: apid 8 pa 0xfec00000, version 20, 24 pins
acpimcfg0 at acpi0
acpimcfg0: addr 0xe0000000, bus 0-255
acpihpet0 at acpi0: 14318179 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 2 (RP01)
acpiprt5 at acpi0: bus 9 (RP05)
acpiprt6 at acpi0: bus 3 (RP04)
acpiec0 at acpi0
acpiec at acpi0 not configured
acpipci0 at acpi0 PCI0: 0x00000010 0x00000011 0x00000000
acpicmos0 at acpi0
"PNP0C14" at acpi0 not configured
"INT33CA" at acpi0 not configured
acpibtn0 at acpi0: PWRB
"PNP0C0B" at acpi0 not configured
"PNP0C0B" at acpi0 not configured
"PNP0C0B" at acpi0 not configured
"PNP0C0B" at acpi0 not configured
"PNP0C0B" at acpi0 not configured
"PNP0A0A" at acpi0 not configured
"PNP0C14" at acpi0 not configured
acpicpu0 at acpi0: C2(200@148 mwait.1@0x33), C1(1000@1 mwait.1), PSS
acpicpu1 at acpi0: C2(200@148 mwait.1@0x33), C1(1000@1 mwait.1), PSS
acpicpu2 at acpi0: C2(200@148 mwait.1@0x33), C1(1000@1 mwait.1), PSS
acpicpu3 at acpi0: C2(200@148 mwait.1@0x33), C1(1000@1 mwait.1), 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: FN00, resource for FAN0
acpipwrres4 at acpi0: FN01, resource for FAN1
acpipwrres5 at acpi0: FN02, resource for FAN2
acpipwrres6 at acpi0: FN03, resource for FAN3
acpipwrres7 at acpi0: FN04, resource for FAN4
acpitz0 at acpi0: critical temperature is 105 degC
acpitz1 at acpi0: critical temperature is 105 degC
acpivideo0 at acpi0: GFX0
acpivout0 at acpivideo0: DD1F
cpu0: using VERW MDS workaround (except on vmm entry)
cpu0: Enhanced SpeedStep 3998 MHz: speeds: 4000, 3800, 3600, 3400, 3100, 2900, 2700, 2500, 2300, 2100, 1900, 1700, 1400, 1200, 1000, 800 MHz
pci0 at mainbus0 bus 0
pchb0 at pci0 dev 0 function 0 "Intel Core 4G Host" rev 0x06
ppb0 at pci0 dev 1 function 0 "Intel Core 4G PCIE" rev 0x06: msi
pci1 at ppb0 bus 1
radeondrm0 at pci1 dev 0 function 0 "ATI Radeon HD 6970" rev 0x00
drm0 at radeondrm0
radeondrm0: msi
azalia0 at pci1 dev 0 function 1 vendor "ATI", unknown product 0xaa80 rev 0x00: msi
azalia0: no supported codecs
xhci0 at pci0 dev 20 function 0 "Intel 9 Series xHCI" rev 0x00: 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 9 Series MEI" rev 0x00 at pci0 dev 22 function 0 not configured
em0 at pci0 dev 25 function 0 "Intel I218-V" rev 0x00: msi, address 40:16:7e:e9:03:b5
ehci0 at pci0 dev 26 function 0 "Intel 9 Series USB" rev 0x00: apic 8 int 16
usb1 at ehci0: USB revision 2.0
uhub1 at usb1 configuration 1 interface 0 "Intel EHCI root hub" rev 2.00/1.00 addr 1
azalia1 at pci0 dev 27 function 0 "Intel 9 Series HD Audio" rev 0x00: msi
azalia1: codecs: Realtek ALC1150
audio0 at azalia1
ppb1 at pci0 dev 28 function 0 "Intel 9 Series PCIE" rev 0xd0
pci2 at ppb1 bus 2
ppb2 at pci0 dev 28 function 3 "Intel 9 Series PCIE" rev 0xd0: msi
pci3 at ppb2 bus 3
ppb3 at pci3 dev 0 function 0 "ASMedia ASM1184e" rev 0x00
pci4 at ppb3 bus 4
ppb4 at pci4 dev 1 function 0 "ASMedia ASM1184e" rev 0x00: msi
pci5 at ppb4 bus 5
ppb5 at pci4 dev 3 function 0 "ASMedia ASM1184e" rev 0x00: msi
pci6 at ppb5 bus 6
re0 at pci6 dev 0 function 0 "Realtek 8168" rev 0x11: RTL8168G/8111G (0x4c00), msi, address 10:c3:7b:96:21:4d
rgephy0 at re0 phy 7: RTL8251 PHY, rev. 0
ppb6 at pci4 dev 5 function 0 "ASMedia ASM1184e" rev 0x00: msi
pci7 at ppb6 bus 7
ppb7 at pci4 dev 7 function 0 "ASMedia ASM1184e" rev 0x00: msi
pci8 at ppb7 bus 8
ahci0 at pci8 dev 0 function 0 "ASMedia ASM1061 AHCI" rev 0x02: msi, AHCI 1.2
ahci0: port 1: 6.0Gb/s
scsibus1 at ahci0: 32 targets
sd0 at scsibus1 targ 1 lun 0: <ATA, WDC WD5000AZRX-0, 01.0> naa.50014ee602c6503e
sd0: 476940MB, 512 bytes/sector, 976773168 sectors
ppb8 at pci0 dev 28 function 4 "Intel 9 Series PCIE" rev 0xd0: msi
pci9 at ppb8 bus 9
xhci1 at pci9 dev 0 function 0 "ASMedia ASM1042A xHCI" rev 0x00: msi, xHCI 1.0
usb2 at xhci1: USB revision 3.0
uhub2 at usb2 configuration 1 interface 0 "ASMedia xHCI root hub" rev 3.00/1.00 addr 1
ehci1 at pci0 dev 29 function 0 "Intel 9 Series USB" rev 0x00: apic 8 int 23
usb3 at ehci1: USB revision 2.0
uhub3 at usb3 configuration 1 interface 0 "Intel EHCI root hub" rev 2.00/1.00 addr 1
pcib0 at pci0 dev 31 function 0 "Intel Z97 LPC" rev 0x00
ahci1 at pci0 dev 31 function 2 "Intel 9 Series AHCI" rev 0x00: msi, AHCI 1.3
ahci1: port 0: 6.0Gb/s
scsibus2 at ahci1: 32 targets
sd1 at scsibus2 targ 0 lun 0: <ATA, Crucial_CT275MX3, M0C> naa.500a075114981e4a
sd1: 262321MB, 512 bytes/sector, 537234768 sectors, thin
ichiic0 at pci0 dev 31 function 3 "Intel 9 Series SMBus" rev 0x00: apic 8 int 18
iic0 at ichiic0
spdmem0 at iic0 addr 0x50: 8GB DDR3 SDRAM PC3-12800
spdmem1 at iic0 addr 0x51: 8GB DDR3 SDRAM PC3-12800
spdmem2 at iic0 addr 0x52: 8GB DDR3 SDRAM PC3-12800
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
pcppi0 at isa0 port 0x61
spkr0 at pcppi0
wbsio0 at isa0 port 0x2e/2: NCT6791D rev 0x03
wbsio0 port 0x290/2 not configured
vmm0 at mainbus0: VMX/EPT
uhub4 at uhub0 port 9 configuration 1 interface 0 "GenesysLogic USB2.0 Hub" rev 2.10/92.26 addr 2
uvideo0 at uhub4 port 2 configuration 1 interface 0 "Logitech HD Pro Webcam C920" rev 2.00/0.19 addr 3
video0 at uvideo0
uaudio0 at uhub4 port 2 configuration 1 interface 3 "Logitech HD Pro Webcam C920" rev 2.00/0.19 addr 3
uaudio0: class v1, high-speed, sync, channels: 0 play, 2 rec, 2 ctls
audio1 at uaudio0
uhidev0 at uhub4 port 3 configuration 1 interface 0 "Microchip Technology Inc. Keyboard Demo" rev 2.00/0.01 addr 4
uhidev0: iclass 3/1, 2 report ids
ukbd0 at uhidev0 reportid 1: 8 variable keys, 6 key codes
wskbd1 at ukbd0 mux 1
uhid0 at uhidev0 reportid 2: input=2, output=0, feature=0
uhidev1 at uhub4 port 4 configuration 1 interface 0 "Logitech G300s Optical Gaming Mouse" rev 2.00/70.03 addr 5
uhidev1: iclass 3/1
ums0 at uhidev1: 16 buttons, Z dir
wsmouse0 at ums0 mux 0
uhidev2 at uhub4 port 4 configuration 1 interface 1 "Logitech G300s Optical Gaming Mouse" rev 2.00/70.03 addr 5
uhidev2: iclass 3/0, 245 report ids
ukbd1 at uhidev2 reportid 1: 8 variable keys, 5 key codes
wskbd2 at ukbd1 mux 1
uhid1 at uhidev2 reportid 128: input=4, output=0, feature=0
uhid2 at uhidev2 reportid 240: input=0, output=0, feature=3
uhid3 at uhidev2 reportid 241: input=0, output=0, feature=1
uhid4 at uhidev2 reportid 242: input=0, output=0, feature=1
uhid5 at uhidev2 reportid 243: input=0, output=0, feature=34
uhid6 at uhidev2 reportid 244: input=0, output=0, feature=34
uhid7 at uhidev2 reportid 245: input=0, output=0, feature=34
uhub5 at uhub0 port 20 configuration 1 interface 0 "GenesysLogic USB3.1 Hub" rev 3.10/92.26 addr 6
uhub6 at uhub1 port 1 configuration 1 interface 0 "Intel Rate Matching Hub" rev 2.00/0.00 addr 2
uhub7 at uhub2 port 2 configuration 1 interface 0 "Generic 4-Port USB 3.1 Hub" rev 3.20/1.27 addr 2
uhub8 at uhub2 port 4 configuration 1 interface 0 "Generic 4-Port USB 2.1 Hub" rev 2.10/1.27 addr 3
uhidev3 at uhub8 port 1 configuration 1 interface 0 "Yubico Yubikey 4 OTP+U2F+CCID" rev 2.00/4.34 addr 4
uhidev3: iclass 3/1
ukbd2 at uhidev3: 8 variable keys, 6 key codes
wskbd3 at ukbd2 mux 1
uhidev4 at uhub8 port 1 configuration 1 interface 1 "Yubico Yubikey 4 OTP+U2F+CCID" rev 2.00/4.34 addr 4
uhidev4: iclass 3/0
fido0 at uhidev4: input=64, output=64, feature=0
ugen0 at uhub8 port 1 configuration 1 "Yubico Yubikey 4 OTP+U2F+CCID" rev 2.00/4.34 addr 4
uhub9 at uhub3 port 1 configuration 1 interface 0 "Intel Rate Matching Hub" rev 2.00/0.00 addr 2
vscsi0 at root
scsibus3 at vscsi0: 256 targets
softraid0 at root
scsibus4 at softraid0: 256 targets
softraid0: sd2 was not shutdown properly
sd2 at scsibus4 targ 1 lun 0: <OPENBSD, SR CRYPTO, 006>
sd2: 262318MB, 512 bytes/sector, 537229073 sectors
root on sd2a (e753a9953067adaf.a) swap on sd2b dump on sd2b
WARNING: / was not properly unmounted
radeondrm0: CAYMAN
radeondrm0: 1920x1080, 32bpp
wsdisplay0 at radeondrm0 mux 1: console (std, vt100 emulation), using wskbd0
wskbd1: connecting to wsdisplay0
wskbd2: connecting to wsdisplay0
wskbd3: connecting to wsdisplay0
wsdisplay0: screen 1-5 added (std, vt100 emulation)
wsmouse0 detached
ums0 detached
uhidev1 detached
wskbd2: disconnecting from wsdisplay0
wskbd2 detached
ukbd1 detached
uhid1 detached
uhid2 detached
uhid3 detached
uhid4 detached
uhid5 detached
uhid6 detached
uhid7 detached
uhidev2 detached
uhidev1 at uhub4 port 4 configuration 1 interface 0 "Logitech G300s Optical Gaming Mouse" rev 2.00/70.03 addr 5
uhidev1: iclass 3/1
ums0 at uhidev1: 16 buttons, Z dir
wsmouse0 at ums0 mux 0
uhidev2 at uhub4 port 4 configuration 1 interface 1 "Logitech G300s Optical Gaming Mouse" rev 2.00/70.03 addr 5
uhidev2: iclass 3/0, 245 report ids
ukbd1 at uhidev2 reportid 1: 8 variable keys, 5 key codes
wskbd2 at ukbd1 mux 1
wskbd2: connecting to wsdisplay0
uhid1 at uhidev2 reportid 128: input=4, output=0, feature=0
uhid2 at uhidev2 reportid 240: input=0, output=0, feature=3
uhid3 at uhidev2 reportid 241: input=0, output=0, feature=1
uhid4 at uhidev2 reportid 242: input=0, output=0, feature=1
uhid5 at uhidev2 reportid 243: input=0, output=0, feature=34
uhid6 at uhidev2 reportid 244: input=0, output=0, feature=34
uhid7 at uhidev2 reportid 245: input=0, output=0, feature=34
uhidev5 at uhub0 port 1 configuration 1 interface 0 "HAILUCK CO.,LTD Usb Touch" rev 1.10/1.00 addr 7
uhidev5: iclass 3/1
ukbd3 at uhidev5: 8 variable keys, 6 key codes
wskbd4 at ukbd3 mux 1
wskbd4: connecting to wsdisplay0
uhidev6 at uhub0 port 1 configuration 1 interface 1 "HAILUCK CO.,LTD Usb Touch" rev 1.10/1.00 addr 7
uhidev6: iclass 3/0, 189 report ids
umt0 at uhidev6: clickpad, 4 contacts
wsmouse1 at umt0 mux 0
ums1 at uhidev6 reportid 1: 5 buttons, Z and W dir
wsmouse2 at ums1 mux 0
uhid8 at uhidev6 reportid 3: input=3, output=0, feature=0
uhid9 at uhidev6 reportid 5: input=0, output=0, feature=5
uhid10 at uhidev6 reportid 8: input=1, output=0, feature=0
uhid11 at uhidev6 reportid 32: input=0, output=0, feature=255
uhid12 at uhidev6 reportid 35: input=0, output=0, feature=1
uhid13 at uhidev6 reportid 37: input=0, output=0, feature=1
uhid14 at uhidev6 reportid 188: input=0, output=0, feature=7
uhid15 at uhidev6 reportid 189: input=0, output=0, feature=135
```

Thanks

--
Best Regards
Edd Barrett

http://www.theunixzoo.co.uk

Reply | Threaded
Open this post in threaded view
|

Re: Unplugging USB touchpad panics kernel

Anton Lindqvist-2
On Tue, Mar 16, 2021 at 08:46:27PM +0000, Edd Barrett wrote:

> Hi,
>
> If I unplug the following device, the kernel crashes every time:
> ```
> uhidev5 at uhub0 port 1 configuration 1 interface 0 "HAILUCK CO.,LTD Usb Touch" rev 1.10/1.00 addr 7
> uhidev5: iclass 3/1
> ukbd3 at uhidev5: 8 variable keys, 6 key codes
> wskbd4 at ukbd3 mux 1
> wskbd4: connecting to wsdisplay0
> uhidev6 at uhub0 port 1 configuration 1 interface 1 "HAILUCK CO.,LTD Usb Touch" rev 1.10/1.00 addr 7
> uhidev6: iclass 3/0, 189 report ids
> umt0 at uhidev6: clickpad, 4 contacts
> wsmouse1 at umt0 mux 0
> ums1 at uhidev6 reportid 1: 5 buttons, Z and W dir
> wsmouse2 at ums1 mux 0
> ```
>
> I'd been using this device for a week or so prior without issue, and I
> did a fair amount of plugging/unplugging when I was getting the
> wsconsctl settings right. I upgraded my snapshot today, so this may be
> the root of the problem, but I can't be sure. My old snapshot was a week
> or two old.
>
> I also noticed that my tapping settings stopped working with the upgrade
> (wsconstctl mouse1.tp.tapping=3,1,2). That's probably another issue.
>
> I tried different USB ports and cables just in case, but no change.
>
> Photos of ddb info (sorry, no serial):
> https://theunixzoo.co.uk/random/IMG_20210316_201134_HDR.jpg
> https://theunixzoo.co.uk/random/IMG_20210316_201355_HDR.jpg
> https://theunixzoo.co.uk/random/IMG_20210316_201418_HDR.jpg
>
> (I forgot to do a `ps`. I can get that if needed. The crash is easily
> reproducible).

Does reverting the following commit get rid of the panic?

  commit f31b43ced9cf4cbf056e9d8aceb4fa40a73e00cd
  Author: jcs <[hidden email]>
  Date:   Mon Mar 8 14:35:57 2021 +0000

      Allow uhidev child devices to claim selective report ids
     
      There may be multiple matching devices on a single uhidev device but
      the first device that responds to UHIDEV_CLAIM_ALLREPORTID will
      block the others from attaching.
     
      Change this to UHIDEV_CLAIM_MULTIPLE_REPORTID and require any
      devices wanting some/all report ids to fill in the claimed array in
      uhidev_attach_arg with just the reports it needs.  uhidev can then
      run match routines for other drivers with the available report ids.
     
      ok anton

I'm wondering if the umt device is detached more than once since it
claims multiple report ids. I ran into the same problem while developing
uhidpp:

  https://github.com/openbsd/src/blob/master/sys/dev/usb/uhidpp.c#L437-L443

Also, the output of `show registers` in ddb would be helpful.

Reply | Threaded
Open this post in threaded view
|

Re: Unplugging USB touchpad panics kernel

Edd Barrett-3
Hi Anton,

On Wed, Mar 17, 2021 at 07:41:53AM +0100, Anton Lindqvist wrote:
> Does reverting the following commit get rid of the panic?
>
>   commit f31b43ced9cf4cbf056e9d8aceb4fa40a73e00cd
>   Author: jcs <[hidden email]>
>   Date:   Mon Mar 8 14:35:57 2021 +0000

Good call!

Reverting this fixes both the kernel crash and the mouse.tp.tapping
issue I mentioned.

> Registers...

https://theunixzoo.co.uk/random/IMG_20210317_114802_HDR.jpg

I hope we can find a fix or a workaround.

--
Best Regards
Edd Barrett

http://www.theunixzoo.co.uk

Reply | Threaded
Open this post in threaded view
|

Re: Unplugging USB touchpad panics kernel

joshua stein
In reply to this post by Anton Lindqvist-2
On Wed, 17 Mar 2021 at 07:41:53 +0100, Anton Lindqvist wrote:
> I'm wondering if the umt device is detached more than once since it
> claims multiple report ids. I ran into the same problem while developing
> uhidpp:
>
>   https://github.com/openbsd/src/blob/master/sys/dev/usb/uhidpp.c#L437-L443
>
> Also, the output of `show registers` in ddb would be helpful.
>

Something like this is probably needed (maybe also for
uhidev_activate):


diff --git sys/dev/usb/uhidev.c sys/dev/usb/uhidev.c
index d777cfb6e45..86231615432 100644
--- sys/dev/usb/uhidev.c
+++ sys/dev/usb/uhidev.c
@@ -403,7 +403,7 @@ int
 uhidev_detach(struct device *self, int flags)
 {
  struct uhidev_softc *sc = (struct uhidev_softc *)self;
- int i, rv = 0;
+ int i, j, rv = 0;
 
  DPRINTF(("uhidev_detach: sc=%p flags=%d\n", sc, flags));
 
@@ -420,19 +420,19 @@ uhidev_detach(struct device *self, int flags)
  if (sc->sc_repdesc != NULL)
  free(sc->sc_repdesc, M_USBDEV, sc->sc_repdesc_size);
 
- /*
- * XXX Check if we have only one children claiming all the Report
- * IDs, this is a hack since we need a dev -> Report ID mapping
- * for uhidev_intr().
- */
- if (sc->sc_nrepid > 1 && sc->sc_subdevs[0] != NULL &&
-    sc->sc_subdevs[0] == sc->sc_subdevs[1])
- return (config_detach(&sc->sc_subdevs[0]->sc_dev, flags));
-
  for (i = 0; i < sc->sc_nrepid; i++) {
- if (sc->sc_subdevs[i] != NULL) {
- rv |= config_detach(&sc->sc_subdevs[i]->sc_dev, flags);
- sc->sc_subdevs[i] = NULL;
+ if (sc->sc_subdevs[i] == NULL)
+ continue;
+
+ rv |= config_detach(&sc->sc_subdevs[i]->sc_dev, flags);
+
+ /*
+ * Nullify without detaching any other instances of this device
+ * found on other report ids
+ */
+ for (j = 0; j < sc->sc_nrepid; j++) {
+ if (sc->sc_subdevs[i] == sc->sc_subdevs[j])
+ sc->sc_subdevs[j] = NULL;
  }
  }
 

Reply | Threaded
Open this post in threaded view
|

Re: Unplugging USB touchpad panics kernel

joshua stein
On Wed, 17 Mar 2021 at 09:19:05 -0500, joshua stein wrote:

> On Wed, 17 Mar 2021 at 07:41:53 +0100, Anton Lindqvist wrote:
> > I'm wondering if the umt device is detached more than once since it
> > claims multiple report ids. I ran into the same problem while developing
> > uhidpp:
> >
> >   https://github.com/openbsd/src/blob/master/sys/dev/usb/uhidpp.c#L437-L443
> >
> > Also, the output of `show registers` in ddb would be helpful.
> >
>
> Something like this is probably needed (maybe also for
> uhidev_activate):

Here's an updated version with feedback from Anton and a similar fix
for uhidev_activate.

Edd, can you test whether this fixes the panic for you and if
possible, if the machine suspends/resumes properly with the touchpad
attached (if it did before)?


diff --git sys/dev/usb/uhidev.c sys/dev/usb/uhidev.c
index d777cfb6e45..dd43b1bb000 100644
--- sys/dev/usb/uhidev.c
+++ sys/dev/usb/uhidev.c
@@ -382,17 +382,32 @@ int
 uhidev_activate(struct device *self, int act)
 {
  struct uhidev_softc *sc = (struct uhidev_softc *)self;
- int i, rv = 0, r;
+ int i, j, already, rv = 0, r;
 
  switch (act) {
  case DVACT_DEACTIVATE:
- for (i = 0; i < sc->sc_nrepid; i++)
- if (sc->sc_subdevs[i] != NULL) {
+ for (i = 0; i < sc->sc_nrepid; i++) {
+ if (sc->sc_subdevs[i] == NULL)
+ continue;
+
+ /*
+ * Only notify devices attached to multiple report ids
+ * once.
+ */
+ for (already = 0, j = 0; j < i; j++) {
+ if (sc->sc_subdevs[i] == sc->sc_subdevs[j]) {
+ already = 1;
+ break;
+ }
+ }
+
+ if (!already) {
  r = config_deactivate(
     &sc->sc_subdevs[i]->sc_dev);
  if (r && r != EOPNOTSUPP)
  rv = r;
  }
+ }
  usbd_deactivate(sc->sc_udev);
  break;
  }
@@ -403,7 +418,7 @@ int
 uhidev_detach(struct device *self, int flags)
 {
  struct uhidev_softc *sc = (struct uhidev_softc *)self;
- int i, rv = 0;
+ int i, j, rv = 0;
 
  DPRINTF(("uhidev_detach: sc=%p flags=%d\n", sc, flags));
 
@@ -420,19 +435,20 @@ uhidev_detach(struct device *self, int flags)
  if (sc->sc_repdesc != NULL)
  free(sc->sc_repdesc, M_USBDEV, sc->sc_repdesc_size);
 
- /*
- * XXX Check if we have only one children claiming all the Report
- * IDs, this is a hack since we need a dev -> Report ID mapping
- * for uhidev_intr().
- */
- if (sc->sc_nrepid > 1 && sc->sc_subdevs[0] != NULL &&
-    sc->sc_subdevs[0] == sc->sc_subdevs[1])
- return (config_detach(&sc->sc_subdevs[0]->sc_dev, flags));
-
  for (i = 0; i < sc->sc_nrepid; i++) {
- if (sc->sc_subdevs[i] != NULL) {
- rv |= config_detach(&sc->sc_subdevs[i]->sc_dev, flags);
- sc->sc_subdevs[i] = NULL;
+ if (sc->sc_subdevs[i] == NULL)
+ continue;
+
+ rv |= config_detach(&sc->sc_subdevs[i]->sc_dev, flags);
+ sc->sc_subdevs[i] = NULL;
+
+ /*
+ * Nullify without detaching any other instances of this device
+ * found on other report ids.
+ */
+ for (j = i + 1; j < sc->sc_nrepid; j++) {
+ if (sc->sc_subdevs[i] == sc->sc_subdevs[j])
+ sc->sc_subdevs[j] = NULL;
  }
  }
 

Reply | Threaded
Open this post in threaded view
|

Re: Unplugging USB touchpad panics kernel

Edd Barrett-3
On Wed, Mar 17, 2021 at 12:00:44PM -0500, joshua stein wrote:
> Here's an updated version with feedback from Anton and a similar fix
> for uhidev_activate.
>
> Edd, can you test whether this fixes the panic for you and if
> possible, if the machine suspends/resumes properly with the touchpad
> attached (if it did before)?

I just tested your first diff. Result: still crashes, tapping not
working.

I'll test your revised diff now.

--
Best Regards
Edd Barrett

http://www.theunixzoo.co.uk

Reply | Threaded
Open this post in threaded view
|

Re: Unplugging USB touchpad panics kernel

Edd Barrett-3
On Wed, Mar 17, 2021 at 05:11:58PM +0000, Edd Barrett wrote:
> I just tested your first diff. Result: still crashes, tapping not
> working.

^ Ignore this. I don't think I applied the diff right.

> I'll test your revised diff now.

Now on to the revised diff.

The device attaches and I see it in dmesg, but it doesn't function at
all now.

Unplugging it still crashes the kernel.

(I didn't try suspend yet as I'd like to minimise fscks. boot sync
doesn't work in ddb it seems).

--
Best Regards
Edd Barrett

http://www.theunixzoo.co.uk