[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] cubieboard2's sd/mmc driver on xen about DMA read data error



On Wed, 2 Apr 2014, Julien Grall wrote:
> On 02/04/14 08:20, Ian Campbell wrote:
> > On Wed, 2014-04-02 at 00:10 +0800, æç wrote:
> > > Hi all,
> 
> Hello,
> 
> > >       I have got this kernel with mmc driver on cubieboard2 from :
> > > https://github.com/jwrdegoede/linux-sunxi.git  (test branch) .
> > >       I  have made the Xen's Dom0 configuration according
> > > this :http://wiki.xenproject.org/wiki/Mainline_Linux_Kernel_Configs.
> > > and the kernel can be booted by Xen4.4.
> > >       The question we met is that some CMD can be
> > > accepted(CMD7,CMD0 ....) and but some can't(CMD52,CMD5,CMD51).
> > >       We have found that the CMD51 is attempted to read the data from
> > > SD card to memory through DMA , so we replaced all the dma_ops with
> > > xen_dma_ops , where it is in struct "dma_map_ops xen_swiotlb_dma_ops"
> > > in arch/arm/xen/mm.c.
> 
> Can you give more input? (Xen log, ...) DOM0 has a 1:1 mapping layout, so the
> swiotlb should not change anything.
> 
> With the 1:1 mapping, the driver can safely use DMA, can you try to see which
> address is used by the DMA request?
> 
> > Do I understand correctly that you have solved the issue by doing this?
> > If so then please could you send a patch. The process for submitting a
> > patch to Linux is described in Documentation/SubmittingPatches.
> 
> Using swiotlb everywhere is just too slow. That's why Stefano took an hybrid
> approach (1:1 mapping + bouncing for foreign pages).

That is correct: for normal dom0 DMA operations, we just rely on the
dom0 1:1 mapping (guest physical addresses == machine addresses).
We use the swiotlb-xen only to bounce DMA requests that involve foreign
pages: pages belonging to other guests but mapped in dom0 do not belong
to the 1:1 mapping, hence they need the swiotlb.

So if you are just doing DMA in Dom0 and you haven't even started a
second guest yet, you shouldn't need the swiotlb-xen.
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.