All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Deucher <alexdeucher@gmail.com>
To: Jianglei Nie <niejianglei2021@163.com>
Cc: "Joshi, Mukul" <mukul.joshi@amd.com>,
	Jack Xiao <Jack.Xiao@amd.com>, Dave Airlie <airlied@linux.ie>,
	xinhui pan <Xinhui.Pan@amd.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Maling list - DRI developers <dri-devel@lists.freedesktop.org>,
	amd-gfx list <amd-gfx@lists.freedesktop.org>,
	"Deucher, Alexander" <alexander.deucher@amd.com>,
	Christian Koenig <christian.koenig@amd.com>,
	Hawking Zhang <Hawking.Zhang@amd.com>
Subject: Re: [PATCH] drm/amdgpu/mes: Fix an error handling path in amdgpu_mes_self_test()
Date: Tue, 5 Jul 2022 11:07:49 -0400	[thread overview]
Message-ID: <CADnq5_P7Ojd8beMqZ-N9EJJV9eONJVXMpaSGQt=PC9YXJ_FmHQ@mail.gmail.com> (raw)
In-Reply-To: <20220705134603.2248455-1-niejianglei2021@163.com>

Applied.  Thanks!

On Tue, Jul 5, 2022 at 9:46 AM Jianglei Nie <niejianglei2021@163.com> wrote:
>
> if amdgpu_mes_ctx_alloc_meta_data() fails, we should call amdgpu_vm_fini()
> to handle amdgpu_vm_init().
>
> Add a new lable before amdgpu_vm_init() and goto this lable when
> amdgpu_mes_ctx_alloc_meta_data() fails.
>
> Signed-off-by: Jianglei Nie <niejianglei2021@163.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c
> index 69a70a0aaed9..7c196b8ac49f 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c
> @@ -1157,7 +1157,7 @@ int amdgpu_mes_self_test(struct amdgpu_device *adev)
>         r = amdgpu_mes_ctx_alloc_meta_data(adev, &ctx_data);
>         if (r) {
>                 DRM_ERROR("failed to alloc ctx meta data\n");
> -               goto error_pasid;
> +               goto error_fini;
>         }
>
>         ctx_data.meta_data_gpu_addr = AMDGPU_VA_RESERVED_SIZE;
> @@ -1215,6 +1215,8 @@ int amdgpu_mes_self_test(struct amdgpu_device *adev)
>         BUG_ON(amdgpu_bo_reserve(ctx_data.meta_data_obj, true));
>         amdgpu_vm_bo_del(adev, ctx_data.meta_data_va);
>         amdgpu_bo_unreserve(ctx_data.meta_data_obj);
> +
> +error_fini:
>         amdgpu_vm_fini(adev, vm);
>
>  error_pasid:
> --
> 2.25.1
>

WARNING: multiple messages have this Message-ID (diff)
From: Alex Deucher <alexdeucher@gmail.com>
To: Jianglei Nie <niejianglei2021@163.com>
Cc: "Joshi, Mukul" <mukul.joshi@amd.com>,
	Jack Xiao <Jack.Xiao@amd.com>, Dave Airlie <airlied@linux.ie>,
	xinhui pan <Xinhui.Pan@amd.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Maling list - DRI developers <dri-devel@lists.freedesktop.org>,
	amd-gfx list <amd-gfx@lists.freedesktop.org>,
	Daniel Vetter <daniel@ffwll.ch>,
	"Deucher, Alexander" <alexander.deucher@amd.com>,
	Christian Koenig <christian.koenig@amd.com>,
	Hawking Zhang <Hawking.Zhang@amd.com>
Subject: Re: [PATCH] drm/amdgpu/mes: Fix an error handling path in amdgpu_mes_self_test()
Date: Tue, 5 Jul 2022 11:07:49 -0400	[thread overview]
Message-ID: <CADnq5_P7Ojd8beMqZ-N9EJJV9eONJVXMpaSGQt=PC9YXJ_FmHQ@mail.gmail.com> (raw)
In-Reply-To: <20220705134603.2248455-1-niejianglei2021@163.com>

Applied.  Thanks!

On Tue, Jul 5, 2022 at 9:46 AM Jianglei Nie <niejianglei2021@163.com> wrote:
>
> if amdgpu_mes_ctx_alloc_meta_data() fails, we should call amdgpu_vm_fini()
> to handle amdgpu_vm_init().
>
> Add a new lable before amdgpu_vm_init() and goto this lable when
> amdgpu_mes_ctx_alloc_meta_data() fails.
>
> Signed-off-by: Jianglei Nie <niejianglei2021@163.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c
> index 69a70a0aaed9..7c196b8ac49f 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c
> @@ -1157,7 +1157,7 @@ int amdgpu_mes_self_test(struct amdgpu_device *adev)
>         r = amdgpu_mes_ctx_alloc_meta_data(adev, &ctx_data);
>         if (r) {
>                 DRM_ERROR("failed to alloc ctx meta data\n");
> -               goto error_pasid;
> +               goto error_fini;
>         }
>
>         ctx_data.meta_data_gpu_addr = AMDGPU_VA_RESERVED_SIZE;
> @@ -1215,6 +1215,8 @@ int amdgpu_mes_self_test(struct amdgpu_device *adev)
>         BUG_ON(amdgpu_bo_reserve(ctx_data.meta_data_obj, true));
>         amdgpu_vm_bo_del(adev, ctx_data.meta_data_va);
>         amdgpu_bo_unreserve(ctx_data.meta_data_obj);
> +
> +error_fini:
>         amdgpu_vm_fini(adev, vm);
>
>  error_pasid:
> --
> 2.25.1
>

WARNING: multiple messages have this Message-ID (diff)
From: Alex Deucher <alexdeucher@gmail.com>
To: Jianglei Nie <niejianglei2021@163.com>
Cc: "Deucher, Alexander" <alexander.deucher@amd.com>,
	Christian Koenig <christian.koenig@amd.com>,
	xinhui pan <Xinhui.Pan@amd.com>, Dave Airlie <airlied@linux.ie>,
	Daniel Vetter <daniel@ffwll.ch>, Jack Xiao <Jack.Xiao@amd.com>,
	Hawking Zhang <Hawking.Zhang@amd.com>,
	"Joshi, Mukul" <mukul.joshi@amd.com>,
	Maling list - DRI developers  <dri-devel@lists.freedesktop.org>,
	amd-gfx list <amd-gfx@lists.freedesktop.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] drm/amdgpu/mes: Fix an error handling path in amdgpu_mes_self_test()
Date: Tue, 5 Jul 2022 11:07:49 -0400	[thread overview]
Message-ID: <CADnq5_P7Ojd8beMqZ-N9EJJV9eONJVXMpaSGQt=PC9YXJ_FmHQ@mail.gmail.com> (raw)
In-Reply-To: <20220705134603.2248455-1-niejianglei2021@163.com>

Applied.  Thanks!

On Tue, Jul 5, 2022 at 9:46 AM Jianglei Nie <niejianglei2021@163.com> wrote:
>
> if amdgpu_mes_ctx_alloc_meta_data() fails, we should call amdgpu_vm_fini()
> to handle amdgpu_vm_init().
>
> Add a new lable before amdgpu_vm_init() and goto this lable when
> amdgpu_mes_ctx_alloc_meta_data() fails.
>
> Signed-off-by: Jianglei Nie <niejianglei2021@163.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c
> index 69a70a0aaed9..7c196b8ac49f 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c
> @@ -1157,7 +1157,7 @@ int amdgpu_mes_self_test(struct amdgpu_device *adev)
>         r = amdgpu_mes_ctx_alloc_meta_data(adev, &ctx_data);
>         if (r) {
>                 DRM_ERROR("failed to alloc ctx meta data\n");
> -               goto error_pasid;
> +               goto error_fini;
>         }
>
>         ctx_data.meta_data_gpu_addr = AMDGPU_VA_RESERVED_SIZE;
> @@ -1215,6 +1215,8 @@ int amdgpu_mes_self_test(struct amdgpu_device *adev)
>         BUG_ON(amdgpu_bo_reserve(ctx_data.meta_data_obj, true));
>         amdgpu_vm_bo_del(adev, ctx_data.meta_data_va);
>         amdgpu_bo_unreserve(ctx_data.meta_data_obj);
> +
> +error_fini:
>         amdgpu_vm_fini(adev, vm);
>
>  error_pasid:
> --
> 2.25.1
>

  reply	other threads:[~2022-07-05 15:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-05 13:46 [PATCH] drm/amdgpu/mes: Fix an error handling path in amdgpu_mes_self_test() Jianglei Nie
2022-07-05 13:46 ` Jianglei Nie
2022-07-05 15:07 ` Alex Deucher [this message]
2022-07-05 15:07   ` Alex Deucher
2022-07-05 15:07   ` Alex Deucher

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='CADnq5_P7Ojd8beMqZ-N9EJJV9eONJVXMpaSGQt=PC9YXJ_FmHQ@mail.gmail.com' \
    --to=alexdeucher@gmail.com \
    --cc=Hawking.Zhang@amd.com \
    --cc=Jack.Xiao@amd.com \
    --cc=Xinhui.Pan@amd.com \
    --cc=airlied@linux.ie \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mukul.joshi@amd.com \
    --cc=niejianglei2021@163.com \
    /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 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.