diff options
author | David Brownell <david-b@pacbell.net> | 2007-07-02 02:33:12 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-07-12 19:34:42 -0400 |
commit | fbf54dd32001359ccda6a9d8577f7b00e67357c7 (patch) | |
tree | ab454ffb4563cdfdccab1f0c221577622a57864f /drivers/usb/core | |
parent | c0e0c19cc9d899da0ee15104907ac158eb94365b (diff) |
USB: usb/dma doc updates
This patch updates some of the documentation about DMA buffer management
for USB, and ways to avoid extra copying. Our understanding of the issues
has improved over time.
- Most drivers should *avoid* the dma-coherent allocators. There are
a few exceptions (like the HID driver).
- Some methods are currently commented out; it seems folk writing
USB drivers aren't doing performance tuning at that level yet.
- Just avoid highmem; there's no good way to pass an "I can do highmem
DMA" capability through a driver stack. This is easy, everything
already avoids highmem. But it'd be nice if x86_32 systems with much
physical memory could use it directly with network adapters and mass
storage devices. (Patch, anyone?)
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/core')
-rw-r--r-- | drivers/usb/core/usb.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c index c611b3cbc67b..0fee5c66fd64 100644 --- a/drivers/usb/core/usb.c +++ b/drivers/usb/core/usb.c | |||
@@ -579,11 +579,12 @@ int __usb_get_extra_descriptor(char *buffer, unsigned size, | |||
579 | * address (through the pointer provided). | 579 | * address (through the pointer provided). |
580 | * | 580 | * |
581 | * These buffers are used with URB_NO_xxx_DMA_MAP set in urb->transfer_flags | 581 | * These buffers are used with URB_NO_xxx_DMA_MAP set in urb->transfer_flags |
582 | * to avoid behaviors like using "DMA bounce buffers", or tying down I/O | 582 | * to avoid behaviors like using "DMA bounce buffers", or thrashing IOMMU |
583 | * mapping hardware for long idle periods. The implementation varies between | 583 | * hardware during URB completion/resubmit. The implementation varies between |
584 | * platforms, depending on details of how DMA will work to this device. | 584 | * platforms, depending on details of how DMA will work to this device. |
585 | * Using these buffers also helps prevent cacheline sharing problems on | 585 | * Using these buffers also eliminates cacheline sharing problems on |
586 | * architectures where CPU caches are not DMA-coherent. | 586 | * architectures where CPU caches are not DMA-coherent. On systems without |
587 | * bus-snooping caches, these buffers are uncached. | ||
587 | * | 588 | * |
588 | * When the buffer is no longer used, free it with usb_buffer_free(). | 589 | * When the buffer is no longer used, free it with usb_buffer_free(). |
589 | */ | 590 | */ |
@@ -608,7 +609,7 @@ void *usb_buffer_alloc( | |||
608 | * | 609 | * |
609 | * This reclaims an I/O buffer, letting it be reused. The memory must have | 610 | * This reclaims an I/O buffer, letting it be reused. The memory must have |
610 | * been allocated using usb_buffer_alloc(), and the parameters must match | 611 | * been allocated using usb_buffer_alloc(), and the parameters must match |
611 | * those provided in that allocation request. | 612 | * those provided in that allocation request. |
612 | */ | 613 | */ |
613 | void usb_buffer_free( | 614 | void usb_buffer_free( |
614 | struct usb_device *dev, | 615 | struct usb_device *dev, |