Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 10 Mar 2019 11:07:51 +1030
From:      "O'Connor, Daniel" <darius@dons.net.au>
To:        Hans Petter Selasky <hps@selasky.org>
Cc:        FreeBSD Hackers <freebsd-hackers@freebsd.org>
Subject:   Re: USB stack getting confused
Message-ID:  <9E316D45-3538-4070-A8B0-05F9B71BC480@dons.net.au>
In-Reply-To: <6dd8fe5f-6835-d98a-7592-0293406ccd63@selasky.org>
References:  <E0371188-FD0A-47E1-8378-40239F5C6622@dons.net.au> <f3e6e30b-8b62-546b-2b51-e841f2e645bd@selasky.org> <3B29D870-41F9-46AF-B9F3-03106DEC417D@dons.net.au> <6dd8fe5f-6835-d98a-7592-0293406ccd63@selasky.org>

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


> On 10 Mar 2019, at 01:55, Hans Petter Selasky <hps@selasky.org> wrote:
> On 3/9/19 11:29 AM, O'Connor, Daniel wrote:
>> If I hold the user space process in gdb 'forever' (eg over night) =
usbconfig doesn't see the device, but the moment I quit the user space =
process it can be seen again.
>=20
> Check the output from "procstat -ak". Likely your application is not =
closing the USB handle during device detach and so a deadlock happens.

I ran it while stopped in the debugger..
[maarsytest 23:34] ~> procstat -k 20033
  PID    TID COMM                TDNAME              KSTACK
20033 100135 tclsh8.6            -                   mi_switch =
thread_suspend_switch ptracestop cursig ast doreti_ast

Then continued it and ran it a few more times..
[maarsytest 23:34] ~> procstat -k 20033
  PID    TID COMM                TDNAME              KSTACK
20033 100135 tclsh8.6            -                   mi_switch =
sleepq_catch_signals sleepq_wait_sig _sleep pipe_read dofileread =
kern_readv sys_read amd64_syscall fast_syscall_common
[maarsytest 23:34] ~> procstat -k 20033
  PID    TID COMM                TDNAME              KSTACK
20033 100135 tclsh8.6            -                   mi_switch =
sleepq_catch_signals sleepq_timedwait_sig _cv_timedwait_sig_sbt =
seltdwait kern_select sys_select amd64_syscall fast_syscall_common

> Also see:
> libusb20_dev_check_connected() . Poll this function regularly to =
figure out if disconnect is needed.

Hmm, is this exposed in the libusb10 interface? The code I am using uses =
that to talk to the device (although I have the source for it so can =
modify it)

--
Daniel O'Connor
"The nice thing about standards is that there
are so many of them to choose from."
 -- Andrew Tanenbaum





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?9E316D45-3538-4070-A8B0-05F9B71BC480>