aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/misc
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2010-03-05 15:10:17 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2010-05-20 16:21:31 -0400
commit0ede76fcec5415ef82a423a95120286895822e2d (patch)
tree61aa2a0b499a0101033c59b8884328bdb31e5956 /drivers/usb/misc
parent749da5f82fe33ff68dd4aa1a5e35cd9aa6246dab (diff)
USB: remove uses of URB_NO_SETUP_DMA_MAP
This patch (as1350) removes all usages of coherent buffers for USB control-request setup-packet buffers. There's no good reason to reserve coherent memory for these things; control requests are hardly ever used in large quantity (the major exception is firmware transfers, and they aren't time-critical). Furthermore, only seven drivers used it. We might as well always use streaming DMA mappings for setup-packet buffers, and remove some extra complexity from usbcore. The DMA-mapping portion of hcd.c is currently in flux. A separate patch will be submitted to remove support for URB_NO_SETUP_DMA_MAP after everything else settles down. The removal should go smoothly, as by then nobody will be using it. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/misc')
-rw-r--r--drivers/usb/misc/usbtest.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/usb/misc/usbtest.c b/drivers/usb/misc/usbtest.c
index a21cce6f7403..9dcc82337ced 100644
--- a/drivers/usb/misc/usbtest.c
+++ b/drivers/usb/misc/usbtest.c
@@ -977,15 +977,13 @@ test_ctrl_queue (struct usbtest_dev *dev, struct usbtest_param *param)
977 if (!u) 977 if (!u)
978 goto cleanup; 978 goto cleanup;
979 979
980 reqp = usb_buffer_alloc (udev, sizeof *reqp, GFP_KERNEL, 980 reqp = kmalloc(sizeof *reqp, GFP_KERNEL);
981 &u->setup_dma);
982 if (!reqp) 981 if (!reqp)
983 goto cleanup; 982 goto cleanup;
984 reqp->setup = req; 983 reqp->setup = req;
985 reqp->number = i % NUM_SUBCASES; 984 reqp->number = i % NUM_SUBCASES;
986 reqp->expected = expected; 985 reqp->expected = expected;
987 u->setup_packet = (char *) &reqp->setup; 986 u->setup_packet = (char *) &reqp->setup;
988 u->transfer_flags |= URB_NO_SETUP_DMA_MAP;
989 987
990 u->context = &context; 988 u->context = &context;
991 u->complete = ctrl_complete; 989 u->complete = ctrl_complete;
@@ -1017,10 +1015,7 @@ cleanup:
1017 if (!urb [i]) 1015 if (!urb [i])
1018 continue; 1016 continue;
1019 urb [i]->dev = udev; 1017 urb [i]->dev = udev;
1020 if (urb [i]->setup_packet) 1018 kfree(urb[i]->setup_packet);
1021 usb_buffer_free (udev, sizeof (struct usb_ctrlrequest),
1022 urb [i]->setup_packet,
1023 urb [i]->setup_dma);
1024 simple_free_urb (urb [i]); 1019 simple_free_urb (urb [i]);
1025 } 1020 }
1026 kfree (urb); 1021 kfree (urb);