From d059cdbc44dbf93ddde427410e4361f908e92cbc Mon Sep 17 00:00:00 2001 From: Nicolin Chen Date: Mon, 15 Apr 2019 13:11:23 -0700 Subject: [PATCH] platform: nvadsp: Remove iova lucky check The logic of the nvadsp_dma_alloc_and_map_at() function is to firstly reserve the target iova and secondly allocate a memory with another dynamical iova. Since the target iova is reserved, the dynamical iova won't be possible to be identical. And this lucky check lacks of an exit routine either. So this patch just drops it. Bug 200444660 Change-Id: I5c45e72b1e7315dacd8708fc8facf6bda41c51e5 Signed-off-by: Nicolin Chen Reviewed-on: https://git-master.nvidia.com/r/2098219 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Krishna Reddy Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/platform/tegra/nvadsp/os.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/platform/tegra/nvadsp/os.c b/drivers/platform/tegra/nvadsp/os.c index 55ec92d5..fd402397 100644 --- a/drivers/platform/tegra/nvadsp/os.c +++ b/drivers/platform/tegra/nvadsp/os.c @@ -645,10 +645,6 @@ static void *nvadsp_dma_alloc_and_map_at(struct platform_device *pdev, if (!cpu_va) goto fail_dma_alloc; - /* Luckily hitting the target iova, no need to remap */ - if (tmp_iova == iova) - return cpu_va; - /* Use tmp_iova to remap non-contiguous pages to the desired iova */ for (offset = 0; offset < size; offset += mp_size) { dma_addr_t cur_iova = tmp_iova + offset;