Loading drivers/usb/misc/usbtest.c +11 −3 Original line number Diff line number Diff line Loading @@ -10,6 +10,7 @@ #include <linux/usb.h> #define SIMPLE_IO_TIMEOUT 10000 /* in milliseconds */ /*-------------------------------------------------------------------------*/ Loading Loading @@ -366,6 +367,7 @@ static int simple_io( int max = urb->transfer_buffer_length; struct completion completion; int retval = 0; unsigned long expire; urb->context = &completion; while (retval == 0 && iterations-- > 0) { Loading @@ -378,9 +380,15 @@ static int simple_io( if (retval != 0) break; /* NOTE: no timeouts; can't be broken out of by interrupt */ wait_for_completion(&completion); expire = msecs_to_jiffies(SIMPLE_IO_TIMEOUT); if (!wait_for_completion_timeout(&completion, expire)) { usb_kill_urb(urb); retval = (urb->status == -ENOENT ? -ETIMEDOUT : urb->status); } else { retval = urb->status; } urb->dev = udev; if (retval == 0 && usb_pipein(urb->pipe)) retval = simple_check_buf(tdev, urb); Loading Loading
drivers/usb/misc/usbtest.c +11 −3 Original line number Diff line number Diff line Loading @@ -10,6 +10,7 @@ #include <linux/usb.h> #define SIMPLE_IO_TIMEOUT 10000 /* in milliseconds */ /*-------------------------------------------------------------------------*/ Loading Loading @@ -366,6 +367,7 @@ static int simple_io( int max = urb->transfer_buffer_length; struct completion completion; int retval = 0; unsigned long expire; urb->context = &completion; while (retval == 0 && iterations-- > 0) { Loading @@ -378,9 +380,15 @@ static int simple_io( if (retval != 0) break; /* NOTE: no timeouts; can't be broken out of by interrupt */ wait_for_completion(&completion); expire = msecs_to_jiffies(SIMPLE_IO_TIMEOUT); if (!wait_for_completion_timeout(&completion, expire)) { usb_kill_urb(urb); retval = (urb->status == -ENOENT ? -ETIMEDOUT : urb->status); } else { retval = urb->status; } urb->dev = udev; if (retval == 0 && usb_pipein(urb->pipe)) retval = simple_check_buf(tdev, urb); Loading