lkml.org 
[lkml]   [2008]   [Sep]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subjectbtusb autosuspend + usb core problems
Hi!

With usb bluetooth autosuspend, I get infinite loop in
unlink_anchored_urbs(), called from btusb_flush().

Loop is infinite, because usb_kill_urb can fail

@@ -547,13 +548,16 @@ void usb_kill_urb(struct urb *urb)
static DEFINE_MUTEX(reject_mutex);

might_sleep();
- if (!(urb && urb->dev && urb->ep))
+ if (!(urb && urb->dev && urb->ep)) {
+ printk("killing_urb unsuccessful\n");
return;
+ }
mutex_lock(&reject_mutex);
++urb->reject;
mutex_unlock(&reject_mutex);

(and indeed fails in my case), but does not return value.

usb_kill_anchored_urbs() relies on kill_urb() unlinking it...

spin_lock_irq(&anchor->lock);
while (!list_empty(&anchor->urb_list)) {
victim = list_entry(anchor->urb_list.prev, struct urb,
anchor_list);
+
+ if (complain++ < 10)
+ printk("kill_anchored: victim %lx (prev
%lx)\n", victim, prev_victim);
/* we must make sure the URB isn't freed before we
kill it*/
usb_get_urb(victim);
spin_unlock_irq(&anchor->lock);
@@ -584,8 +594,10 @@ void usb_kill_anchored_urbs(struct usb_a
usb_kill_urb(victim);
usb_put_urb(victim);
spin_lock_irq(&anchor->lock);
+ prev_victim = victim;

Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html


\
 
 \ /
  Last update: 2008-09-15 19:51    [W:0.055 / U:4.572 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site