lkml.org 
[lkml]   [2003]   [Jun]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
DateFri, 27 Jun 2003 10:27:37 +0200
FromManuel Estrada Sainz <>
SubjectRe: orinoco_usb Request For Comments
On Thu, Jun 26, 2003 at 11:41:18PM +0200, Oliver Neukum wrote:
>
> > Please comment, how much of that or what else needs to be done to get
> > it in the kernel?
>
> if(dev->read.urb->status == -EINPROGRESS){
> warn("%s: Unlinking pending IN urb", __FUNCTION__);
> retval = bridge_remove_in_urb(dev);
> if(retval){
> dbg("retval %d status %d", retval,
> dev->read.urb->status);
> }
> }
>
> Unlink unconditionally.
>
> /* We don't like racing :) */
> ctx->outurb->transfer_flags &= ~URB_ASYNC_UNLINK;
> usb_unlink_urb(ctx->outurb);
> del_timer_sync(&ctx->timer);
>
> But neither do we like sleeping in interrupt. You can't simply unset the flag
> if somebody else may be needing it.
>
> More when I am rested :-)

How about the attached patch, not pretty, but it should work.

Have a nice day

Manuel

--
--- Manuel Estrada Sainz <ranty@debian.org>
<ranty@bigfoot.com>
<ranty@users.sourceforge.net>
------------------------ <manuel.estrada@hispalinux.es> -------------------
Let us have the serenity to accept the things we cannot change, courage to
change the things we can, and wisdom to know the difference.Index: orinoco_usb.c
===================================================================
RCS file: /usr/local/cvsroot/ranty/orinoco/driver/orinoco_usb.c,v
retrieving revision 1.80
diff -u -r1.80 orinoco_usb.c
--- orinoco_usb.c 25 Jun 2003 18:37:59 -0000 1.80
+++ orinoco_usb.c 27 Jun 2003 08:24:09 -0000
@@ -1858,13 +1858,9 @@
dev->udev = NULL;
//priv->hw_unavailable = 1;

- if(dev->read.urb->status == -EINPROGRESS){
- warn("%s: Unlinking pending IN urb", __FUNCTION__);
- retval = bridge_remove_in_urb(dev);
- if(retval){
- dbg("retval %d status %d", retval,
- dev->read.urb->status);
- }
+ retval = bridge_remove_in_urb(dev);
+ if (retval) {
+ dbg("retval %d status %d", retval, dev->read.urb->status);
}
restart_list:
spin_lock_irqsave(&dev->ctxq.lock, flags);
@@ -1876,8 +1872,11 @@
spin_unlock_irqrestore(&dev->ctxq.lock, flags);

/* We don't like racing :) */
- ctx->outurb->transfer_flags &= ~URB_ASYNC_UNLINK;
usb_unlink_urb(ctx->outurb);
+ while (ctx->outurb->status == -EINPROGRESS) {
+ set_current_state (TASK_UNINTERRUPTIBLE);
+ schedule_timeout ((3 /*ms*/ * HZ)/1000)
+ }
del_timer_sync(&ctx->timer);

if (!list_empty(&ctx->list))
\
 
 \ /
  Last update: 2005-03-22 13:36    [from the cache]
©2003-2010