diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2010-03-05 15:10:17 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-05-20 16:21:31 -0400 |
commit | 0ede76fcec5415ef82a423a95120286895822e2d (patch) | |
tree | 61aa2a0b499a0101033c59b8884328bdb31e5956 /drivers/usb/storage/usb.c | |
parent | 749da5f82fe33ff68dd4aa1a5e35cd9aa6246dab (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/storage/usb.c')
-rw-r--r-- | drivers/usb/storage/usb.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c index bbeeb92a2131..c54a370c76c5 100644 --- a/drivers/usb/storage/usb.c +++ b/drivers/usb/storage/usb.c | |||
@@ -407,9 +407,8 @@ static int associate_dev(struct us_data *us, struct usb_interface *intf) | |||
407 | /* Store our private data in the interface */ | 407 | /* Store our private data in the interface */ |
408 | usb_set_intfdata(intf, us); | 408 | usb_set_intfdata(intf, us); |
409 | 409 | ||
410 | /* Allocate the device-related DMA-mapped buffers */ | 410 | /* Allocate the control/setup and DMA-mapped buffers */ |
411 | us->cr = usb_buffer_alloc(us->pusb_dev, sizeof(*us->cr), | 411 | us->cr = kmalloc(sizeof(*us->cr), GFP_KERNEL); |
412 | GFP_KERNEL, &us->cr_dma); | ||
413 | if (!us->cr) { | 412 | if (!us->cr) { |
414 | US_DEBUGP("usb_ctrlrequest allocation failed\n"); | 413 | US_DEBUGP("usb_ctrlrequest allocation failed\n"); |
415 | return -ENOMEM; | 414 | return -ENOMEM; |
@@ -757,13 +756,9 @@ static void dissociate_dev(struct us_data *us) | |||
757 | { | 756 | { |
758 | US_DEBUGP("-- %s\n", __func__); | 757 | US_DEBUGP("-- %s\n", __func__); |
759 | 758 | ||
760 | /* Free the device-related DMA-mapped buffers */ | 759 | /* Free the buffers */ |
761 | if (us->cr) | 760 | kfree(us->cr); |
762 | usb_buffer_free(us->pusb_dev, sizeof(*us->cr), us->cr, | 761 | usb_buffer_free(us->pusb_dev, US_IOBUF_SIZE, us->iobuf, us->iobuf_dma); |
763 | us->cr_dma); | ||
764 | if (us->iobuf) | ||
765 | usb_buffer_free(us->pusb_dev, US_IOBUF_SIZE, us->iobuf, | ||
766 | us->iobuf_dma); | ||
767 | 762 | ||
768 | /* Remove our private data from the interface */ | 763 | /* Remove our private data from the interface */ |
769 | usb_set_intfdata(us->pusb_intf, NULL); | 764 | usb_set_intfdata(us->pusb_intf, NULL); |