mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* btusb autosuspend + usb core problems
@ 2008-09-15 17:42 Pavel Machek
  0 siblings, 0 replies; only message in thread
From: Pavel Machek @ 2008-09-15 17:42 UTC (permalink / raw)
  To: oneukum, kernel list, Linux usb mailing list

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-09-15 17:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-09-15 17:42 btusb autosuspend + usb core problems Pavel Machek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®