]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
gpu: nvgpu: gk20a: dma_alloc only if needed
authorBibek Basu <bbasu@nvidia.com>
Fri, 22 May 2015 09:55:53 +0000 (15:25 +0530)
committerMatthew Pedro <mapedro@nvidia.com>
Fri, 5 Jun 2015 04:01:41 +0000 (21:01 -0700)
if vpr memory is carved out, then only call dma_alloc
for secure memory.

Bug 200057068

Change-Id: I12557cfaa48f7db729ccab17d3151916d35ce0f1
Signed-off-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-on: http://git-master/r/746153
GVS: Gerrit_Virtual_Submit
Reviewed-by: Venkat Moganty <vmoganty@nvidia.com>
arch/arm/mach-tegra/common.c
drivers/gpu/nvgpu/gk20a/gk20a.c
drivers/gpu/nvgpu/gk20a/platform_gk20a_tegra.c

index 07faddfcfd7048ebf31aeea6d620a516e0d54f68..542e2b6dbcc780e4fb2a5c9e6367ad79013e220e 100644 (file)
@@ -135,6 +135,7 @@ phys_addr_t tegra_carveout_start;
 phys_addr_t tegra_carveout_size;
 phys_addr_t tegra_vpr_start;
 phys_addr_t tegra_vpr_size;
+EXPORT_SYMBOL(tegra_vpr_size);
 phys_addr_t tegra_tsec_start;
 phys_addr_t tegra_tsec_size;
 phys_addr_t tegra_lp0_vec_start;
index 03d466ef3dc893a5af665eb5498dde0cb452a0d1..f5f2c130241d1e3c334f19f1eda9588a737fda02 100644 (file)
@@ -1310,11 +1310,10 @@ int gk20a_secure_page_alloc(struct platform_device *pdev)
                udelay(10);
                err = platform->secure_page_alloc(pdev);
                tegra_periph_reset_deassert(platform->clk[0]);
+               if (!err)
+                       platform->secure_alloc_ready = true;
        }
 
-       if (!err)
-               platform->secure_alloc_ready = true;
-
        return err;
 }
 
index edeacdac6e5c6c3658d5974398d4c0fd5bdef919..c94d35176c11402da98d9fcab7dda72406269962 100644 (file)
@@ -39,6 +39,7 @@
 #define TEGRA_GK20A_SIM_SIZE 0x1000     /*tbd: this is a high-side guess */
 
 extern struct device tegra_vpr_dev;
+extern phys_addr_t tegra_vpr_size;
 struct gk20a_platform t132_gk20a_tegra_platform;
 
 struct gk20a_emc_params {
@@ -457,6 +458,8 @@ static int gk20a_tegra_probe(struct platform_device *dev)
                *platform = t132_gk20a_tegra_platform;
        }
 
+       if (tegra_vpr_size == 0)
+               platform->secure_page_alloc = NULL;
        gk20a_tegra_get_clocks(dev);
 
        return 0;