aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorEberhard Fahle <e.fahle@wayoda.org>2007-04-05 05:13:21 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2007-04-27 16:28:43 -0400
commit147c5a17338fc72a89452f0a6c14ae6fcf853919 (patch)
tree332c922a18dc351530979f226e56f103e2f7eb5a /drivers/usb
parenta03c6facf84a51a04958d75ceef443108c44872d (diff)
USB: iowarrior.c: timeouts too small in usb_control_msg calls
The driver uses usb_control_msg() for exchanging data with the device. When the driver lived freeley _outside_ the kernel tree (pre 2.6.21) the timeouts for these calls where set to 5*HZ for reading, 1HZ for writing. (These timeouts seemed to work fine for all users of the driver, at least nobody complained in the last 2 years. The current code (2.6.21-rc5) removed the 'HZ' from the timeouts and left the driver with 5 jiffies for reading and 1 jiffy for writing. My new machine is fast, but not that fast. The patch also removes a useless debug statement, which was left over from testing a broken firmware version From: Eberhard Fahle <e.fahle@wayoda.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/misc/iowarrior.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/usb/misc/iowarrior.c b/drivers/usb/misc/iowarrior.c
index de97ed7b0b95..fc51207b71b8 100644
--- a/drivers/usb/misc/iowarrior.c
+++ b/drivers/usb/misc/iowarrior.c
@@ -118,7 +118,7 @@ static int usb_get_report(struct usb_device *dev,
118 USB_DIR_IN | USB_TYPE_CLASS | 118 USB_DIR_IN | USB_TYPE_CLASS |
119 USB_RECIP_INTERFACE, (type << 8) + id, 119 USB_RECIP_INTERFACE, (type << 8) + id,
120 inter->desc.bInterfaceNumber, buf, size, 120 inter->desc.bInterfaceNumber, buf, size,
121 GET_TIMEOUT); 121 GET_TIMEOUT*HZ);
122} 122}
123//#endif 123//#endif
124 124
@@ -133,7 +133,7 @@ static int usb_set_report(struct usb_interface *intf, unsigned char type,
133 USB_TYPE_CLASS | USB_RECIP_INTERFACE, 133 USB_TYPE_CLASS | USB_RECIP_INTERFACE,
134 (type << 8) + id, 134 (type << 8) + id,
135 intf->cur_altsetting->desc.bInterfaceNumber, buf, 135 intf->cur_altsetting->desc.bInterfaceNumber, buf,
136 size, 1); 136 size, HZ);
137} 137}
138 138
139/*---------------------*/ 139/*---------------------*/
@@ -750,7 +750,6 @@ static int iowarrior_probe(struct usb_interface *interface,
750 struct usb_endpoint_descriptor *endpoint; 750 struct usb_endpoint_descriptor *endpoint;
751 int i; 751 int i;
752 int retval = -ENOMEM; 752 int retval = -ENOMEM;
753 int idele = 0;
754 753
755 /* allocate memory for our device state and intialize it */ 754 /* allocate memory for our device state and intialize it */
756 dev = kzalloc(sizeof(struct iowarrior), GFP_KERNEL); 755 dev = kzalloc(sizeof(struct iowarrior), GFP_KERNEL);
@@ -826,11 +825,10 @@ static int iowarrior_probe(struct usb_interface *interface,
826 825
827 /* Set the idle timeout to 0, if this is interface 0 */ 826 /* Set the idle timeout to 0, if this is interface 0 */
828 if (dev->interface->cur_altsetting->desc.bInterfaceNumber == 0) { 827 if (dev->interface->cur_altsetting->desc.bInterfaceNumber == 0) {
829 idele = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 828 usb_control_msg(udev, usb_sndctrlpipe(udev, 0),
830 0x0A, 829 0x0A,
831 USB_TYPE_CLASS | USB_RECIP_INTERFACE, 0, 830 USB_TYPE_CLASS | USB_RECIP_INTERFACE, 0,
832 0, NULL, 0, USB_CTRL_SET_TIMEOUT); 831 0, NULL, 0, USB_CTRL_SET_TIMEOUT);
833 dbg("idele = %d", idele);
834 } 832 }
835 /* allow device read and ioctl */ 833 /* allow device read and ioctl */
836 dev->present = 1; 834 dev->present = 1;