[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <C81BFF40-13C9-4C7E-BE98-0DAE9221E324@public-files.de>
Date: Wed, 15 Jun 2022 16:46:03 +0200
From: Frank Wunderlich <frank-w@...lic-files.de>
To: Christoph Hellwig <hch@....de>, Robin Murphy <robin.murphy@....com>
CC: linux-kernel@...r.kernel.org, iommu@...ts.linux-foundation.org,
Marek Szyprowski <m.szyprowski@...sung.com>
Subject: Re: helping with remapping vmem for dma
Am 15. Juni 2022 15:17:00 MESZ schrieb Christoph Hellwig <hch@....de>:
>On Wed, Jun 15, 2022 at 02:15:33PM +0100, Robin Murphy wrote:
>> Put simply, if you want to call dma_map_single() on a buffer, then that
>> buffer needs to be allocated with kmalloc() (or technically alloc_pages(),
>> but then dma_map_page() would make more sense when dealing with entire
>> pages.
>
>Yes. It sounds like the memory here comes from the dma coherent
>allocator, in which case the code need to use the address returned
>by that and not create another mapping.
As i have not found position where memory is allocated (this is a very huge and dirty driver) is it maybe possible to check if buf is such "allready dma" memory (maybe is_vmalloc_addr) and call dma_single_map only if not (using original buf if yes)?
But i guess it should map only a part of available (pre-allocated) memory and other parts of this are used somewhere else. So i can ran into some issues caused by sharing this full block in different functions.
Hi,
Thanks for first suggestions.
regards Frank
Powered by blists - more mailing lists