ChangeSet 1.1743.3.4, 2004/05/24 17:03:19-07:00, [EMAIL PROTECTED]

[PATCH] USB: waitqueue related problem in kaweth

this was buggy for the same reason that the old msleep was buggy.

  - safe waiting in case we are left on other wait queues


 drivers/usb/net/kaweth.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)


diff -Nru a/drivers/usb/net/kaweth.c b/drivers/usb/net/kaweth.c
--- a/drivers/usb/net/kaweth.c  Fri May 28 14:41:36 2004
+++ b/drivers/usb/net/kaweth.c  Fri May 28 14:41:36 2004
@@ -1240,20 +1240,20 @@
         init_waitqueue_head(&awd.wqh);
         awd.done = 0;
 
-        set_current_state(TASK_INTERRUPTIBLE);
         add_wait_queue(&awd.wqh, &wait);
         urb->context = &awd;
-        status = usb_submit_urb(urb, GFP_ATOMIC);
+        status = usb_submit_urb(urb, GFP_NOIO);
         if (status) {
                 // something went wrong
                 usb_free_urb(urb);
-                set_current_state(TASK_RUNNING);
                 remove_wait_queue(&awd.wqh, &wait);
                 return status;
         }
 
-       while (timeout && !awd.done)
+       while (timeout && !awd.done) {
+               set_current_state(TASK_UNINTERRUPTIBLE);
                timeout = schedule_timeout(timeout);
+       }
 
         set_current_state(TASK_RUNNING);
         remove_wait_queue(&awd.wqh, &wait);



-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g.
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id149&alloc_id�66&op=click
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to