From: Manuel Estrada Sainz <ranty-bulk@ranty.pantax.net>
To: Oliver Neukum <oliver@neukum.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
Jeff Garzik <jgarzik@pobox.com>,
orinoco-devel@lists.sf.net, jt@hpl.hp.com
Subject: Re: orinoco_usb Request For Comments
Date: Fri, 27 Jun 2003 10:27:37 +0200 [thread overview]
Message-ID: <20030627082737.GA19302@ranty.pantax.net> (raw)
In-Reply-To: <200306262341.19110.oliver@neukum.org>
[-- Attachment #1: Type: text/plain, Size: 1179 bytes --]
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.
[-- Attachment #2: diff.diff --]
[-- Type: text/plain, Size: 1198 bytes --]
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))
next prev parent reply other threads:[~2003-06-27 8:13 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-06-26 20:58 orinoco_usb Request For Comments Manuel Estrada Sainz
2003-06-26 21:41 ` Oliver Neukum
2003-06-26 23:09 ` Manuel Estrada Sainz
2003-06-27 8:27 ` Manuel Estrada Sainz [this message]
[not found] ` <Pine.LNX.4.53.0306271213350.5135@fachschaft.cup.uni-muenchen.de>
2003-07-02 10:17 ` Manuel Estrada Sainz
2003-07-02 14:02 ` Oliver Neukum
2003-06-26 22:03 ` [Orinoco-devel] " Pavel Roskin
2003-06-26 22:50 ` Manuel Estrada Sainz
2003-06-27 21:49 ` Pavel Roskin
2003-06-27 22:16 ` Manuel Estrada Sainz
2003-06-27 2:55 ` David Gibson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20030627082737.GA19302@ranty.pantax.net \
--to=ranty-bulk@ranty.pantax.net \
--cc=jgarzik@pobox.com \
--cc=jt@hpl.hp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=oliver@neukum.org \
--cc=orinoco-devel@lists.sf.net \
--cc=ranty@debian.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).