mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-24 02:22:34 +03:00
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>
This commit is contained in:
committed by
mobile promotions
parent
e1df72771b
commit
c16797e35c
@@ -77,9 +77,13 @@ int nvgpu_dma_alloc_flags(struct gk20a *g, unsigned long flags, size_t size,
|
||||
* the lack of it for vidmem - the user should not care when
|
||||
* using nvgpu_gmmu_alloc_map and it's vidmem, or if there's a
|
||||
* difference, the user should use the flag explicitly anyway.
|
||||
*
|
||||
* Incoming flags are ignored here, since bits other than the
|
||||
* no-kernel-mapping flag are ignored by the vidmem mapping
|
||||
* functions anyway.
|
||||
*/
|
||||
int err = nvgpu_dma_alloc_flags_vid(g,
|
||||
flags | NVGPU_DMA_NO_KERNEL_MAPPING,
|
||||
NVGPU_DMA_NO_KERNEL_MAPPING,
|
||||
size, mem);
|
||||
|
||||
if (!err)
|
||||
|
||||
@@ -637,6 +637,8 @@ static int __nvgpu_gmmu_update_page_table(struct vm_gk20a *vm,
|
||||
struct nvgpu_gmmu_attrs *attrs)
|
||||
{
|
||||
struct gk20a *g = gk20a_from_vm(vm);
|
||||
struct nvgpu_page_alloc *alloc;
|
||||
u64 phys_addr = 0;
|
||||
u32 page_size;
|
||||
int err;
|
||||
|
||||
@@ -662,6 +664,15 @@ static int __nvgpu_gmmu_update_page_table(struct vm_gk20a *vm,
|
||||
return err;
|
||||
}
|
||||
|
||||
if (sgt) {
|
||||
if (attrs->aperture == APERTURE_VIDMEM) {
|
||||
alloc = get_vidmem_page_alloc(sgt->sgl);
|
||||
|
||||
phys_addr = alloc->base;
|
||||
} else
|
||||
phys_addr = g->ops.mm.get_iova_addr(g, sgt->sgl, 0);
|
||||
}
|
||||
|
||||
__gmmu_dbg(g, attrs,
|
||||
"vm=%s "
|
||||
"%-5s GPU virt %#-12llx +%#-9llx phys %#-12llx "
|
||||
@@ -671,7 +682,7 @@ static int __nvgpu_gmmu_update_page_table(struct vm_gk20a *vm,
|
||||
sgt ? "MAP" : "UNMAP",
|
||||
virt_addr,
|
||||
length,
|
||||
sgt ? g->ops.mm.get_iova_addr(g, sgt->sgl, 0) : 0ULL,
|
||||
phys_addr,
|
||||
space_to_skip,
|
||||
page_size >> 10,
|
||||
nvgpu_gmmu_perm_str(attrs->rw_flag),
|
||||
|
||||
Reference in New Issue
Block a user