All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] amd/amdkfd: remove svms declaration to avoid werror
@ 2021-09-30 15:53 Alex Sierra
  2021-09-30 19:13 ` Alex Deucher
  0 siblings, 1 reply; 2+ messages in thread
From: Alex Sierra @ 2021-09-30 15:53 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alex Sierra

svm_range_list svms declaration removed to avoid werror when
CONFIG_HSA_AMD_SVM is not enabled.

Signed-off-by: Alex Sierra <alex.sierra@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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] amd/amdkfd: remove svms declaration to avoid werror
  2021-09-30 15:53 [PATCH] amd/amdkfd: remove svms declaration to avoid werror Alex Sierra
@ 2021-09-30 19:13 ` Alex Deucher
  0 siblings, 0 replies; 2+ messages in thread
From: Alex Deucher @ 2021-09-30 19:13 UTC (permalink / raw)
  To: Alex Sierra; +Cc: amd-gfx list

On Thu, Sep 30, 2021 at 11:53 AM Alex Sierra <alex.sierra@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@amd.com>

Reviewed-by: Alex Deucher <alexander.deucher@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
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-09-30 19:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-30 15:53 [PATCH] amd/amdkfd: remove svms declaration to avoid werror Alex Sierra
2021-09-30 19:13 ` Alex Deucher

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.