[PATCH][2/4] usb: only set URB_NO_TRANSFER_DMA_MAP when dma is enabled

Magnus Damm <[email protected]> Mon, 14 Jan 2008 11:08:48 +0900
Newsgroups gmane.linux.usb.devel
Message-ID <[email protected]>
usb: only set URB_NO_TRANSFER_DMA_MAP when dma is enabled

usb_sg_init() currently sets URB_NO_TRANSFER_DMA_MAP even if dma isn't
enabled. This patch changes the code so URB_NO_TRANSFER_DMA_MAP gets
set only when dma is enabled and transfer_dma is valid.

Signed-off-by: Magnus Damm <[email protected]>
---

 drivers/usb/core/message.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- 0001/drivers/usb/core/message.c
+++ work/drivers/usb/core/message.c	2008-01-13 18:53:13.000000000 +0900
@@ -394,7 +394,7 @@ int usb_sg_init (
 	if (!io->urbs)
 		goto nomem;
 
-	urb_flags = URB_NO_TRANSFER_DMA_MAP | URB_NO_INTERRUPT;
+	urb_flags = URB_NO_INTERRUPT;
 	if (usb_pipein (pipe))
 		urb_flags |= URB_SHORT_NOT_OK;
 
@@ -432,6 +432,7 @@ int usb_sg_init (
 		 * to prevent stale pointers and to help spot bugs.
 		 */
 		if (dma) {
+			io->urbs[i]->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
 			io->urbs [i]->transfer_dma = sg_dma_address (sg + i);
 			len = sg_dma_len (sg + i);
 #if defined(CONFIG_HIGHMEM) || defined(CONFIG_GART_IOMMU)

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel