Dear Greg,
Thanks for your quick response, we very appreciate it.
Our driver is developed based on the usbserial module.
The code listed below is our open function:
mxu2s_open() {
......
if(port->read_urb->status != -EINPROGRESS) {
port->read_urb->dev = port->serial->dev;
port->read_urb->transfer_buffer_length =
URB_TRANSFER_BUFFER_SIZE;
usb_fill_bulk_urb(port->read_urb, port->serial->dev,
usb_rcvbulkpipe(port->serial->dev,
port->bulk_in_endpointAddress),
port->read_urb->transfer_buffer,
port->read_urb->transfer_buffer_length,
mxu2s_read_bulk_callback, port);
rc = usb_submit_urb(port->read_urb, GFP_KERNEL);
......
}
we submit the read_urb here, and then it will be submit again
in the read_bulk_callback function :
mxu2s_read_bulk_callback() {
......
if(port->read_urb->status != -EINPROGRESS) {
rc = usb_submit_urb(port->read_urb, GFP_ATOMIC);
}
......
}
finally, we wanna unlink the read_urb in the close function, and it blocks:
mxu2s_close() {
......
if(serial->dev) {
printk("unlinking...\n");
usb_unlink_urb(priv->read_urb);
printk("unlink finished\n"); // <-- you'll never see
this in kmsg
}
.......
}
we have not try the 2.6.12-rc5 or 2.6.11 version, cause many of our customers
may hope
to use it under the default S/W environment, which means we are asked to
support distributions
like Fedora core 2, core 3 or others..... :~
I'm afraid too many codes taking you too much time, so I cut off and make
this short.
If you'd like to check in detail, please feel free to contact me.
Regards,
oct
-----Original Message-----
From: Greg KH [mailto:[EMAIL PROTECTED]
Sent: Friday, June 03, 2005 2:30 PM
To: Enzo Chen (陳友士)
Cc: [email protected]
Subject: Re: [linux-usb-devel] Question about usb_unlink_urb
On Fri, Jun 03, 2005 at 11:20:33AM +0800, Enzo Chen (?????h) wrote:
> Hi all,
>
> Recently, we are developing USB driver for our products, and we found the
> "usb_unlink_urb" function not work.
>
> The S/W platform is Fedora Core 2 with kernel version 2.6.5-1, when we open
> our USB device node, we submit the read_urb,
> and it is expected to be unlinked when the user program close USB device.
> But the "usb_unlink_urb" seems blocked when close function excuting, and
> released on the next time the USB device plug-in.
> (when un-plug and then plug-in the device again)
Hm, have a pointer to your code so we can see what is going on?
> Is this a bug in linux kernel under version 2.6.9 ? or something wrong in our
> driver ? how could we fix this?
Does it work on 2.6.12-rc5? 2.6.11?
Remember, Fedora Core 2 isn't even supported by Red Hat anymore, that kernel is
quite old :)
thanks,
greg k-h
-------------------------------------------------------
This SF.Net email is sponsored by Yahoo.
Introducing Yahoo! Search Developer Network - Create apps using Yahoo!
Search APIs Find out how you can build Yahoo! directly into your own
Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel