Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Mar 2019 16:49:20 -0400
From:      Mike Tancsa <mike@sentex.net>
To:        freebsd-usb@FreeBSD.org
Subject:   strange USB timing issue with u3g
Message-ID:  <3377e001-f035-acec-765c-aee7113f20d4@sentex.net>

next in thread | raw e-mail | index | archive | help
I have a strange issue I started to see on RELENG11 and RELENG12 that I
am not sure when it started or if its always been there.=C2=A0 On an
PCEngines APU3, with an LTE modem that works with the u3g driver, it
will fail to attach if the box does not boot up fast enough. So I am
guessing something gets messed up in initialization and timing ?

e.g. in loader.conf I have

autoboot_delay=3D2
dcons_load=3D"YES"
amdsbwd_load=3D"YES"
u3g_load=3D"YES"
beastie_disable=3D"YES"
comconsole_speed=3D"115200"
console=3D"comconsole"
#hw.usb.debug=3D1


If I pause at the boot or make the delay say 10 seconds, the device
often errors out. The device normally looks like this

ugen2.1: <AMD EHCI root HUB> at usbus2, cfg=3D0 md=3DHOST spd=3DHIGH (480=
Mbps)
pwr=3DSAVE (0mA)
ugen1.1: <AMD EHCI root HUB> at usbus1, cfg=3D0 md=3DHOST spd=3DHIGH (480=
Mbps)
pwr=3DSAVE (0mA)
ugen0.1: <0x1022 XHCI root HUB> at usbus0, cfg=3D0 md=3DHOST spd=3DSUPER
(5.0Gbps) pwr=3DSAVE (0mA)
ugen2.2: <vendor 0x0438 product 0x7900> at usbus2, cfg=3D0 md=3DHOST
spd=3DHIGH (480Mbps) pwr=3DSAVE (100mA)
ugen1.2: <vendor 0x0438 product 0x7900> at usbus1, cfg=3D0 md=3DHOST
spd=3DHIGH (480Mbps) pwr=3DSAVE (100mA)
ugen2.3: <HUAWEI Technology HUAWEI Mobile> at usbus2, cfg=3D0 md=3DHOST
spd=3DFULL (12Mbps) pwr=3DON (500mA)

ugen2.3: <HUAWEI Technology HUAWEI Mobile> at usbus2, cfg=3D0 md=3DHOST
spd=3DFULL (12Mbps) pwr=3DON (500mA)

=C2=A0 bLength =3D 0x0012
=C2=A0 bDescriptorType =3D 0x0001
=C2=A0 bcdUSB =3D 0x0200
=C2=A0 bDeviceClass =3D 0x0000=C2=A0 <Probed by interface class>
=C2=A0 bDeviceSubClass =3D 0x0000
=C2=A0 bDeviceProtocol =3D 0x0000
=C2=A0 bMaxPacketSize0 =3D 0x0040
=C2=A0 idVendor =3D 0x12d1
=C2=A0 idProduct =3D 0x1573
=C2=A0 bcdDevice =3D 0x0228
=C2=A0 iManufacturer =3D 0x0002=C2=A0 <HUAWEI Technology>
=C2=A0 iProduct =3D 0x0003=C2=A0 <HUAWEI Mobile>
=C2=A0 iSerialNumber =3D 0x0004=C2=A0 <0123456712ABCA17>
=C2=A0 bNumConfigurations =3D 0x0003


But about 50% of the time with a longer delay, at bootup time I get

uhub4: 4 ports with 4 removable, self powered
usb_alloc_device: set address 3 failed (USB_ERR_STALLED, ignored)
usbd_setup_device_desc: getting device descriptor at addr 3 failed,
USB_ERR_STALLED
usbd_req_re_enumerate: addr=3D3, set address failed! (USB_ERR_STALLED,
ignored)
usbd_setup_device_desc: getting device descriptor at addr 3 failed,
USB_ERR_STALLED
usbd_req_re_enumerate: addr=3D3, set address failed! (USB_ERR_STALLED,
ignored)
usbd_setup_device_desc: getting device descriptor at addr 3 failed,
USB_ERR_STALLED


vs

ugen0.1: <0x1022 XHCI root HUB> at usbus0
ugen1.1: <AMD EHCI root HUB> at usbus1
ugen2.1: <AMD EHCI root HUB> at usbus2
uhub0: <0x1022 XHCI root HUB, class 9/0, rev 3.00/1.00, addr 1> on usbus0=

uhub1: <AMD EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus1
uhub2: <AMD EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus2
mmcsd0: 4GB <SDHC SD04G 3.0 SN 014883B2 MFG 02/2018 by 39 PH> at mmc0
50.0MHz/4bit/65535-block
Trying to mount root from ufs:/dev/mmcsd0s1a [ro]...
uhub0: 4 ports with 4 removable, self powered
uhub1: 2 ports with 2 removable, self powered
uhub2: 2 ports with 2 removable, self powered
Starting file system checks:
/dev/mmcsd0s1a: FILE SYSTEM CLEAN; SKIPPING CHECKS
/dev/mmcsd0s1a: clean, 386561 free (3113 frags, 47931 blocks, 0.1%
fragmentation)
ugen1.2: <vendor 0x0438 product 0x7900> at usbus1
uhub3 on uhub1
uhub3: <vendor 0x0438 product 0x7900, class 9/0, rev 2.00/0.18, addr 2>
on usbus1
ugen2.2: <vendor 0x0438 product 0x7900> at usbus2
uhub4 on uhub2
uhub4: <vendor 0x0438 product 0x7900, class 9/0, rev 2.00/0.18, addr 2>
on usbus2
/dev/mmcsd0s3: FILE SYSTEM CLEAN; SKIPPING CHECKS
/dev/mmcsd0s3: clean, 2829 free (21 frags, 351 blocks, 0.7% fragmentation=
)
/etc/rc: WARNING: hostid: unable to figure out a UUID from DMI data,
generating a new one
uhub3: 4 ports with 4 removable, self powered
uhub4: 4 ports with 4 removable, self powered
ugen2.3: <HUAWEI Technology HUAWEI Mobile> at usbus2
u3g0 on uhub4
u3g0: <HUAWEI Technology HUAWEI Mobile, class 0/0, rev 2.00/2.28, addr
3> on usbus2
u3g0: Found 5 ports.


Enabling debug will make it fail.=C2=A0 Any idea what it might be or how =
I
can tweak it to it more reliably initializes ? I first start to notice
it when I added a few more klds at boot time. This made the boot up
process that much longer that I would run into this issue periodically.

=C2=A0=C2=A0=C2=A0 ---Mike






--=20
-------------------
Mike Tancsa, tel +1 519 651 3400 x203
Sentex Communications, mike@sentex.net
Providing Internet services since 1994 www.sentex.net
Cambridge, Ontario Canada  =20





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3377e001-f035-acec-765c-aee7113f20d4>