[PATCH] amd/amdkfd: remove svms declaration to avoid werror
Alex Deucher
alexdeucher at gmail.com
Thu Sep 30 19:13:29 UTC 2021
On Thu, Sep 30, 2021 at 11:53 AM Alex Sierra <alex.sierra at amd.com> 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 at amd.com>
Reviewed-by: Alex Deucher <alexander.deucher at amd.com>
> ---
> 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
>
More information about the amd-gfx
mailing list