From: Logan Gunthorpe <logang@deltatee.com>
To: Arindam Nath <arindam.nath@amd.com>, Jon Mason <jdmason@kudzu.us>,
Dave Jiang <dave.jiang@intel.com>,
Allen Hubbe <allenbh@gmail.com>,
Sanjay R Mehta <sanju.mehta@amd.com>
Cc: linux-ntb@googlegroups.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/4] ntb_perf: pass correct struct device to dma_alloc_coherent
Date: Wed, 5 Feb 2020 11:44:05 -0700 [thread overview]
Message-ID: <761e76e0-2e5e-6c71-3384-1ec10dcf8e88@deltatee.com> (raw)
In-Reply-To: <aa4e69feffab2fd3cd846569e0546c5cf8f8f6b4.1580921119.git.arindam.nath@amd.com>
On 2020-02-05 10:16 a.m., Arindam Nath wrote:
> From: Sanjay R Mehta <sanju.mehta@amd.com>
>
> Currently, ntb->dev is passed to dma_alloc_coherent
> and dma_free_coherent calls. The returned dma_addr_t
> is the CPU physical address. This works fine as long
> as IOMMU is disabled. But when IOMMU is enabled, we
> need to make sure that IOVA is returned for dma_addr_t.
> So the correct way to achieve this is by changing the
> first parameter of dma_alloc_coherent() as ntb->pdev->dev
> instead.
>
> Fixes: 5648e56 ("NTB: ntb_perf: Add full multi-port NTB API support")
> Signed-off-by: Sanjay R Mehta <sanju.mehta@amd.com>
> Signed-off-by: Arindam Nath <arindam.nath@amd.com>
Ugh, this has been fixed repeatedly and independently by a number of
people. I sent a fix[1] in more than a year ago and Sanjay repeated the
effort a couple months ago[2].
I have the same feed back for you that I had for him: once we fix the
bug we should also go in and remove the now unnecessary
dma_coerce_mask_and_coherent() calls in the drivers at the same time
seeing it no longer makes any sense. My patch did this already.
Thanks,
Logan
[1] https://lore.kernel.org/lkml/20190109192233.5752-3-logang@deltatee.com/
[2]
https://lore.kernel.org/lkml/1575983255-70377-1-git-send-email-Sanju.Mehta@amd.com/
next prev parent reply other threads:[~2020-02-05 18:44 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-05 17:16 [PATCH 0/4] ntb perf and ntb tool improvements Arindam Nath
2020-02-05 17:16 ` [PATCH 1/4] ntb_perf: refactor code for CPU and DMA transfers Arindam Nath
2020-02-05 17:16 ` [PATCH 2/4] ntb_perf: send command in response to EAGAIN Arindam Nath
2020-02-05 17:16 ` [PATCH 3/4] ntb_perf: pass correct struct device to dma_alloc_coherent Arindam Nath
2020-02-05 18:44 ` Logan Gunthorpe [this message]
2020-02-07 8:40 ` Nath, Arindam
2020-02-05 17:16 ` [PATCH 4/4] ntb_tool: " Arindam Nath
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=761e76e0-2e5e-6c71-3384-1ec10dcf8e88@deltatee.com \
--to=logang@deltatee.com \
--cc=allenbh@gmail.com \
--cc=arindam.nath@amd.com \
--cc=dave.jiang@intel.com \
--cc=jdmason@kudzu.us \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-ntb@googlegroups.com \
--cc=sanju.mehta@amd.com \
/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
all inboxes | Powered by JetHome®