]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
gpu: nvgpu: While flushing, check only enabled L2s
authorTerje Bergstrom <tbergstrom@nvidia.com>
Wed, 17 Jun 2015 20:23:19 +0000 (13:23 -0700)
committerTerje Bergstrom <tbergstrom@nvidia.com>
Fri, 26 Jun 2015 18:06:15 +0000 (11:06 -0700)
When flushing L2 do not check status of L2s not present in system.

Change-Id: I95703689314c146f591fea0d85b1a484fdf82cf7
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/759264
Reviewed-by: Automatic_Commit_Validation_User
drivers/gpu/nvgpu/gm20b/ltc_gm20b.c

index bc904ef34b7add0ef338f740d7f91d65ce870d8b..9c250a7d8bbfd6f614c53228ff81df66e960a4c5 100644 (file)
@@ -284,8 +284,8 @@ u32 gm20b_ltc_cbc_fix_config(struct gk20a *g, int base)
  */
 void gm20b_flush_ltc(struct gk20a *g)
 {
-       u32 op_pending;
        unsigned long timeout;
+       int ltc;
 
 #define __timeout_init()                               \
        do {                                            \
@@ -310,19 +310,18 @@ void gm20b_flush_ltc(struct gk20a *g)
                ltc_ltcs_ltss_tstg_cmgmt1_clean_evict_first_class_true_f());
 
        /* Wait on each LTC individually. */
-       __timeout_init();
-       do {
-               op_pending = gk20a_readl(g, ltc_ltc0_ltss_tstg_cmgmt1_r());
-               __timeout_check();
-       } while (op_pending &
-                ltc_ltc0_ltss_tstg_cmgmt1_clean_pending_f());
-
-       __timeout_init();
-       do {
-               op_pending = gk20a_readl(g, ltc_ltc1_ltss_tstg_cmgmt1_r());
-               __timeout_check();
-       } while (op_pending &
-                ltc_ltc1_ltss_tstg_cmgmt1_clean_pending_f());
+       for (ltc = 0; ltc < g->ltc_count; ltc++) {
+               u32 op_pending;
+
+               __timeout_init();
+               do {
+                       int cmgmt1 = ltc_ltc0_ltss_tstg_cmgmt1_r() +
+                                    ltc * proj_ltc_stride_v();
+                       op_pending = gk20a_readl(g, cmgmt1);
+                       __timeout_check();
+               } while (op_pending &
+                        ltc_ltc0_ltss_tstg_cmgmt1_clean_pending_f());
+       }
 
        /* And invalidate. */
        gk20a_writel(g, ltc_ltcs_ltss_tstg_cmgmt0_r(),
@@ -333,19 +332,17 @@ void gm20b_flush_ltc(struct gk20a *g)
             ltc_ltcs_ltss_tstg_cmgmt0_invalidate_evict_first_class_true_f());
 
        /* Wait on each LTC individually. */
-       __timeout_init();
-       do {
-               op_pending = gk20a_readl(g, ltc_ltc0_ltss_tstg_cmgmt0_r());
-               __timeout_check();
-       } while (op_pending &
-                ltc_ltc0_ltss_tstg_cmgmt0_invalidate_pending_f());
-
-       __timeout_init();
-       do {
-               op_pending = gk20a_readl(g, ltc_ltc1_ltss_tstg_cmgmt0_r());
-               __timeout_check();
-       } while (op_pending &
-                ltc_ltc1_ltss_tstg_cmgmt0_invalidate_pending_f());
+       for (ltc = 0; ltc < g->ltc_count; ltc++) {
+               u32 op_pending;
+               __timeout_init();
+               do {
+                       int cmgmt0 = ltc_ltc0_ltss_tstg_cmgmt0_r() +
+                                    ltc * proj_ltc_stride_v();
+                       op_pending = gk20a_readl(g, cmgmt0);
+                       __timeout_check();
+               } while (op_pending &
+                        ltc_ltc0_ltss_tstg_cmgmt0_invalidate_pending_f());
+       }
 }
 
 static int gm20b_determine_L2_size_bytes(struct gk20a *g)