summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common/linux/module.c
diff options
context:
space:
mode:
authorAlex Waterman <alexw@nvidia.com>2018-02-14 13:58:24 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2018-02-27 19:03:52 -0500
commit3fdd8e38b280123fd13bcc4f3fd8928c15e94db6 (patch)
tree19334bacb71dbd7f3e08bbf7ba363193e8380851 /drivers/gpu/nvgpu/common/linux/module.c
parent1170687c33f7506f39aaf47acee5430233e3d1a8 (diff)
gpu: nvgpu: Use our own vmap() for coherent DMA buffers
For some reason the GPU does not like the mappings created by the DMA API for coherent sysmem buffers. But a plain vmap() does seem to work. To work around this, when we are using coherent sysmem, force the NO_KERNEL_MAPPING flag to on and then make a vmap() in the nvgpu DMA API wrapper. The rest of the driver will be none the wiser but will work as expected. This problem is not understood yet but it is being tracked in bug 2040115. Once this bug is understood this WAR should either be determined as necessary or reverted with an appropriate fix. Bug 2040115 JIRA EVLR-2333 Change-Id: Idae7a0c92441f0309df572ac18697af49bb6ff2b Signed-off-by: Alex Waterman <alexw@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1657568 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/common/linux/module.c')
-rw-r--r--drivers/gpu/nvgpu/common/linux/module.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/module.c b/drivers/gpu/nvgpu/common/linux/module.c
index 52348db0..741c86e7 100644
--- a/drivers/gpu/nvgpu/common/linux/module.c
+++ b/drivers/gpu/nvgpu/common/linux/module.c
@@ -1149,6 +1149,12 @@ static int gk20a_probe(struct platform_device *dev)
1149 if (err) 1149 if (err)
1150 goto return_err; 1150 goto return_err;
1151 1151
1152 np = nvgpu_get_node(gk20a);
1153 if (of_dma_is_coherent(np)) {
1154 __nvgpu_set_enabled(gk20a, NVGPU_USE_COHERENT_SYSMEM, true);
1155 __nvgpu_set_enabled(gk20a, NVGPU_SUPPORT_IO_COHERENCE, true);
1156 }
1157
1152 if (nvgpu_platform_is_simulation(gk20a)) 1158 if (nvgpu_platform_is_simulation(gk20a))
1153 __nvgpu_set_enabled(gk20a, NVGPU_IS_FMODEL, true); 1159 __nvgpu_set_enabled(gk20a, NVGPU_IS_FMODEL, true);
1154 1160
@@ -1208,12 +1214,6 @@ static int gk20a_probe(struct platform_device *dev)
1208 1214
1209 gk20a->mm.has_physical_mode = !nvgpu_is_hypervisor_mode(gk20a); 1215 gk20a->mm.has_physical_mode = !nvgpu_is_hypervisor_mode(gk20a);
1210 1216
1211 np = nvgpu_get_node(gk20a);
1212 if (of_dma_is_coherent(np)) {
1213 __nvgpu_set_enabled(gk20a, NVGPU_USE_COHERENT_SYSMEM, true);
1214 __nvgpu_set_enabled(gk20a, NVGPU_SUPPORT_IO_COHERENCE, true);
1215 }
1216
1217 return 0; 1217 return 0;
1218 1218
1219return_err: 1219return_err: