diff options
author | Krishna Reddy <vdumpa@nvidia.com> | 2012-03-12 17:02:44 -0700 |
---|---|---|
committer | Simone Willett <swillett@nvidia.com> | 2012-03-15 18:39:10 -0700 |
commit | 0aaf8b764a64aabf11a86b28252c24dac8bd16ff (patch) | |
tree | f6f8f8e98420d2e153130c9d365465b613a17e9a /drivers/video/tegra/nvmap | |
parent | 64bd5c31714444a05b1e62057a5d7946114bb73c (diff) |
video: tegra: nvmap: Fix issue in handle_page_alloc
Fix race condition in handle_page_alloc. Page allocations
should not try allocate from pool, once it fails for a
request. If it tries and allocation passes during subsequent
attempts, the page_index is not valid for CPA and cache won't be
flushed for all the necessary pages.
Change-Id: I5548e11b713f271cc8473a3f2ae193a69e832f99
Signed-off-by: Krishna Reddy <vdumpa@nvidia.com>
Reviewed-on: http://git-master/r/89611
Reviewed-by: Simone Willett <swillett@nvidia.com>
Tested-by: Simone Willett <swillett@nvidia.com>
Diffstat (limited to 'drivers/video/tegra/nvmap')
-rw-r--r-- | drivers/video/tegra/nvmap/nvmap_handle.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/video/tegra/nvmap/nvmap_handle.c b/drivers/video/tegra/nvmap/nvmap_handle.c index 53640ac58e42..1bc206f6a84f 100644 --- a/drivers/video/tegra/nvmap/nvmap_handle.c +++ b/drivers/video/tegra/nvmap/nvmap_handle.c @@ -379,11 +379,12 @@ static int handle_page_alloc(struct nvmap_client *client, pages[i] = nvmap_page_pool_alloc( &share->uc_pool); - if (pages[i]) { - page_index++; - continue; - } + if (!pages[i]) + break; + page_index++; + } + for (; i < nr_page; i++) { pages[i] = nvmap_alloc_pages_exact(GFP_NVMAP, PAGE_SIZE); if (!pages[i]) |