From: Gavin Shan <gwshan@linux.vnet.ibm.com>
To: Benjamin Herrenschmidt <benh@au1.ibm.com>
Cc: IanJiang <ianjiang.cn@gmail.com>, linuxppc-dev@ozlabs.org
Subject: Re: EEH error in doing DMA with PEX 8619
Date: Tue, 11 Apr 2017 14:42:38 +1000 [thread overview]
Message-ID: <20170411044238.GA8157@gwshan> (raw)
In-Reply-To: <1491876910.4166.219.camel@au1.ibm.com>
On Tue, Apr 11, 2017 at 12:15:10PM +1000, Benjamin Herrenschmidt wrote:
>On Mon, 2017-04-10 at 19:04 -0700, IanJiang wrote:
>> Thanks for your replay.
>>
>> I fixed my test according your suggestion. The CPU physical addresses (0x
>> 1f9e400000 and 0x 1f82c00000) converted with virt_to_phys() are used ,
>> instead of DMA addresses, or BUS physical addresses (0x 60a00000 and 0x
>> 60c00000). However, EEH still reports error.
>
>That's incorrect. The system has an IOMMU, only addressed properly
>mapped/translated by the IOMMU can be used for DMA. That is addresses
>returned by things like dma_map_single/sg, dma_alloc_coherent, etc...
>
>You also need to ensure you configure a proper dma mask.
>
>Using virt_to_phys() is NEVER correct on *any* architecture.
>
Ben is correct that PCI device needs to use DMA address instead of
memory address. I was suggesting to ensure that in the driver's code
and was misunderstood. It seems the driver has used the DMA address,
which is correct. But it seems the TCE entry for the DMA address isn't
built correctly. Could you please share the kernel log with original
driver code? I am not sure if I can find somethere there, but worthy
to check.
Thanks,
Gavin
next prev parent reply other threads:[~2017-04-11 4:43 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-10 12:22 EEH error in doing DMA with PEX 8619 IanJiang
2017-04-10 22:24 ` Gavin Shan
2017-04-11 2:04 ` IanJiang
2017-04-11 2:15 ` Benjamin Herrenschmidt
2017-04-11 4:42 ` Gavin Shan [this message]
2017-04-11 9:26 ` IanJiang
2017-04-11 9:35 ` Benjamin Herrenschmidt
2017-04-12 1:39 ` IanJiang
2017-04-12 1:50 ` Benjamin Herrenschmidt
2017-04-12 8:42 ` IanJiang
2017-04-12 13:53 ` Benjamin Herrenschmidt
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=20170411044238.GA8157@gwshan \
--to=gwshan@linux.vnet.ibm.com \
--cc=benh@au1.ibm.com \
--cc=ianjiang.cn@gmail.com \
--cc=linuxppc-dev@ozlabs.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).