They could do it in a bottom half, after the HCD is done with the URB.

On Fri, 18 May 2001, David Brownell wrote:

>What's so bad about freeing inside a callback?  When else
>would most drivers have all the facts in hand, so they know
>that they're done using a given URB?  Inquiring minds ...
>
>----- Original Message ----- 
>From: "Pete Zaitcev" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Cc: "Dan Streetman" <[EMAIL PROTECTED]>
>Sent: Thursday, May 17, 2001 11:44 PM
>Subject: Re: [linux-usb-devel] [patch] usb-uhci held spinlock
>
>
>> Dan, the little gem that you quote belongs to David-B.
>> I was shocked what I saw it too. However, I let it pass
>> unchallenged upon David's authority, just ranted loud
>> about idiotic API of USB (w.r.t. freeing inside a callback).
>> 
>> Here is the thread:
>>  http://marc.theaimsgroup.com/?t=98581009700001&w=2&r=1
>>  http://marc.theaimsgroup.com/?l=linux-usb-devel&m=98580988401128&w=2
>> 
>> -- Pete
>> 
>> > From: Dan Streetman <[EMAIL PROTECTED]>
>> > To: Linux-USB development mailing list <[EMAIL PROTECTED]>,
>> >    Johannes Erdfelt <[EMAIL PROTECTED]>, Georg Acher <[EMAIL PROTECTED]>
>> > Date: Thu, 17 May 2001 23:19:52 -0400 (EDT)
>> > 
>> > I think that holding the urb's spinlock is bad if that urb
>> > will ever be used again; although maybe I'm missing something...
>> > I'm also not clear on why urb is being NULLed...
>> > 
>> > --- 2.4.4-clean/drivers/usb/usb-uhci.c Fri Apr 27 18:13:07 2001
>> > +++ linux/drivers/usb/usb-uhci.c Thu May 17 23:16:19 2001
>> > @@ -2639,14 +2639,12 @@
>> >  if (is_ring && !was_unlinked && !contains_killed) {
>> >  urb->dev=usb_dev;
>> >  uhci_submit_urb (urb);
>> > - } else
>> > - urb = 0;
>> > + }
>> >  spin_lock(&s->urb_list_lock);
>> >  }
>> >  
>> >  usb_dec_dev_use (usb_dev);
>> > - if (urb)
>> > - spin_unlock(&urb->lock); 
>> > + spin_unlock(&urb->lock); 
>> >  }
>> >  }
>> >  
>> 
>> _______________________________________________
>> [EMAIL PROTECTED]
>> To unsubscribe, use the last form field at:
>> http://lists.sourceforge.net/lists/listinfo/linux-usb-devel
>
>
>_______________________________________________
>[EMAIL PROTECTED]
>To unsubscribe, use the last form field at:
>http://lists.sourceforge.net/lists/listinfo/linux-usb-devel
>
>

-- 
Dan Streetman
[EMAIL PROTECTED]


_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
http://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to