Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 2 May 2004 10:38:42 -0400
From:      "Rita Lin" <ritalin@comcast.net>
To:        <freebsd-hackers@freebsd.org>
Subject:   USB device driver question: timeout() and usbd_do_request()
Message-ID:  <004c01c43053$2a775920$9402a8c0@emachine>

next in thread | raw e-mail | index | archive | help
Hello,

I'm writing a USB driver for a device that does not have any interrupt. =
It only has Bulk-in and Bulk-out. A periodic polling status from default =
pipe is required to have a smooth data transfer. I used timeout() =
routine to call usbd_do_request() for polling. I thought maybe timeout() =
is called under interrupt context, since usbd_do_request() access system =
I/O, it crashes. However, by adding this timeout() in ucomstart(), it =
didn't crash until the third call to timeout(). Removing =
usbd_do_request() allows the timeout() to work without any problem. From =
the USB analyzer, I could see that even if the system crashed, a request =
was sent to the USB device correctly. There are two crashdump messages =
printed out to the screen, I could only catch the second one. The first =
one scrolled off the screen too fast. By counting the byte and the =
instruction pointer, the routine crashed in acquire_lock(). I 'greped' =
the kernel source code, didn't see this routine.

I know I'm missing some important FreeBSD concept since I'm new to it, =
by reading related document did not reveal anything that might help me. =
If usbd_do_request() should never be used in timeout() as a callback =
routine, what other options do I have, to implement a status-polling =
scheme?=20

Thank you very much in advance.
Rita



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?004c01c43053$2a775920$9402a8c0>