summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDebarshi Dutta <ddutta@nvidia.com>2020-07-28 07:23:08 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2020-08-07 12:11:01 -0400
commitc46d6fbc5b8d87118ed608e462c62a7976d19246 (patch)
tree6db15eef28a83fc9feeeea27679b858e6628ef4f
parent570f03764fa9f3e014b9c90a48aa7635edf4c0ac (diff)
gpu: nvgpu: Discard coherency check on gmmu
With MSS Nvlink set for force snoop, check for the coherency flag in gmmu attribute and setting pte aperture to coherent type based on that checking is not relevant. coherent variable removed from nvgpu_gmmu_attrs struct. Bug 200473147 Bug 3057980 Change-Id: Idf76cac901ef7c70faa2c4f7f11a046d94b9466a Signed-off-by: Vinod G <vinodg@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/2013212 Signed-off-by: Debarshi Dutta <ddutta@nvidia.com> (cherry-picked from 4e1769097526e5203f7c18a663ab3c29f5568ae5 in rel-32) Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2387272 Reviewed-by: automaticguardword <automaticguardword@nvidia.com> Reviewed-by: Alex Waterman <alexw@nvidia.com> Reviewed-by: Bibek Basu <bbasu@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: Aayush Rajoria <arajoria@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
-rw-r--r--drivers/gpu/nvgpu/common/mm/gmmu.c13
-rw-r--r--drivers/gpu/nvgpu/gk20a/mm_gk20a.c3
-rw-r--r--drivers/gpu/nvgpu/gp10b/mm_gp10b.c3
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/gmmu.h1
4 files changed, 3 insertions, 17 deletions
diff --git a/drivers/gpu/nvgpu/common/mm/gmmu.c b/drivers/gpu/nvgpu/common/mm/gmmu.c
index ee160ae2..748e9f45 100644
--- a/drivers/gpu/nvgpu/common/mm/gmmu.c
+++ b/drivers/gpu/nvgpu/common/mm/gmmu.c
@@ -620,7 +620,7 @@ static int __nvgpu_gmmu_update_page_table(struct vm_gk20a *vm,
620 "vm=%s " 620 "vm=%s "
621 "%-5s GPU virt %#-12llx +%#-9llx phys %#-12llx " 621 "%-5s GPU virt %#-12llx +%#-9llx phys %#-12llx "
622 "phys offset: %#-4llx; pgsz: %3dkb perm=%-2s | " 622 "phys offset: %#-4llx; pgsz: %3dkb perm=%-2s | "
623 "kind=%#02x APT=%-6s %c%c%c%c%c%c", 623 "kind=%#02x APT=%-6s %c%c%c%c%c",
624 vm->name, 624 vm->name,
625 (sgt != NULL) ? "MAP" : "UNMAP", 625 (sgt != NULL) ? "MAP" : "UNMAP",
626 virt_addr, 626 virt_addr,
@@ -634,7 +634,6 @@ static int __nvgpu_gmmu_update_page_table(struct vm_gk20a *vm,
634 attrs->cacheable ? 'C' : '-', 634 attrs->cacheable ? 'C' : '-',
635 attrs->sparse ? 'S' : '-', 635 attrs->sparse ? 'S' : '-',
636 attrs->priv ? 'P' : '-', 636 attrs->priv ? 'P' : '-',
637 attrs->coherent ? 'I' : '-',
638 attrs->valid ? 'V' : '-', 637 attrs->valid ? 'V' : '-',
639 attrs->platform_atomic ? 'A' : '-'); 638 attrs->platform_atomic ? 'A' : '-');
640 639
@@ -693,7 +692,6 @@ u64 gk20a_locked_gmmu_map(struct vm_gk20a *vm,
693 .rw_flag = rw_flag, 692 .rw_flag = rw_flag,
694 .sparse = sparse, 693 .sparse = sparse,
695 .priv = priv, 694 .priv = priv,
696 .coherent = flags & NVGPU_VM_MAP_IO_COHERENT,
697 .valid = (flags & NVGPU_VM_MAP_UNMAPPED_PTE) == 0U, 695 .valid = (flags & NVGPU_VM_MAP_UNMAPPED_PTE) == 0U,
698 .aperture = aperture, 696 .aperture = aperture,
699 .platform_atomic = (flags & NVGPU_VM_MAP_PLATFORM_ATOMIC) != 0U 697 .platform_atomic = (flags & NVGPU_VM_MAP_PLATFORM_ATOMIC) != 0U
@@ -711,14 +709,6 @@ u64 gk20a_locked_gmmu_map(struct vm_gk20a *vm,
711 attrs.l3_alloc = (bool)(flags & NVGPU_VM_MAP_L3_ALLOC); 709 attrs.l3_alloc = (bool)(flags & NVGPU_VM_MAP_L3_ALLOC);
712 710
713 /* 711 /*
714 * Handle the IO coherency aperture: make sure the .aperture field is
715 * correct based on the IO coherency flag.
716 */
717 if (attrs.coherent && attrs.aperture == APERTURE_SYSMEM) {
718 attrs.aperture = APERTURE_SYSMEM_COH;
719 }
720
721 /*
722 * Only allocate a new GPU VA range if we haven't already been passed a 712 * Only allocate a new GPU VA range if we haven't already been passed a
723 * GPU VA range. This facilitates fixed mappings. 713 * GPU VA range. This facilitates fixed mappings.
724 */ 714 */
@@ -775,7 +765,6 @@ void gk20a_locked_gmmu_unmap(struct vm_gk20a *vm,
775 .rw_flag = rw_flag, 765 .rw_flag = rw_flag,
776 .sparse = sparse, 766 .sparse = sparse,
777 .priv = 0, 767 .priv = 0,
778 .coherent = 0,
779 .valid = 0, 768 .valid = 0,
780 .aperture = APERTURE_INVALID, 769 .aperture = APERTURE_INVALID,
781 }; 770 };
diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
index 18922d46..10ca84d9 100644
--- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
@@ -274,7 +274,7 @@ static void update_gmmu_pte_locked(struct vm_gk20a *vm,
274 pte_dbg(g, attrs, 274 pte_dbg(g, attrs,
275 "PTE: i=%-4u size=%-2u offs=%-4u | " 275 "PTE: i=%-4u size=%-2u offs=%-4u | "
276 "GPU %#-12llx phys %#-12llx " 276 "GPU %#-12llx phys %#-12llx "
277 "pgsz: %3dkb perm=%-2s kind=%#02x APT=%-6s %c%c%c%c%c " 277 "pgsz: %3dkb perm=%-2s kind=%#02x APT=%-6s %c%c%c%c "
278 "ctag=0x%08x " 278 "ctag=0x%08x "
279 "[0x%08x, 0x%08x]", 279 "[0x%08x, 0x%08x]",
280 pd_idx, l->entry_size, pd_offset, 280 pd_idx, l->entry_size, pd_offset,
@@ -286,7 +286,6 @@ static void update_gmmu_pte_locked(struct vm_gk20a *vm,
286 attrs->cacheable ? 'C' : '-', 286 attrs->cacheable ? 'C' : '-',
287 attrs->sparse ? 'S' : '-', 287 attrs->sparse ? 'S' : '-',
288 attrs->priv ? 'P' : '-', 288 attrs->priv ? 'P' : '-',
289 attrs->coherent ? 'I' : '-',
290 attrs->valid ? 'V' : '-', 289 attrs->valid ? 'V' : '-',
291 (u32)attrs->ctag >> ctag_shift, 290 (u32)attrs->ctag >> ctag_shift,
292 pte_w[1], pte_w[0]); 291 pte_w[1], pte_w[0]);
diff --git a/drivers/gpu/nvgpu/gp10b/mm_gp10b.c b/drivers/gpu/nvgpu/gp10b/mm_gp10b.c
index a4b291d8..48e08a16 100644
--- a/drivers/gpu/nvgpu/gp10b/mm_gp10b.c
+++ b/drivers/gpu/nvgpu/gp10b/mm_gp10b.c
@@ -280,7 +280,7 @@ static void update_gmmu_pte_locked(struct vm_gk20a *vm,
280 "vm=%s " 280 "vm=%s "
281 "PTE: i=%-4u size=%-2u | " 281 "PTE: i=%-4u size=%-2u | "
282 "GPU %#-12llx phys %#-12llx " 282 "GPU %#-12llx phys %#-12llx "
283 "pgsz: %3dkb perm=%-2s kind=%#02x APT=%-6s %c%c%c%c%c%c " 283 "pgsz: %3dkb perm=%-2s kind=%#02x APT=%-6s %c%c%c%c%c "
284 "ctag=0x%08x " 284 "ctag=0x%08x "
285 "[0x%08x, 0x%08x]", 285 "[0x%08x, 0x%08x]",
286 vm->name, 286 vm->name,
@@ -293,7 +293,6 @@ static void update_gmmu_pte_locked(struct vm_gk20a *vm,
293 attrs->cacheable ? 'C' : '-', 293 attrs->cacheable ? 'C' : '-',
294 attrs->sparse ? 'S' : '-', 294 attrs->sparse ? 'S' : '-',
295 attrs->priv ? 'P' : '-', 295 attrs->priv ? 'P' : '-',
296 attrs->coherent ? 'I' : '-',
297 attrs->valid ? 'V' : '-', 296 attrs->valid ? 'V' : '-',
298 attrs->platform_atomic ? 'A' : '-', 297 attrs->platform_atomic ? 'A' : '-',
299 (u32)attrs->ctag / g->ops.fb.compression_page_size(g), 298 (u32)attrs->ctag / g->ops.fb.compression_page_size(g),
diff --git a/drivers/gpu/nvgpu/include/nvgpu/gmmu.h b/drivers/gpu/nvgpu/include/nvgpu/gmmu.h
index 66cb5218..8e1eeedc 100644
--- a/drivers/gpu/nvgpu/include/nvgpu/gmmu.h
+++ b/drivers/gpu/nvgpu/include/nvgpu/gmmu.h
@@ -170,7 +170,6 @@ struct nvgpu_gmmu_attrs {
170 enum gk20a_mem_rw_flag rw_flag; 170 enum gk20a_mem_rw_flag rw_flag;
171 bool sparse; 171 bool sparse;
172 bool priv; 172 bool priv;
173 bool coherent;
174 bool valid; 173 bool valid;
175 enum nvgpu_aperture aperture; 174 enum nvgpu_aperture aperture;
176 bool debug; 175 bool debug;