diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2009-10-27 15:18:46 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-12-11 14:55:18 -0500 |
commit | d697cdda43939a80432863e2e26df6701ce72b63 (patch) | |
tree | 3ec15d51e6a9f1e92697de95e41b5261f5da098b /drivers | |
parent | dccd574cccad950d9ed9bc192eae4089c6044d9d (diff) |
USB: don't use a fixed DMA mapping for hub status URBs
This patch (as1296) gets rid of the fixed DMA-buffer mapping used by
the hub driver for its status URB. This URB doesn't get used much --
mainly when a device is plugged in or unplugged -- so the dynamic
mapping overhead is minimal. And most systems have many fewer
external hubs than root hubs, which don't need a mapped buffer anyway.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/usb/core/hub.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 2ac115015229..708c63826100 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c | |||
@@ -45,7 +45,6 @@ struct usb_hub { | |||
45 | 45 | ||
46 | /* buffer for urb ... with extra space in case of babble */ | 46 | /* buffer for urb ... with extra space in case of babble */ |
47 | char (*buffer)[8]; | 47 | char (*buffer)[8]; |
48 | dma_addr_t buffer_dma; /* DMA address for buffer */ | ||
49 | union { | 48 | union { |
50 | struct usb_hub_status hub; | 49 | struct usb_hub_status hub; |
51 | struct usb_port_status port; | 50 | struct usb_port_status port; |
@@ -869,8 +868,7 @@ static int hub_configure(struct usb_hub *hub, | |||
869 | int maxp, ret; | 868 | int maxp, ret; |
870 | char *message = "out of memory"; | 869 | char *message = "out of memory"; |
871 | 870 | ||
872 | hub->buffer = usb_buffer_alloc(hdev, sizeof(*hub->buffer), GFP_KERNEL, | 871 | hub->buffer = kmalloc(sizeof(*hub->buffer), GFP_KERNEL); |
873 | &hub->buffer_dma); | ||
874 | if (!hub->buffer) { | 872 | if (!hub->buffer) { |
875 | ret = -ENOMEM; | 873 | ret = -ENOMEM; |
876 | goto fail; | 874 | goto fail; |
@@ -1111,8 +1109,6 @@ static int hub_configure(struct usb_hub *hub, | |||
1111 | 1109 | ||
1112 | usb_fill_int_urb(hub->urb, hdev, pipe, *hub->buffer, maxp, hub_irq, | 1110 | usb_fill_int_urb(hub->urb, hdev, pipe, *hub->buffer, maxp, hub_irq, |
1113 | hub, endpoint->bInterval); | 1111 | hub, endpoint->bInterval); |
1114 | hub->urb->transfer_dma = hub->buffer_dma; | ||
1115 | hub->urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; | ||
1116 | 1112 | ||
1117 | /* maybe cycle the hub leds */ | 1113 | /* maybe cycle the hub leds */ |
1118 | if (hub->has_indicators && blinkenlights) | 1114 | if (hub->has_indicators && blinkenlights) |
@@ -1162,8 +1158,7 @@ static void hub_disconnect(struct usb_interface *intf) | |||
1162 | kfree(hub->port_owners); | 1158 | kfree(hub->port_owners); |
1163 | kfree(hub->descriptor); | 1159 | kfree(hub->descriptor); |
1164 | kfree(hub->status); | 1160 | kfree(hub->status); |
1165 | usb_buffer_free(hub->hdev, sizeof(*hub->buffer), hub->buffer, | 1161 | kfree(hub->buffer); |
1166 | hub->buffer_dma); | ||
1167 | 1162 | ||
1168 | kref_put(&hub->kref, hub_release); | 1163 | kref_put(&hub->kref, hub_release); |
1169 | } | 1164 | } |