]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
video: tegra: host: add cpuva checks for gathers
authorDeepak Nibade <dnibade@nvidia.com>
Thu, 27 Mar 2014 12:41:28 +0000 (18:11 +0530)
committerTodd Poynter <tpoynter@nvidia.com>
Mon, 23 Jun 2014 20:06:19 +0000 (13:06 -0700)
Add check for cpuva before calling dma_buf_vunmap()
Also, condition to call trace_write_gather() should
check for cpuva address and not iova

Bug 1481669

Change-Id: I585eff8f96edad7b89714133fb5b55f62a86cabb
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/387720
(cherry picked from commit e1cc77b87b23c9ef1028cba2fbda9e9cb0ba248e)
Reviewed-on: http://git-master/r/427119
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Mitch Luban <mluban@nvidia.com>
Tested-by: Mitch Luban <mluban@nvidia.com>
drivers/video/tegra/host/host1x/host1x_channel.c
drivers/video/tegra/host/nvhost_cdma.c

index e7b292922123c747dbd12719fb08f6f1a036eb98..9d8156ea6a3eb1a932d3f1a6a1eb9c5e69c656b8 100644 (file)
@@ -273,7 +273,8 @@ static void submit_gathers(struct nvhost_job *job)
                                job->gathers[i].mem_base,
                                g->offset,
                                op1, op2);
-               dma_buf_vunmap(g->buf, cpuva);
+               if (cpuva)
+                       dma_buf_vunmap(g->buf, cpuva);
        }
 }
 
index eb81f017149010c5e4577f2c77b5180f5241ce92..c318ed0a0ebf7bfe54036991be4505186d41ab4a 100644 (file)
@@ -472,7 +472,7 @@ void nvhost_cdma_push_gather(struct nvhost_cdma *cdma,
        u32 slots_free = cdma->slots_free;
        struct push_buffer *pb = &cdma->push_buffer;
 
-       if (iova)
+       if (cpuva)
                trace_write_gather(cdma, cpuva, iova, offset, op1 & 0x1fff);
 
        if (slots_free == 0) {