[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <MN2PR12MB323292771789FEBE5EEFCD439C1C0@MN2PR12MB3232.namprd12.prod.outlook.com>
Date: Fri, 7 Feb 2020 08:40:34 +0000
From: "Nath, Arindam" <Arindam.Nath@....com>
To: Logan Gunthorpe <logang@...tatee.com>,
Jon Mason <jdmason@...zu.us>,
Dave Jiang <dave.jiang@...el.com>,
Allen Hubbe <allenbh@...il.com>,
"Mehta, Sanju" <Sanju.Mehta@....com>
CC: "linux-ntb@...glegroups.com" <linux-ntb@...glegroups.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH 3/4] ntb_perf: pass correct struct device to
dma_alloc_coherent
[AMD Official Use Only - Internal Distribution Only]
> -----Original Message-----
> From: Logan Gunthorpe <logang@...tatee.com>
> Sent: Thursday, February 6, 2020 00:14
> To: Nath, Arindam <Arindam.Nath@....com>; Jon Mason
> <jdmason@...zu.us>; Dave Jiang <dave.jiang@...el.com>; Allen Hubbe
> <allenbh@...il.com>; Mehta, Sanju <Sanju.Mehta@....com>
> Cc: linux-ntb@...glegroups.com; linux-kernel@...r.kernel.org
> Subject: Re: [PATCH 3/4] ntb_perf: pass correct struct device to
> dma_alloc_coherent
>
>
>
> On 2020-02-05 10:16 a.m., Arindam Nath wrote:
> > From: Sanjay R Mehta <sanju.mehta@....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@....com>
> > Signed-off-by: Arindam Nath <arindam.nath@....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. I will include your patches in my next version of the set,
and mention you in the "From" tag.
Arindam
>
> Thanks,
>
> Logan
>
> [1]
> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flore.
> kernel.org%2Flkml%2F20190109192233.5752-3-
> logang%40deltatee.com%2F&data=02%7C01%7Carindam.nath%40amd.
> com%7Cabc7298c86c54b82db1a08d7aa6b66aa%7C3dd8961fe4884e608e11a82
> d994e183d%7C0%7C0%7C637165251004193969&sdata=52DOTHpKjseZjv
> E6jmWWVVLQLeRiaykbVTQipGQbLT0%3D&reserved=0
> [2]
> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flore.
> kernel.org%2Flkml%2F1575983255-70377-1-git-send-email-
> Sanju.Mehta%40amd.com%2F&data=02%7C01%7Carindam.nath%40am
> d.com%7Cabc7298c86c54b82db1a08d7aa6b66aa%7C3dd8961fe4884e608e11a
> 82d994e183d%7C0%7C0%7C637165251004193969&sdata=RFR%2BLFp5a
> ON1MA4Erx4soqL9pLHc%2BLWVNuLY0%2B0zcbo%3D&reserved=0
Powered by blists - more mailing lists