]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
gpu: nvgpu: Call ELPG enable/disable on condition
authorMahantesh Kumbar <mkumbar@nvidia.com>
Tue, 1 Mar 2016 06:17:31 +0000 (11:47 +0530)
committermobile promotions <svcmobile_promotions@nvidia.com>
Fri, 4 Mar 2016 04:55:11 +0000 (20:55 -0800)
Call ELPG enable/disable if ELPG support enabled else ignore

Bug 200156347

Change-Id: Iaf380e17b85f7322437f9ce09507a88557b738ca
Signed-off-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-on: http://git-master/r/1021902
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Kerwin Wan <kerwinw@nvidia.com>
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
drivers/gpu/nvgpu/gk20a/fifo_gk20a.c
drivers/gpu/nvgpu/gk20a/gr_gk20a.h

index fd1ff64f93fa9fa0af95279dded87d92a8ea81b5..a1ac9f25be6d66ff437df220f18b4bf244ee858e 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * GK20A Graphics FIFO (gr host)
  *
- * Copyright (c) 2011-2015, NVIDIA CORPORATION.  All rights reserved.
+ * Copyright (c) 2011-2016, NVIDIA CORPORATION.  All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
@@ -777,6 +777,7 @@ void gk20a_fifo_reset_engine(struct gk20a *g, u32 engine_id)
                        /* resetting engine using mc_enable_r() is not
                        enough, we do full init sequence */
                        gk20a_gr_reset(g);
+               if (support_gk20a_pmu(g->dev) && g->elpg_enabled)
                        gk20a_pmu_enable_elpg(g);
        }
        if (engine_id == top_device_info_type_enum_copy0_v())
index 8f61b585ee36d4f4937e4bd37be94d009b870f5f..257dfb84903fc436e1ee5a9134663d024e0d3786 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * GK20A Graphics Engine
  *
- * Copyright (c) 2011-2015, NVIDIA CORPORATION.  All rights reserved.
+ * Copyright (c) 2011-2016, NVIDIA CORPORATION.  All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
@@ -444,14 +444,15 @@ bool gk20a_gr_sm_debugger_attached(struct gk20a *g);
 #define gr_gk20a_elpg_protected_call(g, func) \
        ({ \
                int err = 0; \
-               if (support_gk20a_pmu(g->dev)) \
+               if (support_gk20a_pmu(g->dev) && g->elpg_enabled) { \
                        err = gk20a_pmu_disable_elpg(g); \
-               if (err) { \
-                       gk20a_pmu_enable_elpg(g); \
-                       return err; \
+                       if (err) { \
+                               gk20a_pmu_enable_elpg(g); \
+                               return err; \
+                       } \
                } \
                err = func; \
-               if (support_gk20a_pmu(g->dev)) \
+               if (support_gk20a_pmu(g->dev) && g->elpg_enabled) \
                        gk20a_pmu_enable_elpg(g); \
                err; \
        })