Commit d697cdda authored by Alan Stern's avatar Alan Stern Committed by Greg Kroah-Hartman

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: default avatarAlan Stern <stern@rowland.harvard.edu>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent dccd574c
...@@ -45,7 +45,6 @@ struct usb_hub { ...@@ -45,7 +45,6 @@ struct usb_hub {
/* buffer for urb ... with extra space in case of babble */ /* buffer for urb ... with extra space in case of babble */
char (*buffer)[8]; char (*buffer)[8];
dma_addr_t buffer_dma; /* DMA address for buffer */
union { union {
struct usb_hub_status hub; struct usb_hub_status hub;
struct usb_port_status port; struct usb_port_status port;
...@@ -869,8 +868,7 @@ static int hub_configure(struct usb_hub *hub, ...@@ -869,8 +868,7 @@ static int hub_configure(struct usb_hub *hub,
int maxp, ret; int maxp, ret;
char *message = "out of memory"; char *message = "out of memory";
hub->buffer = usb_buffer_alloc(hdev, sizeof(*hub->buffer), GFP_KERNEL, hub->buffer = kmalloc(sizeof(*hub->buffer), GFP_KERNEL);
&hub->buffer_dma);
if (!hub->buffer) { if (!hub->buffer) {
ret = -ENOMEM; ret = -ENOMEM;
goto fail; goto fail;
...@@ -1111,8 +1109,6 @@ static int hub_configure(struct usb_hub *hub, ...@@ -1111,8 +1109,6 @@ static int hub_configure(struct usb_hub *hub,
usb_fill_int_urb(hub->urb, hdev, pipe, *hub->buffer, maxp, hub_irq, usb_fill_int_urb(hub->urb, hdev, pipe, *hub->buffer, maxp, hub_irq,
hub, endpoint->bInterval); hub, endpoint->bInterval);
hub->urb->transfer_dma = hub->buffer_dma;
hub->urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
/* maybe cycle the hub leds */ /* maybe cycle the hub leds */
if (hub->has_indicators && blinkenlights) if (hub->has_indicators && blinkenlights)
...@@ -1162,8 +1158,7 @@ static void hub_disconnect(struct usb_interface *intf) ...@@ -1162,8 +1158,7 @@ static void hub_disconnect(struct usb_interface *intf)
kfree(hub->port_owners); kfree(hub->port_owners);
kfree(hub->descriptor); kfree(hub->descriptor);
kfree(hub->status); kfree(hub->status);
usb_buffer_free(hub->hdev, sizeof(*hub->buffer), hub->buffer, kfree(hub->buffer);
hub->buffer_dma);
kref_put(&hub->kref, hub_release); kref_put(&hub->kref, hub_release);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment