[PATCH] USB: usb-skeleton.c: fix blocked forever in skel_read

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Du Xing duxing2007@xxxxxxxxx

In skel_read,the reader blocked in wait_for_completion before submit bulk in urb.
Using processed_urb is totally unnecessary, remove it can fix the bug.
---
Signed-off-by: Du Xing duxing2007@xxxxxxxxx
---
diff --git a/drivers/usb/usb-skeleton.c b/drivers/usb/usb-skeleton.c
index ce31017..14e4889 100644
--- a/drivers/usb/usb-skeleton.c
+++ b/drivers/usb/usb-skeleton.c
@@ -61,7 +61,6 @@ struct usb_skel {
        __u8                    bulk_out_endpointAddr;  /* the address of the bulk out endpoint */
        int                     errors;                 /* the last request tanked */
        bool                    ongoing_read;           /* a read is going on */
-       bool                    processed_urb;          /* indicates we haven't processed the urb */
        spinlock_t              err_lock;               /* lock for errors */
        struct kref             kref;
        struct mutex            io_mutex;               /* synchronize I/O with disconnect */
@@ -269,17 +268,6 @@ retry:
                 * we must finish now
                 */
                dev->bulk_in_copied = 0;
-               dev->processed_urb = 1;
-       }
-
-       if (!dev->processed_urb) {
-               /*
-                * the URB hasn't been processed
-                * do it now
-                */
-               wait_for_completion(&dev->bulk_in_completion);
-               dev->bulk_in_copied = 0;
-               dev->processed_urb = 1;
        }
 
        /* errors must be reported */
---
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux