diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/mm_gk20a.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c index f588d112..0d68464d 100644 --- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c | |||
@@ -2950,9 +2950,13 @@ static void gk20a_mm_l2_invalidate_locked(struct gk20a *g) | |||
2950 | void gk20a_mm_l2_invalidate(struct gk20a *g) | 2950 | void gk20a_mm_l2_invalidate(struct gk20a *g) |
2951 | { | 2951 | { |
2952 | struct mm_gk20a *mm = &g->mm; | 2952 | struct mm_gk20a *mm = &g->mm; |
2953 | mutex_lock(&mm->l2_op_lock); | 2953 | gk20a_busy_noresume(g->dev); |
2954 | gk20a_mm_l2_invalidate_locked(g); | 2954 | if (g->power_on) { |
2955 | mutex_unlock(&mm->l2_op_lock); | 2955 | mutex_lock(&mm->l2_op_lock); |
2956 | gk20a_mm_l2_invalidate_locked(g); | ||
2957 | mutex_unlock(&mm->l2_op_lock); | ||
2958 | } | ||
2959 | pm_runtime_put_noidle(&g->dev->dev); | ||
2956 | } | 2960 | } |
2957 | 2961 | ||
2958 | void gk20a_mm_l2_flush(struct gk20a *g, bool invalidate) | 2962 | void gk20a_mm_l2_flush(struct gk20a *g, bool invalidate) |
@@ -2963,6 +2967,10 @@ void gk20a_mm_l2_flush(struct gk20a *g, bool invalidate) | |||
2963 | 2967 | ||
2964 | gk20a_dbg_fn(""); | 2968 | gk20a_dbg_fn(""); |
2965 | 2969 | ||
2970 | gk20a_busy_noresume(g->dev); | ||
2971 | if (!g->power_on) | ||
2972 | goto hw_was_off; | ||
2973 | |||
2966 | mutex_lock(&mm->l2_op_lock); | 2974 | mutex_lock(&mm->l2_op_lock); |
2967 | 2975 | ||
2968 | /* Flush all dirty lines from the L2 to DRAM. Lines are left in the L2 | 2976 | /* Flush all dirty lines from the L2 to DRAM. Lines are left in the L2 |
@@ -2992,6 +3000,9 @@ void gk20a_mm_l2_flush(struct gk20a *g, bool invalidate) | |||
2992 | gk20a_mm_l2_invalidate_locked(g); | 3000 | gk20a_mm_l2_invalidate_locked(g); |
2993 | 3001 | ||
2994 | mutex_unlock(&mm->l2_op_lock); | 3002 | mutex_unlock(&mm->l2_op_lock); |
3003 | |||
3004 | hw_was_off: | ||
3005 | pm_runtime_put_noidle(&g->dev->dev); | ||
2995 | } | 3006 | } |
2996 | 3007 | ||
2997 | 3008 | ||