From: Stefano Stabellini Subject: Re: cubieboard2's sd/mmc driver on xen about DMA read data error Date: Thu, 3 Apr 2014 11:17:12 +0100 Message-ID: References: <1396423235.26869.60.camel@dagon.hellion.org.uk> <533BDBF7.5000309@linaro.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="1342847746-265050033-1396520232=:9060" Return-path: In-Reply-To: <533BDBF7.5000309@linaro.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Julien Grall Cc: =?UTF-8?B?5p2c55Cq?= , "xen-devel@lists.xen.org" , Stefano Stabellini , Ian Campbell , "bjzhang@suse.com" List-Id: xen-devel@lists.xenproject.org --1342847746-265050033-1396520232=:9060 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: QUOTED-PRINTABLE 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, =E6=9D=9C=E7=90=AA wrote: > > > Hi all, >=20 > Hello, >=20 > > > 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. >=20 > Can you give more input? (Xen log, ...) DOM0 has a 1:1 mapping layout, so= the > swiotlb should not change anything. >=20 > With the 1:1 mapping, the driver can safely use DMA, can you try to see w= hich > address is used by the DMA request? >=20 > > 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. >=20 > Using swiotlb everywhere is just too slow. That's why Stefano took an hyb= rid > 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 =3D=3D 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. --1342847746-265050033-1396520232=:9060 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --1342847746-265050033-1396520232=:9060--