From mboxrd@z Thu Jan 1 00:00:00 1970 From: harry Subject: Re: USB virt status --- Help please!!! Date: Mon, 14 Nov 2005 10:27:15 +0000 Message-ID: <1131964035.28635.6.camel@localhost.localdomain> References: <1131906498.7898.20.camel@localhost> <1131963126.28635.3.camel@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1131963126.28635.3.camel@localhost.localdomain> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser Cc: Ian Pratt , xen-devel@lists.xensource.com, mark.williamson@cl.cam.ac.uk, sanjay.kushwaha@gmail.com List-Id: xen-devel@lists.xenproject.org On Mon, 2005-11-14 at 10:12 +0000, harry wrote: > On Mon, 2005-11-14 at 09:56 +0000, Keir Fraser wrote: > > On 13 Nov 2005, at 18:28, Harry Butterworth wrote: > > > > > Is this the right approach? Is the check in dma_map_single overzealous? > > > > When running on Xen, just because Linux has allocated adjacent pages > > from its 'physical' memory map, doesn't mean they really are physically > > contiguous. For I/O we have to go to extra effort to really allocate > > truly contiguous multi-page extents. > > > > So your code is correct. If you can preallocate buffers then you could > > do that with dma_alloc_coherent and that would guarantee contigous > > buffers.... > > I'm given the buffers by the assorted USB drivers. I could stage the > data using memcpy into my own buffer allocated using dma_alloc_coherent. > Or should I go through all the USB drivers and change the buffer > allocation? It looks like there is an operation usb_buffer_alloc which I can implement to give the right kind of buffers to clients. Any buffers not allocated from here can be staged. Should hopefully be OK.