lkml.org 
[lkml]   [2023]   [Jan]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH AUTOSEL 6.1 36/53] drm/amdkfd: Fix NULL pointer error for GC 11.0.1 on mGPU
    Date
    From: Eric Huang <jinhuieric.huang@amd.com>

    [ Upstream commit a6941f89d7c6a6ba49316bbd7da2fb2f719119a7 ]

    The point bo->kfd_bo is NULL for queue's write pointer BO
    when creating queue on mGPU. To avoid using the pointer
    fixes the error.

    Signed-off-by: Eric Huang <jinhuieric.huang@amd.com>
    Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 2 +-
    drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 2 +-
    2 files changed, 2 insertions(+), 2 deletions(-)

    diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
    index 29f045079a3e..404c839683b1 100644
    --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
    +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
    @@ -2130,7 +2130,7 @@ int amdgpu_amdkfd_map_gtt_bo_to_gart(struct amdgpu_device *adev, struct amdgpu_b
    }

    amdgpu_amdkfd_remove_eviction_fence(
    - bo, bo->kfd_bo->process_info->eviction_fence);
    + bo, bo->vm_bo->vm->process_info->eviction_fence);

    amdgpu_bo_unreserve(bo);

    diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
    index ecb4c3abc629..c06ada0844ba 100644
    --- a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
    +++ b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
    @@ -200,7 +200,7 @@ static int add_queue_mes(struct device_queue_manager *dqm, struct queue *q,
    queue_input.wptr_addr = (uint64_t)q->properties.write_ptr;

    if (q->wptr_bo) {
    - wptr_addr_off = (uint64_t)q->properties.write_ptr - (uint64_t)q->wptr_bo->kfd_bo->va;
    + wptr_addr_off = (uint64_t)q->properties.write_ptr & (PAGE_SIZE - 1);
    queue_input.wptr_mc_addr = ((uint64_t)q->wptr_bo->tbo.resource->start << PAGE_SHIFT) + wptr_addr_off;
    }

    --
    2.35.1
    \
     
     \ /
      Last update: 2023-03-26 23:42    [W:5.894 / U:0.044 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site