Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 7 Aug 2009 15:43:11 +0200
From:      Lucius Windschuh <lwindschuh@googlemail.com>
To:        Hans Petter Selasky <hselasky@c2i.net>, freebsd-usb@freebsd.org
Subject:   Re: reattach 3g0 device: could not allocate new device
Message-ID:  <90a5caac0908070643v79af69b7s85fc5432da148701@mail.gmail.com>
In-Reply-To: <200908070835.47320.hselasky@c2i.net>
References:  <89dbfdc30902231031j4407614vdce09e8e58cdc346@mail.gmail.com> <200908061546.38885.hselasky@c2i.net> <90a5caac0908061438n7afa69eai323164fd51b55122@mail.gmail.com> <200908070835.47320.hselasky@c2i.net>

next in thread | previous in thread | raw e-mail | index | archive | help

2009/8/7 Hans Petter Selasky <hselasky@c2i.net>:
>
> Could you edit:
> src/sys/dev/usb/usb_msctest.c
>
> And add a pause("TEST", 2*hz) after "if (do_eject)" and before the eject
> command ?

I changes usb_msctest.c to this:
...
    if (sid_type == 0x05) {
      /* CD-ROM */
      if (do_eject) {
        pause("TEST", 2*hz);
...

but it didn't work:


$ kldload u3g

(insert UMTS dongle)

dmesg:

Sleeping on "TEST" with the following non-sleepable locks held:
exclusive sleep mutex USB autoinstall (USB autoinstall) r = 0
(0xc7196a00) locked @ /usr/src/sys/dev/usb/usb_msctest.c:536
KDB: stack backtrace:
(backtrace)
--- trap 0, eip = 0, esp = 0xf3f46d70, ebp = 0 ---

(2 seconds sleep here)

usb_test_autoinstall:572: Eject CD command status: USB_ERR_NORMAL_COMPLETION
usb_alloc_device:1781: Found Huawei auto-install disk!
ugen0.3: <Novatel Wireless> at usbus0
ugen0.3: <Novatel Wireless> at usbus0 (disconnected)
uhub_reattach_port:440: could not allocate new device!


Next try:
--- /usr/src/sys/dev/usb/usb_msctest.c  (revision 196074)
+++ /usr/src/sys/dev/usb/usb_msctest.c  (working copy)
@@ -567,6 +567,7 @@
                                err = bbb_command_start(sc, DIR_OUT, 0,
                                    NULL, 0, 6, USB_MS_HZ);

+                               pause("TEST", 2*hz);
                                DPRINTFN(0, "Eject CD command "
                                    "status: %s\n", usbd_errstr(err));
                        }

Makes it work:

Sleeping on "TEST" with the following non-sleepable locks held:
exclusive sleep mutex USB autoinstall (USB autoinstall) r = 0
(0xc6bd1e00) locked @ /usr/src/sys/dev/usb/usb_msctest.c:536
KDB: stack backtrace:
db_trace_self_wrapper(c08fccdb,f3f46a2c,c067e395,c08eb082,218,...) at
db_trace_self_wrapper+0x26
kdb_backtrace(c08eb082,218,ffffffff,c0aea2f4,f3f46a64,...) at kdb_backtrace+0x29
_witness_debugger(c08ff11c,f3f46a78,4,1,0,...) at _witness_debugger+0x25
witness_warn(5,0,c08fa657,c08eb0a5,c5c82e4c,...) at witness_warn+0x1fd
_sleep(c09a9a64,0,0,c08eb0a5,7d0,...) at _sleep+0x5f
pause(c08eb0a5,7d0,6,400,6,...) at pause+0x47
usb_test_autoinstall(c680f400,0,1,100,2,...) at usb_test_autoinstall+0x213
u3g_test_huawei_autoinst(c680f400,f3f46bd0,f3f46bfc,40,2,...) at
u3g_test_huawei_autoinst+0x13d
usb_alloc_device(c5f81b80,c5c82cf0,c621b400,1,1,...) at usb_alloc_device+0xcb3
uhub_explore(c621b400,0,c08e8476,e3,c5c82dd4,...) at uhub_explore+0x519
usb_bus_explore(c5c82dd4,c5c82e4c,c08eb0ce,67,c08f8165,...) at
usb_bus_explore+0x97
usb_process(c5c82d74,f3f46d38,c08f4e84,33e,c5f95aa0,...) at usb_process+0xde
fork_exit(c059c650,c5c82d74,f3f46d38) at fork_exit+0xb8
fork_trampoline() at fork_trampoline+0x8
--- trap 0, eip = 0, esp = 0xf3f46d70, ebp = 0 ---
usb_test_autoinstall:571: Eject CD command status: USB_ERR_NORMAL_COMPLETION
usb_alloc_device:1781: Found Huawei auto-install disk!
ugen0.3: <Novatel Wireless> at usbus0
ugen0.3: <Novatel Wireless> at usbus0 (disconnected)
uhub_reattach_port:440: could not allocate new device!
ugen0.3: <Novatel Wireless> at usbus0
u3g0: <Data Interface> on usbus0
u3g0: Found 2 ports.

Yipee :-)

Lucius



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?90a5caac0908070643v79af69b7s85fc5432da148701>