[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5A03AFA0.5090505@huawei.com>
Date: Thu, 9 Nov 2017 09:30:08 +0800
From: "Wei Hu (Xavier)" <xavier.huwei@...wei.com>
To: Jason Gunthorpe <jgg@...pe.ca>
CC: Robin Murphy <robin.murphy@....com>,
Leon Romanovsky <leon@...nel.org>, <shaobo.xu@...el.com>,
<xavier.huwei@....com>, <lijun_nudt@....com>, <oulijun@...wei.com>,
<linux-rdma@...r.kernel.org>, <charles.chenxin@...wei.com>,
<linuxarm@...wei.com>, <iommu@...ts.linux-foundation.org>,
<linux-kernel@...r.kernel.org>, <linux-mm@...ck.org>,
<dledford@...hat.com>, <liuyixian@...wei.com>,
<zhangxiping3@...wei.com>, <shaoboxu@....com>
Subject: Re: [PATCH for-next 2/4] RDMA/hns: Add IOMMU enable support in hip08
On 2017/11/7 23:48, Jason Gunthorpe wrote:
> On Tue, Nov 07, 2017 at 10:45:29AM +0800, Wei Hu (Xavier) wrote:
>
>> We reconstruct the code as below:
>> It replaces dma_alloc_coherent with __get_free_pages and
>> dma_map_single functions. So, we can vmap serveral ptrs returned by
>> __get_free_pages, right?
> Can't you just use vmalloc and dma_map that? Other drivers follow that
> approach..
>
> However, dma_alloc_coherent and dma_map_single are not the same
> thing. You can't touch the vmap memory once you call dma_map unless
> the driver also includes dma cache flushing calls in all the right
> places.
>
> The difference is that alloc_coherent will return non-cachable memory
> if necessary, while get_free_pages does not.
>
> Jason
Hi, Jason
Thanks for your suggestion.
We will fix it.
Regards
Wei Hu
>
> .
>
Powered by blists - more mailing lists