diff options
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/channel_gk20a.c | 7 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/mm_gk20a.c | 26 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/mm_gk20a.h | 1 |
3 files changed, 4 insertions, 30 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c index d61656fc..a32496a2 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c | |||
@@ -1589,13 +1589,6 @@ int gk20a_submit_channel_gpfifo(struct channel_gk20a *c, | |||
1589 | gk20a_dbg_info("pre-submit put %d, get %d, size %d", | 1589 | gk20a_dbg_info("pre-submit put %d, get %d, size %d", |
1590 | c->gpfifo.put, c->gpfifo.get, c->gpfifo.entry_num); | 1590 | c->gpfifo.put, c->gpfifo.get, c->gpfifo.entry_num); |
1591 | 1591 | ||
1592 | /* Invalidate tlb if it's dirty... */ | ||
1593 | /* TBD: this should be done in the cmd stream, not with PRIs. */ | ||
1594 | /* We don't know what context is currently running... */ | ||
1595 | /* Note also: there can be more than one context associated with the */ | ||
1596 | /* address space (vm). */ | ||
1597 | g->ops.mm.tlb_invalidate(c->vm); | ||
1598 | |||
1599 | /* Make sure we have enough space for gpfifo entries. If not, | 1592 | /* Make sure we have enough space for gpfifo entries. If not, |
1600 | * wait for signals from completed submits */ | 1593 | * wait for signals from completed submits */ |
1601 | if (gp_free_count(c) < num_entries + extra_entries) { | 1594 | if (gp_free_count(c) < num_entries + extra_entries) { |
diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c index 17cf8d83..3f71fc5e 100644 --- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c | |||
@@ -1161,6 +1161,8 @@ u64 gk20a_locked_gmmu_map(struct vm_gk20a *vm, | |||
1161 | goto fail_validate; | 1161 | goto fail_validate; |
1162 | } | 1162 | } |
1163 | 1163 | ||
1164 | g->ops.mm.tlb_invalidate(vm); | ||
1165 | |||
1164 | return map_offset; | 1166 | return map_offset; |
1165 | fail_validate: | 1167 | fail_validate: |
1166 | if (allocated) | 1168 | if (allocated) |
@@ -1202,8 +1204,6 @@ void gk20a_locked_gmmu_unmap(struct vm_gk20a *vm, | |||
1202 | dev_err(dev_from_vm(vm), | 1204 | dev_err(dev_from_vm(vm), |
1203 | "failed to update gmmu ptes on unmap"); | 1205 | "failed to update gmmu ptes on unmap"); |
1204 | 1206 | ||
1205 | /* detect which if any pdes/ptes can now be released */ | ||
1206 | |||
1207 | /* flush l2 so any dirty lines are written out *now*. | 1207 | /* flush l2 so any dirty lines are written out *now*. |
1208 | * also as we could potentially be switching this buffer | 1208 | * also as we could potentially be switching this buffer |
1209 | * from nonvolatile (l2 cacheable) to volatile (l2 non-cacheable) at | 1209 | * from nonvolatile (l2 cacheable) to volatile (l2 non-cacheable) at |
@@ -1213,6 +1213,8 @@ void gk20a_locked_gmmu_unmap(struct vm_gk20a *vm, | |||
1213 | * unmapping (below). */ | 1213 | * unmapping (below). */ |
1214 | 1214 | ||
1215 | gk20a_mm_l2_flush(g, true); | 1215 | gk20a_mm_l2_flush(g, true); |
1216 | |||
1217 | g->ops.mm.tlb_invalidate(vm); | ||
1216 | } | 1218 | } |
1217 | 1219 | ||
1218 | static u64 gk20a_vm_map_duplicate_locked(struct vm_gk20a *vm, | 1220 | static u64 gk20a_vm_map_duplicate_locked(struct vm_gk20a *vm, |
@@ -1502,10 +1504,6 @@ u64 gk20a_vm_map(struct vm_gk20a *vm, | |||
1502 | 1504 | ||
1503 | mutex_unlock(&vm->update_gmmu_lock); | 1505 | mutex_unlock(&vm->update_gmmu_lock); |
1504 | 1506 | ||
1505 | /* Invalidate kernel mappings immediately */ | ||
1506 | if (vm_aspace_id(vm) == -1) | ||
1507 | gk20a_mm_tlb_invalidate(vm); | ||
1508 | |||
1509 | return map_offset; | 1507 | return map_offset; |
1510 | 1508 | ||
1511 | clean_up: | 1509 | clean_up: |
@@ -1549,9 +1547,6 @@ u64 gk20a_gmmu_map(struct vm_gk20a *vm, | |||
1549 | return 0; | 1547 | return 0; |
1550 | } | 1548 | } |
1551 | 1549 | ||
1552 | /* Invalidate kernel mappings immediately */ | ||
1553 | g->ops.mm.tlb_invalidate(vm); | ||
1554 | |||
1555 | return vaddr; | 1550 | return vaddr; |
1556 | } | 1551 | } |
1557 | 1552 | ||
@@ -1882,8 +1877,6 @@ static int update_gmmu_ptes_locked(struct vm_gk20a *vm, | |||
1882 | } | 1877 | } |
1883 | 1878 | ||
1884 | smp_mb(); | 1879 | smp_mb(); |
1885 | vm->tlb_dirty = true; | ||
1886 | gk20a_dbg_fn("set tlb dirty"); | ||
1887 | 1880 | ||
1888 | return 0; | 1881 | return 0; |
1889 | 1882 | ||
@@ -1972,8 +1965,6 @@ void update_gmmu_pde_locked(struct vm_gk20a *vm, u32 i) | |||
1972 | gk20a_mm_l2_invalidate(vm->mm->g); | 1965 | gk20a_mm_l2_invalidate(vm->mm->g); |
1973 | 1966 | ||
1974 | gk20a_dbg(gpu_dbg_pte, "pde:%d = 0x%x,0x%08x\n", i, pde_v[1], pde_v[0]); | 1967 | gk20a_dbg(gpu_dbg_pte, "pde:%d = 0x%x,0x%08x\n", i, pde_v[1], pde_v[0]); |
1975 | |||
1976 | vm->tlb_dirty = true; | ||
1977 | } | 1968 | } |
1978 | 1969 | ||
1979 | /* NOTE! mapped_buffers lock must be held */ | 1970 | /* NOTE! mapped_buffers lock must be held */ |
@@ -2992,13 +2983,6 @@ void gk20a_mm_tlb_invalidate(struct vm_gk20a *vm) | |||
2992 | if (!g->power_on) | 2983 | if (!g->power_on) |
2993 | return; | 2984 | return; |
2994 | 2985 | ||
2995 | /* No need to invalidate if tlb is clean */ | ||
2996 | mutex_lock(&vm->update_gmmu_lock); | ||
2997 | if (!vm->tlb_dirty) { | ||
2998 | mutex_unlock(&vm->update_gmmu_lock); | ||
2999 | return; | ||
3000 | } | ||
3001 | |||
3002 | mutex_lock(&tlb_lock); | 2986 | mutex_lock(&tlb_lock); |
3003 | 2987 | ||
3004 | trace_gk20a_mm_tlb_invalidate(g->dev->name); | 2988 | trace_gk20a_mm_tlb_invalidate(g->dev->name); |
@@ -3042,8 +3026,6 @@ void gk20a_mm_tlb_invalidate(struct vm_gk20a *vm) | |||
3042 | 3026 | ||
3043 | out: | 3027 | out: |
3044 | mutex_unlock(&tlb_lock); | 3028 | mutex_unlock(&tlb_lock); |
3045 | vm->tlb_dirty = false; | ||
3046 | mutex_unlock(&vm->update_gmmu_lock); | ||
3047 | } | 3029 | } |
3048 | 3030 | ||
3049 | int gk20a_mm_suspend(struct gk20a *g) | 3031 | int gk20a_mm_suspend(struct gk20a *g) |
diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.h b/drivers/gpu/nvgpu/gk20a/mm_gk20a.h index 596661ca..663bd5d3 100644 --- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.h | |||
@@ -290,7 +290,6 @@ struct vm_gk20a { | |||
290 | 290 | ||
291 | bool big_pages; /* enable large page support */ | 291 | bool big_pages; /* enable large page support */ |
292 | bool enable_ctag; | 292 | bool enable_ctag; |
293 | bool tlb_dirty; | ||
294 | bool mapped; | 293 | bool mapped; |
295 | 294 | ||
296 | u32 big_page_size; | 295 | u32 big_page_size; |