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>
This commit is contained in:

committed by
Greg Kroah-Hartman

parent
749da5f82f
commit
0ede76fcec
@@ -977,15 +977,13 @@ test_ctrl_queue (struct usbtest_dev *dev, struct usbtest_param *param)
|
||||
if (!u)
|
||||
goto cleanup;
|
||||
|
||||
reqp = usb_buffer_alloc (udev, sizeof *reqp, GFP_KERNEL,
|
||||
&u->setup_dma);
|
||||
reqp = kmalloc(sizeof *reqp, GFP_KERNEL);
|
||||
if (!reqp)
|
||||
goto cleanup;
|
||||
reqp->setup = req;
|
||||
reqp->number = i % NUM_SUBCASES;
|
||||
reqp->expected = expected;
|
||||
u->setup_packet = (char *) &reqp->setup;
|
||||
u->transfer_flags |= URB_NO_SETUP_DMA_MAP;
|
||||
|
||||
u->context = &context;
|
||||
u->complete = ctrl_complete;
|
||||
@@ -1017,10 +1015,7 @@ cleanup:
|
||||
if (!urb [i])
|
||||
continue;
|
||||
urb [i]->dev = udev;
|
||||
if (urb [i]->setup_packet)
|
||||
usb_buffer_free (udev, sizeof (struct usb_ctrlrequest),
|
||||
urb [i]->setup_packet,
|
||||
urb [i]->setup_dma);
|
||||
kfree(urb[i]->setup_packet);
|
||||
simple_free_urb (urb [i]);
|
||||
}
|
||||
kfree (urb);
|
||||
|
Reference in New Issue
Block a user