On 10/02/19(Sun) 10:25, Florian Obser wrote:
> on resume I was greeted by:
> [typed from a photo (http://sha256.net/dump/usbd_fill_deviceinfo.jpg)]
> kernel: page fault trap, code =0
> Stopped at strlcpy+0x35: movzbl 0(%rsi, %rax,1), %ecx
> strlcpy(ffff800001459c81,0,7f) at strlcpy+0x35
> usbd_fill_deviceinfo at usbd_fill_deviceinfo+0x4f
> usbioctl at usbioctl+0x409
> VOP_IOCTL at VOP_IOCTL+0x61
> vn_ioctl at vn_ioctl+0x6e
> sys_ioctl at sys_ioctl+0x3d5
> syscall at syscall+0x338
> Xsyscall(6,36,4,36,3,0) at Xsyscall+0x128
>
> I have a suspicion that this is related to my external monitor that
> acts as a usb hub. Upon wake up I also turn on the monitor and then
> random usb devices show up.
Looks like a race. Does the diff below help?
Index: usb_subr.c
===================================================================
RCS file: /cvs/src/sys/dev/usb/usb_subr.c,v
retrieving revision 1.147
diff -u -p -r1.147 usb_subr.c
--- usb_subr.c 22 Jan 2019 14:25:56 -0000 1.147
+++ usb_subr.c 10 Feb 2019 17:52:26 -0000
@@ -1208,7 +1208,6 @@ usbd_new_device(struct device *parent, s
* address does not correspond to the hardware one.
*/
dev->address = addr;
- bus->devices[addr] = dev;
err = usbd_reload_device_desc(dev);
if (err) {
@@ -1244,6 +1243,8 @@ usbd_new_device(struct device *parent, s
up->device = NULL;
return (err);
}
+
+ bus->devices[addr] = dev;
err = usbd_probe_and_attach(parent, dev, port, addr);
if (err) {