diff options
author | Peter Daifuku <pdaifuku@nvidia.com> | 2017-08-01 16:51:56 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-08-03 11:45:00 -0400 |
commit | c16797e35c2926bf34a61d5d8f37d5675ec23b1b (patch) | |
tree | 74c14d006af6f136793c23f335e8758ccf9d3e5c /drivers | |
parent | e1df72771ba5e5331888f5bfc171f71bd8f4aed7 (diff) |
gpu: nvgpu: fix warnings for GPUs with real vidmem
Fix kernel warnings for GPUs with real vidmem:
- dma.c: in nvgpu_dma_alloc_flags, ignore incoming flags when using vidmem,
since anything but NVGPU_DMA_NO_KERNEL_MAPPING will end up generating
kernel warnings, and the vidmem mapping functions ignore the other flags
anyway.
- gmmu.c: in __nvgpu_gmmu_update_page_table, use appropriate function for
memory type to retrieve physical address
Bug 1967748
Change-Id: I6fc01fd5f2c5cd7b81cba70ab59cc3c8fe4cda19
Signed-off-by: Peter Daifuku <pdaifuku@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1530877
Reviewed-by: Alex Waterman <alexw@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/dma.c | 6 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/common/mm/gmmu.c | 13 |
2 files changed, 17 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/dma.c b/drivers/gpu/nvgpu/common/linux/dma.c index 6473aed9..ea5b2837 100644 --- a/drivers/gpu/nvgpu/common/linux/dma.c +++ b/drivers/gpu/nvgpu/common/linux/dma.c | |||
@@ -77,9 +77,13 @@ int nvgpu_dma_alloc_flags(struct gk20a *g, unsigned long flags, size_t size, | |||
77 | * the lack of it for vidmem - the user should not care when | 77 | * the lack of it for vidmem - the user should not care when |
78 | * using nvgpu_gmmu_alloc_map and it's vidmem, or if there's a | 78 | * using nvgpu_gmmu_alloc_map and it's vidmem, or if there's a |
79 | * difference, the user should use the flag explicitly anyway. | 79 | * difference, the user should use the flag explicitly anyway. |
80 | * | ||
81 | * Incoming flags are ignored here, since bits other than the | ||
82 | * no-kernel-mapping flag are ignored by the vidmem mapping | ||
83 | * functions anyway. | ||
80 | */ | 84 | */ |
81 | int err = nvgpu_dma_alloc_flags_vid(g, | 85 | int err = nvgpu_dma_alloc_flags_vid(g, |
82 | flags | NVGPU_DMA_NO_KERNEL_MAPPING, | 86 | NVGPU_DMA_NO_KERNEL_MAPPING, |
83 | size, mem); | 87 | size, mem); |
84 | 88 | ||
85 | if (!err) | 89 | if (!err) |
diff --git a/drivers/gpu/nvgpu/common/mm/gmmu.c b/drivers/gpu/nvgpu/common/mm/gmmu.c index 2b579bdd..1be87c85 100644 --- a/drivers/gpu/nvgpu/common/mm/gmmu.c +++ b/drivers/gpu/nvgpu/common/mm/gmmu.c | |||
@@ -637,6 +637,8 @@ static int __nvgpu_gmmu_update_page_table(struct vm_gk20a *vm, | |||
637 | struct nvgpu_gmmu_attrs *attrs) | 637 | struct nvgpu_gmmu_attrs *attrs) |
638 | { | 638 | { |
639 | struct gk20a *g = gk20a_from_vm(vm); | 639 | struct gk20a *g = gk20a_from_vm(vm); |
640 | struct nvgpu_page_alloc *alloc; | ||
641 | u64 phys_addr = 0; | ||
640 | u32 page_size; | 642 | u32 page_size; |
641 | int err; | 643 | int err; |
642 | 644 | ||
@@ -662,6 +664,15 @@ static int __nvgpu_gmmu_update_page_table(struct vm_gk20a *vm, | |||
662 | return err; | 664 | return err; |
663 | } | 665 | } |
664 | 666 | ||
667 | if (sgt) { | ||
668 | if (attrs->aperture == APERTURE_VIDMEM) { | ||
669 | alloc = get_vidmem_page_alloc(sgt->sgl); | ||
670 | |||
671 | phys_addr = alloc->base; | ||
672 | } else | ||
673 | phys_addr = g->ops.mm.get_iova_addr(g, sgt->sgl, 0); | ||
674 | } | ||
675 | |||
665 | __gmmu_dbg(g, attrs, | 676 | __gmmu_dbg(g, attrs, |
666 | "vm=%s " | 677 | "vm=%s " |
667 | "%-5s GPU virt %#-12llx +%#-9llx phys %#-12llx " | 678 | "%-5s GPU virt %#-12llx +%#-9llx phys %#-12llx " |
@@ -671,7 +682,7 @@ static int __nvgpu_gmmu_update_page_table(struct vm_gk20a *vm, | |||
671 | sgt ? "MAP" : "UNMAP", | 682 | sgt ? "MAP" : "UNMAP", |
672 | virt_addr, | 683 | virt_addr, |
673 | length, | 684 | length, |
674 | sgt ? g->ops.mm.get_iova_addr(g, sgt->sgl, 0) : 0ULL, | 685 | phys_addr, |
675 | space_to_skip, | 686 | space_to_skip, |
676 | page_size >> 10, | 687 | page_size >> 10, |
677 | nvgpu_gmmu_perm_str(attrs->rw_flag), | 688 | nvgpu_gmmu_perm_str(attrs->rw_flag), |