tegra: hwpm: update dma vmap for kernel > 5.10

Kernel version beyond 5.10 introduces dma_buf_map structure (called
iosys_map in later versions). Kernel virtual address corresponding to a
dma_buf is stored in the dma_buf_map structure.
- This patch updates memory management function to use correct mem bytes
buffer kernel virtual address stored in the corresponding dma_buf_map
structure.
- Use dma_buf_map structure pointer to unmap kernel virtual address.
- During release, poll mem bytes buffer with finite timeout value.
- Add description for use of dma_set_mask_and_coherent.

Bug 3893741

Change-Id: I42ace2fe70b36d7d5d1a4c5fee21786826f24a07
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
(cherry picked from commit ce852be6b39ef39affccdee41ad436fc70bf86b5)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-hwpm/+/2847007
Reviewed-by: Seema Khowala <seemaj@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
Vedashree Vidwans
2022-12-15 21:14:47 -08:00
committed by mobile promotions
parent 7a89f70da6
commit f010cf5956
3 changed files with 33 additions and 14 deletions

View File

@@ -42,9 +42,9 @@ struct tegra_hwpm_mem_mgmt {
struct dma_buf_attachment *stream_attach;
u64 stream_buf_size;
u64 stream_buf_va;
u64 mem_bytes_buf_va;
struct dma_buf *mem_bytes_dma_buf;
struct dma_buf_attachment *mem_bytes_attach;
u64 mem_bytes_buf_va;
void *mem_bytes_kernel;
#if defined(CONFIG_TEGRA_HWPM_OOT)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0)