From: Julien Grall <julien.grall@linaro.org>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
Zoltan Kiss <zoltan.kiss@linaro.org>
Cc: xen-devel@lists.xenproject.org
Subject: Re: dma_map_single returns 0 on ARM
Date: Sun, 26 Oct 2014 20:39:23 +0000 [thread overview]
Message-ID: <544D5BFB.6090306@linaro.org> (raw)
In-Reply-To: <alpine.DEB.2.02.1410251505050.22875@kaball.uk.xensource.com>
Hi all,
On 25/10/2014 15:11, Stefano Stabellini wrote:
> On Fri, 24 Oct 2014, Zoltan Kiss wrote:
>> Hi,
>>
>> I'm trying to fire up the Ethernet port of a Hisilicon D01 board, and it fails
>> when it wants to map the buffers to the device:
>>
>> phys = dma_map_single(&ndev->dev, priv->rx_buf[i],
>> RX_BUF_SIZE, DMA_FROM_DEVICE);
>>
>> This returns 0, while running on bare metal it works. Does anyone has an
>> advice where should I look?
>
> dma_map_single should just be a wrapper around dma_ops->map_page that in
> dom0 is implemented by xen_swiotlb_map_page.
> From looking at the code the issue appears to be that dma_capable
> returns false for your device.
>
> In any case even if dma_map_single returned a valid address, keep in
> mind that at the moment if the device is not dma coherent Linux needs
> to be compiled with CONFIG_ARM_LPAE to be able to cache flush the
> buffers correctly. But the failure in that case is a memory corruption
> after the dma request is completed.
There is no memory corruption if CONFIG_ARM_LPAE is not enabled. It will
make crash DOM0 because of a BUG_ON in the swiotlb code (checking
truncation between DMA and physical address). This would happen on
platform where there is ram bank above 4G and when a guest is booting.
This option is only necessary for 3.17. Using 3.16 will throw lots of
warning because netback is mapping multiple time the same grant. Linux
3.15 and backwards will be "safe".
Regards,
--
Julien Grall
next prev parent reply other threads:[~2014-10-26 20:39 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-24 16:40 dma_map_single returns 0 on ARM Zoltan Kiss
2014-10-25 14:11 ` Stefano Stabellini
2014-10-26 20:39 ` Julien Grall [this message]
2014-10-27 4:42 ` manish jaggi
2014-10-27 15:45 ` Stefano Stabellini
2014-10-27 15:30 ` Zoltan Kiss
2014-10-27 15:44 ` Stefano Stabellini
2014-10-27 15:58 ` Zoltan Kiss
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=544D5BFB.6090306@linaro.org \
--to=julien.grall@linaro.org \
--cc=stefano.stabellini@eu.citrix.com \
--cc=xen-devel@lists.xenproject.org \
--cc=zoltan.kiss@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.