lkml.org 
[lkml]   [2007]   [Oct]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: USB: FIx locks and urb->status in adutux
Date
Am Dienstag 23 Oktober 2007 schrieb Pete Zaitcev:
> On Tue, 23 Oct 2007 11:38:37 +0200, Oliver Neukum <oliver@neukum.org> wrote:
>
> > > +   /* XXX Anchor these instead */
> > > +   spin_lock_irqsave(&dev->buflock, flags);
> > > +   if (!dev->read_urb_finished) {
> > > +           spin_unlock_irqrestore(&dev->buflock, flags);
> > > +           usb_kill_urb(dev->interrupt_in_urb);
> > > +   } else
> > > +           spin_unlock_irqrestore(&dev->buflock, flags);
>
> > Why bother? Simply call usb_kill_urb() unconditionally.
>
> Is it always safe to kill unfilled URBs? The filled but unsubmitted ones
> are ok, but in this case it's possible that we only allocated something
> but never submitted. Our current implementation happens to be safe by
> virtue of ->dev being NULL in such case. I do not remember if we always
> guaranteed that and since Vitaly is going to take this code for a
> backport, I decided to play it safe.

I am not sure as far as 2.4 is concerned. In fact I am not sure 2.4 has
usb_kill_urb() at all.

Regards
Oliver

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-10-24 16:07    [from the cache]
©2003-2011 Jasper Spaans