Revert "video: tegra: nvmap: Add flag to skip cache cleaning at alloc"

This reverts commit fcb299a9cd.

Reason for revert: The zeroed memory may not reflect in case of non-coherent devices

Bug 4628529

Change-Id: I6bb0c10ebf273a912e71b8252a5ddfd33c70e1fe
Signed-off-by: Ketan Patil <ketanp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3197357
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Pritesh Raithatha <praithatha@nvidia.com>
This commit is contained in:
Ketan Patil
2024-08-20 21:29:42 -07:00
committed by mobile promotions
parent 612482b7df
commit 644d35281a
2 changed files with 10 additions and 15 deletions

View File

@@ -124,9 +124,7 @@ static int handle_page_alloc(struct nvmap_client *client,
for (idx = 0; idx < pages_per_big_pg; idx++)
pages[i + idx] = nth_page(page, idx);
if ((h->userflags & NVMAP_HANDLE_SKIP_CACHE_CLEAN) == 0)
nvmap_clean_cache(&pages[i], pages_per_big_pg);
nvmap_clean_cache(&pages[i], pages_per_big_pg);
}
nvmap_big_page_allocs += page_index;
#endif /* CONFIG_ARM64_4K_PAGES */
@@ -153,17 +151,15 @@ static int handle_page_alloc(struct nvmap_client *client,
nvmap_total_page_allocs += nr_page;
}
if ((h->userflags & NVMAP_HANDLE_SKIP_CACHE_CLEAN) == 0) {
/*
* Make sure any data in the caches is cleaned out before
* passing these pages to userspace. Many nvmap clients assume that
* the buffers are clean as soon as they are allocated. nvmap
* clients can pass the buffer to hardware as it is without any
* explicit cache maintenance.
*/
if (page_index < nr_page)
nvmap_clean_cache(&pages[page_index], nr_page - page_index);
}
/*
* Make sure any data in the caches is cleaned out before
* passing these pages to userspace. Many nvmap clients assume that
* the buffers are clean as soon as they are allocated. nvmap
* clients can pass the buffer to hardware as it is without any
* explicit cache maintenance.
*/
if (page_index < nr_page)
nvmap_clean_cache(&pages[page_index], nr_page - page_index);
h->pgalloc.pages = pages;
h->pgalloc.contig = contiguous;

View File

@@ -43,7 +43,6 @@
#define NVMAP_HANDLE_CACHE_SYNC (0x1ul << 7)
#define NVMAP_HANDLE_CACHE_SYNC_AT_RESERVE (0x1ul << 8)
#define NVMAP_HANDLE_RO (0x1ul << 9)
#define NVMAP_HANDLE_SKIP_CACHE_CLEAN (0x1ul << 10)
#ifdef NVMAP_CONFIG_PAGE_POOLS
ulong nvmap_page_pool_get_unused_pages(void);