mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-24 10:34:43 +03:00
Revert "Revert "gpu: nvgpu: Get coherency on gv100 + NVLINK working""
This reverts commit 5a35a95654.
JIRA EVLR-2333
Change-Id: I923c32496c343d39d34f6d406c38a9f6ce7dc6e0
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1667167
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
ef116a6e63
commit
89fbf39a05
@@ -79,6 +79,13 @@ static u64 __nvgpu_gmmu_map(struct vm_gk20a *vm,
|
||||
if (!sgt)
|
||||
return -ENOMEM;
|
||||
|
||||
/*
|
||||
* If the GPU is IO coherent and the DMA API is giving us IO coherent
|
||||
* CPU mappings then we gotta make sure we use the IO coherent aperture.
|
||||
*/
|
||||
if (nvgpu_is_enabled(g, NVGPU_USE_COHERENT_SYSMEM))
|
||||
flags |= NVGPU_VM_MAP_IO_COHERENT;
|
||||
|
||||
nvgpu_mutex_acquire(&vm->update_gmmu_lock);
|
||||
vaddr = g->ops.mm.gmmu_map(vm, addr,
|
||||
sgt, /* sg list */
|
||||
@@ -627,7 +634,7 @@ static int __nvgpu_gmmu_update_page_table(struct vm_gk20a *vm,
|
||||
page_size >> 10,
|
||||
nvgpu_gmmu_perm_str(attrs->rw_flag),
|
||||
attrs->kind_v,
|
||||
nvgpu_aperture_str(attrs->aperture),
|
||||
nvgpu_aperture_str(g, attrs->aperture),
|
||||
attrs->cacheable ? 'C' : '-',
|
||||
attrs->sparse ? 'S' : '-',
|
||||
attrs->priv ? 'P' : '-',
|
||||
@@ -704,6 +711,13 @@ u64 gk20a_locked_gmmu_map(struct vm_gk20a *vm,
|
||||
|
||||
attrs.l3_alloc = (bool)(flags & NVGPU_VM_MAP_L3_ALLOC);
|
||||
|
||||
/*
|
||||
* Handle the IO coherency aperture: make sure the .aperture field is
|
||||
* correct based on the IO coherency flag.
|
||||
*/
|
||||
if (attrs.coherent && attrs.aperture == APERTURE_SYSMEM)
|
||||
attrs.aperture = __APERTURE_SYSMEM_COH;
|
||||
|
||||
/*
|
||||
* Only allocate a new GPU VA range if we haven't already been passed a
|
||||
* GPU VA range. This facilitates fixed mappings.
|
||||
|
||||
Reference in New Issue
Block a user