Re: [PATCH] amd/amdkfd: remove svms declaration to avoid werror

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Sep 30, 2021 at 11:53 AM Alex Sierra <alex.sierra@xxxxxxx> wrote:
>
> svm_range_list svms declaration removed to avoid werror when
> CONFIG_HSA_AMD_SVM is not enabled.
>
> Signed-off-by: Alex Sierra <alex.sierra@xxxxxxx>

Reviewed-by: Alex Deucher <alexander.deucher@xxxxxxx>

> ---
>  drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 11 +++++------
>  1 file changed, 5 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
> index 4de907f3e66a..f1e7edeb4e6b 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
> @@ -1251,7 +1251,6 @@ static int kfd_ioctl_alloc_memory_of_gpu(struct file *filep,
>         struct kfd_process_device *pdd;
>         void *mem;
>         struct kfd_dev *dev;
> -       struct svm_range_list *svms = &p->svms;
>         int idr_handle;
>         long err;
>         uint64_t offset = args->mmap_offset;
> @@ -1264,18 +1263,18 @@ static int kfd_ioctl_alloc_memory_of_gpu(struct file *filep,
>         /* Flush pending deferred work to avoid racing with deferred actions
>          * from previous memory map changes (e.g. munmap).
>          */
> -       svm_range_list_lock_and_flush_work(svms, current->mm);
> -       mutex_lock(&svms->lock);
> +       svm_range_list_lock_and_flush_work(&p->svms, current->mm);
> +       mutex_lock(&p->svms.lock);
>         mmap_write_unlock(current->mm);
> -       if (interval_tree_iter_first(&svms->objects,
> +       if (interval_tree_iter_first(&p->svms.objects,
>                                      args->va_addr >> PAGE_SHIFT,
>                                      (args->va_addr + args->size - 1) >> PAGE_SHIFT)) {
>                 pr_err("Address: 0x%llx already allocated by SVM\n",
>                         args->va_addr);
> -               mutex_unlock(&svms->lock);
> +               mutex_unlock(&p->svms.lock);
>                 return -EADDRINUSE;
>         }
> -       mutex_unlock(&svms->lock);
> +       mutex_unlock(&p->svms.lock);
>  #endif
>         dev = kfd_device_by_id(args->gpu_id);
>         if (!dev)
> --
> 2.32.0
>



[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux