AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Felix Kuehling <felix.kuehling@amd.com>
To: Dafna Hirschfeld <dhirschfeld@habana.ai>,
	dri-devel@lists.freedesktop.org
Cc: ogabbay@kernel.org, Xinhui.Pan@amd.com,
	amd-gfx@lists.freedesktop.org, obitton@habana.ai,
	alexander.deucher@amd.com, christian.koenig@amd.com
Subject: Re: [PATCH v2] drm/amdkfd: fixes for HMM mem allocation
Date: Mon, 8 Jan 2024 12:51:29 -0500	[thread overview]
Message-ID: <a415dea8-095c-4a65-bc55-0f10176daeb4@amd.com> (raw)
In-Reply-To: <20240107130700.1165029-1-dhirschfeld@habana.ai>


On 2024-01-07 08:07, Dafna Hirschfeld wrote:
> Fix err return value and reset pgmap->type after checking it.
>
> Fixes: c83dee9b6394 ("drm/amdkfd: add SPM support for SVM")
> Reviewed-by: Felix Kuehling <felix.kuehling@amd.com>
> Signed-off-by: Dafna Hirschfeld <dhirschfeld@habana.ai>
> ---
> v2: remove unrelated DOC fix and add 'Fixes' tag.

Thank you. I'm going to apply this patch to amd-staging-drm-next.

Regards,
   Felix


>
>   drivers/gpu/drm/amd/amdkfd/kfd_migrate.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_migrate.c b/drivers/gpu/drm/amd/amdkfd/kfd_migrate.c
> index 6c25dab051d5..b8680e0753ca 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_migrate.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_migrate.c
> @@ -1021,7 +1021,7 @@ int kgd2kfd_init_zone_device(struct amdgpu_device *adev)
>   	} else {
>   		res = devm_request_free_mem_region(adev->dev, &iomem_resource, size);
>   		if (IS_ERR(res))
> -			return -ENOMEM;
> +			return PTR_ERR(res);
>   		pgmap->range.start = res->start;
>   		pgmap->range.end = res->end;
>   		pgmap->type = MEMORY_DEVICE_PRIVATE;
> @@ -1037,10 +1037,10 @@ int kgd2kfd_init_zone_device(struct amdgpu_device *adev)
>   	r = devm_memremap_pages(adev->dev, pgmap);
>   	if (IS_ERR(r)) {
>   		pr_err("failed to register HMM device memory\n");
> -		/* Disable SVM support capability */
> -		pgmap->type = 0;
>   		if (pgmap->type == MEMORY_DEVICE_PRIVATE)
>   			devm_release_mem_region(adev->dev, res->start, resource_size(res));
> +		/* Disable SVM support capability */
> +		pgmap->type = 0;
>   		return PTR_ERR(r);
>   	}
>   

      reply	other threads:[~2024-01-08 17:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-07 13:07 [PATCH v2] drm/amdkfd: fixes for HMM mem allocation Dafna Hirschfeld
2024-01-08 17:51 ` Felix Kuehling [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a415dea8-095c-4a65-bc55-0f10176daeb4@amd.com \
    --to=felix.kuehling@amd.com \
    --cc=Xinhui.Pan@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=christian.koenig@amd.com \
    --cc=dhirschfeld@habana.ai \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=obitton@habana.ai \
    --cc=ogabbay@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox