All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Zhang, Jerry (Junwei)" <Jerry.Zhang-5C7GfCeVMHo@public.gmane.org>
To: "Huang Rui" <ray.huang-5C7GfCeVMHo@public.gmane.org>,
	"Alex Deucher" <alexander.deucher-5C7GfCeVMHo@public.gmane.org>,
	"Christian König" <christian.koenig-5C7GfCeVMHo@public.gmane.org>,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: Re: [PATCH v2 1/3] drm/amdgpu: remove superfluous check
Date: Wed, 5 Jul 2017 13:56:28 +0800	[thread overview]
Message-ID: <595C7F8C.4090905@amd.com> (raw)
In-Reply-To: <1499232741-4015-1-git-send-email-ray.huang-5C7GfCeVMHo@public.gmane.org>

the series is
Reviewed-by: Junwei Zhang <Jerry.Zhang@amd.com>

Jerry

On 07/05/2017 01:32 PM, Huang Rui wrote:
> Signed-off-by: Huang Rui <ray.huang@amd.com>
> ---
>
> Changes from V1 -> V2
> - amdgpu_bo_free_kernel is safe even the bo is NULL, so remove the "if" check.
>
> Thanks,
> Ray
>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 15 +++++----------
>   drivers/gpu/drm/amd/amdgpu/psp_v3_1.c   |  8 ++++----
>   2 files changed, 9 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> index 79db294..d0104c7 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> @@ -435,16 +435,11 @@ static int psp_hw_fini(void *handle)
>
>   	psp_ring_destroy(psp, PSP_RING_TYPE__KM);
>
> -	if (psp->tmr_buf)
> -		amdgpu_bo_free_kernel(&psp->tmr_bo, &psp->tmr_mc_addr, &psp->tmr_buf);
> -
> -	if (psp->fw_pri_buf)
> -		amdgpu_bo_free_kernel(&psp->fw_pri_bo,
> -				      &psp->fw_pri_mc_addr, &psp->fw_pri_buf);
> -
> -	if (psp->fence_buf_bo)
> -		amdgpu_bo_free_kernel(&psp->fence_buf_bo,
> -				      &psp->fence_buf_mc_addr, &psp->fence_buf);
> +	amdgpu_bo_free_kernel(&psp->tmr_bo, &psp->tmr_mc_addr, &psp->tmr_buf);
> +	amdgpu_bo_free_kernel(&psp->fw_pri_bo,
> +			      &psp->fw_pri_mc_addr, &psp->fw_pri_buf);
> +	amdgpu_bo_free_kernel(&psp->fence_buf_bo,
> +			      &psp->fence_buf_mc_addr, &psp->fence_buf);
>
>   	kfree(psp->cmd);
>   	psp->cmd = NULL;
> diff --git a/drivers/gpu/drm/amd/amdgpu/psp_v3_1.c b/drivers/gpu/drm/amd/amdgpu/psp_v3_1.c
> index 988ebd9..2718e86 100644
> --- a/drivers/gpu/drm/amd/amdgpu/psp_v3_1.c
> +++ b/drivers/gpu/drm/amd/amdgpu/psp_v3_1.c
> @@ -341,10 +341,10 @@ int psp_v3_1_ring_destroy(struct psp_context *psp, enum psp_ring_type ring_type)
>   	ret = psp_wait_for(psp, SOC15_REG_OFFSET(MP0, 0, mmMP0_SMN_C2PMSG_64),
>   			   0x80000000, 0x80000000, false);
>
> -	if (ring->ring_mem)
> -		amdgpu_bo_free_kernel(&adev->firmware.rbuf,
> -				      &ring->ring_mem_mc_addr,
> -				      (void **)&ring->ring_mem);
> +	amdgpu_bo_free_kernel(&adev->firmware.rbuf,
> +			      &ring->ring_mem_mc_addr,
> +			      (void **)&ring->ring_mem);
> +
>   	return ret;
>   }
>
>
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

  parent reply	other threads:[~2017-07-05  5:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-05  5:32 [PATCH v2 1/3] drm/amdgpu: remove superfluous check Huang Rui
     [not found] ` <1499232741-4015-1-git-send-email-ray.huang-5C7GfCeVMHo@public.gmane.org>
2017-07-05  5:32   ` [PATCH v2 2/3] drm/amdgpu: fix missed asd bo free when hw_fini Huang Rui
2017-07-05  5:32   ` [PATCH v2 3/3] drm/amdgpu: make psp cmd buffer as a reserve memory Huang Rui
2017-07-05  5:56   ` Zhang, Jerry (Junwei) [this message]
2017-07-05  7:24   ` [PATCH v2 1/3] drm/amdgpu: remove superfluous check Christian König

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=595C7F8C.4090905@amd.com \
    --to=jerry.zhang-5c7gfcevmho@public.gmane.org \
    --cc=alexander.deucher-5C7GfCeVMHo@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=christian.koenig-5C7GfCeVMHo@public.gmane.org \
    --cc=ray.huang-5C7GfCeVMHo@public.gmane.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 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.