[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-usb-devel
Subject:    Re: [linux-usb-devel] [PATCH][2/4] usb: only set
From:       Alan Stern <stern () rowland ! harvard ! edu>
Date:       2008-01-25 16:55:57
Message-ID: Pine.LNX.4.44L0.0801251136290.5166-100000 () iolanthe ! rowland ! org
[Download RAW message or body]

On Sat, 26 Jan 2008, Magnus Damm wrote:

> Alan and David, thanks for your comments.
> 
> The HCD_LOCAL_MEM code only copies data into the bounce buffers if
> URB_NO_TRANSFER_DMA_MAP is unset. If that flag is set then the code
> expects the buffer to have been allocated using dma_alloc_coherent()
> and therefore there is no point in copying it. Or mapping it, as the
> original dma map code did. Anyway, so having that flag set even though
> dma is disabled and the dma handle invalid (data is not at all in
> buffers allocated using dma_alloc_coherent) breaks usb storage for
> ohci-sm501.

If usb-storage breaks then won't other drivers like ub break as well?  
The documentation for URB_NO_TRANSFER_DMA_MAP and URB_NO_SETUP_DMA_MAP
says only that the DMA handle must be valid; it doesn't say that the
buffer had to allocated by usb_buffer_alloc(), hcd_buffer_alloc(), or
dma_alloc_coherent().

Now, there's nothing wrong with your patch.  It avoids setting 
URB_NO_TRANSFER_DMA_MAP when the DMA handle is invalid.  But the way 
you are overloading the meaning of that flag could easily lead to 
problems with other drivers.

Alan Stern


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic