diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-10 18:05:02 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-10 18:05:02 -0400 |
commit | 9895850b23886e030cd1e7241d5529a57e969c3d (patch) | |
tree | 1061626db450aeb72dcfcd247c24b33e5238c8c4 /drivers/usb/misc/usbtest.c | |
parent | fc385c313275b114bc6ad36e60c5177d63250548 (diff) | |
parent | b58af4066d240b18b43f202e07b9ec7461d90b17 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6: (148 commits)
USB: serial: fix stalled writes
USB: remove fake "address-of" expressions
USB: fix thread-unsafe anchor utiliy routines
USB: usbtest: support test device with only one iso-in or iso-out endpoint
USB: usbtest: avoid to free coherent buffer in atomic context
USB: xhci: Set DMA mask for host.
USB: xhci: Don't flush doorbell writes.
USB: xhci: Reduce reads and writes of interrupter registers.
USB: xhci: Make xhci_set_hc_event_deq() static.
USB: xhci: Minimize HW event ring dequeue pointer writes.
USB: xhci: Make xhci_handle_event() static.
USB: xhci: Remove unnecessary reads of IRQ_PENDING register.
USB: xhci: Performance - move xhci_work() into xhci_irq()
USB: xhci: Performance - move interrupt handlers into xhci-ring.c
USB: xhci: Performance - move functions that find ep ring.
USB:: fix linux/usb.h kernel-doc warnings
USB: add USB serial ssu100 driver
USB: usb-storage: implement autosuspend
USB: ehci: fix remove of ehci debugfs dir
USB: Add USB 2.0 to ssb ohci driver
...
Diffstat (limited to 'drivers/usb/misc/usbtest.c')
-rw-r--r-- | drivers/usb/misc/usbtest.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/usb/misc/usbtest.c b/drivers/usb/misc/usbtest.c index 16dffe99d9f1..eef370eb7a54 100644 --- a/drivers/usb/misc/usbtest.c +++ b/drivers/usb/misc/usbtest.c | |||
@@ -136,7 +136,7 @@ try_iso: | |||
136 | iso_out = e; | 136 | iso_out = e; |
137 | } | 137 | } |
138 | } | 138 | } |
139 | if ((in && out) || (iso_in && iso_out)) | 139 | if ((in && out) || iso_in || iso_out) |
140 | goto found; | 140 | goto found; |
141 | } | 141 | } |
142 | return -EINVAL; | 142 | return -EINVAL; |
@@ -162,6 +162,9 @@ found: | |||
162 | dev->in_iso_pipe = usb_rcvisocpipe (udev, | 162 | dev->in_iso_pipe = usb_rcvisocpipe (udev, |
163 | iso_in->desc.bEndpointAddress | 163 | iso_in->desc.bEndpointAddress |
164 | & USB_ENDPOINT_NUMBER_MASK); | 164 | & USB_ENDPOINT_NUMBER_MASK); |
165 | } | ||
166 | |||
167 | if (iso_out) { | ||
165 | dev->iso_out = &iso_out->desc; | 168 | dev->iso_out = &iso_out->desc; |
166 | dev->out_iso_pipe = usb_sndisocpipe (udev, | 169 | dev->out_iso_pipe = usb_sndisocpipe (udev, |
167 | iso_out->desc.bEndpointAddress | 170 | iso_out->desc.bEndpointAddress |
@@ -1378,7 +1381,6 @@ static void iso_callback (struct urb *urb) | |||
1378 | break; | 1381 | break; |
1379 | } | 1382 | } |
1380 | } | 1383 | } |
1381 | simple_free_urb (urb); | ||
1382 | 1384 | ||
1383 | ctx->pending--; | 1385 | ctx->pending--; |
1384 | if (ctx->pending == 0) { | 1386 | if (ctx->pending == 0) { |
@@ -1495,6 +1497,7 @@ test_iso_queue (struct usbtest_dev *dev, struct usbtest_param *param, | |||
1495 | } | 1497 | } |
1496 | 1498 | ||
1497 | simple_free_urb (urbs [i]); | 1499 | simple_free_urb (urbs [i]); |
1500 | urbs[i] = NULL; | ||
1498 | context.pending--; | 1501 | context.pending--; |
1499 | context.submit_error = 1; | 1502 | context.submit_error = 1; |
1500 | break; | 1503 | break; |
@@ -1504,6 +1507,10 @@ test_iso_queue (struct usbtest_dev *dev, struct usbtest_param *param, | |||
1504 | 1507 | ||
1505 | wait_for_completion (&context.done); | 1508 | wait_for_completion (&context.done); |
1506 | 1509 | ||
1510 | for (i = 0; i < param->sglen; i++) { | ||
1511 | if (urbs[i]) | ||
1512 | simple_free_urb(urbs[i]); | ||
1513 | } | ||
1507 | /* | 1514 | /* |
1508 | * Isochronous transfers are expected to fail sometimes. As an | 1515 | * Isochronous transfers are expected to fail sometimes. As an |
1509 | * arbitrary limit, we will report an error if any submissions | 1516 | * arbitrary limit, we will report an error if any submissions |
@@ -1548,6 +1555,7 @@ fail: | |||
1548 | * off just killing the userspace task and waiting for it to exit. | 1555 | * off just killing the userspace task and waiting for it to exit. |
1549 | */ | 1556 | */ |
1550 | 1557 | ||
1558 | /* No BKL needed */ | ||
1551 | static int | 1559 | static int |
1552 | usbtest_ioctl (struct usb_interface *intf, unsigned int code, void *buf) | 1560 | usbtest_ioctl (struct usb_interface *intf, unsigned int code, void *buf) |
1553 | { | 1561 | { |
@@ -2170,7 +2178,7 @@ static struct usb_driver usbtest_driver = { | |||
2170 | .name = "usbtest", | 2178 | .name = "usbtest", |
2171 | .id_table = id_table, | 2179 | .id_table = id_table, |
2172 | .probe = usbtest_probe, | 2180 | .probe = usbtest_probe, |
2173 | .ioctl = usbtest_ioctl, | 2181 | .unlocked_ioctl = usbtest_ioctl, |
2174 | .disconnect = usbtest_disconnect, | 2182 | .disconnect = usbtest_disconnect, |
2175 | .suspend = usbtest_suspend, | 2183 | .suspend = usbtest_suspend, |
2176 | .resume = usbtest_resume, | 2184 | .resume = usbtest_resume, |