AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <ckoenig.leichtzumerken-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: "Huang,
	JinHuiEric" <JinHuiEric.Huang-5C7GfCeVMHo@public.gmane.org>,
	"amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org"
	<amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>,
	"Yin, Tianci (Rico)" <Tianci.Yin-5C7GfCeVMHo@public.gmane.org>
Subject: Re: [PATCH] drm/amdgpu: fix gfx ib test failed in sriov
Date: Thu, 29 Aug 2019 09:11:29 +0200	[thread overview]
Message-ID: <083833e2-aed1-c4e3-d348-0e54a0953d67@gmail.com> (raw)
In-Reply-To: <1567004342-10726-1-git-send-email-JinhuiEric.Huang-5C7GfCeVMHo@public.gmane.org>

Hi Eric,

Yin has already proposed patches for fixing this a few days ago. Please 
help to review those instead.

Thanks,
Christian

Am 28.08.19 um 16:59 schrieb Huang, JinHuiEric:
> It partially reverts the regression of
>
> commit e4a67e6cf14c258619f
> ("drm/amdgpu/psp: move TMR to cpu invisible vram region")
>
> which causes gfx ib test failed when driver loading
> in sriov system.
>
> Signed-off-by: Eric Huang <JinhuiEric.Huang@amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 16 ++++++++++++----
>   drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h |  1 +
>   2 files changed, 13 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> index 9f7cc5b..9f91ced 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> @@ -261,9 +261,14 @@ static int psp_tmr_init(struct psp_context *psp)
>   		}
>   	}
>   
> -	ret = amdgpu_bo_create_kernel(psp->adev, tmr_size, PSP_TMR_SIZE,
> -				      AMDGPU_GEM_DOMAIN_VRAM,
> -				      &psp->tmr_bo, &psp->tmr_mc_addr, NULL);
> +	if (amdgpu_sriov_vf(psp->adev))
> +		ret = amdgpu_bo_create_kernel(psp->adev, tmr_size, PSP_TMR_SIZE,
> +			      AMDGPU_GEM_DOMAIN_VRAM,
> +			      &psp->tmr_bo, &psp->tmr_mc_addr, &psp->tmr_buf);
> +	else
> +		ret = amdgpu_bo_create_kernel(psp->adev, tmr_size, PSP_TMR_SIZE,
> +			      AMDGPU_GEM_DOMAIN_VRAM,
> +			      &psp->tmr_bo, &psp->tmr_mc_addr, NULL);
>   
>   	return ret;
>   }
> @@ -1216,7 +1221,10 @@ static int psp_hw_fini(void *handle)
>   
>   	psp_ring_destroy(psp, PSP_RING_TYPE__KM);
>   
> -	amdgpu_bo_free_kernel(&psp->tmr_bo, &psp->tmr_mc_addr, NULL);
> +	if (amdgpu_sriov_vf(adev))
> +		amdgpu_bo_free_kernel(&psp->tmr_bo, &psp->tmr_mc_addr, &psp->tmr_buf);
> +	else
> +		amdgpu_bo_free_kernel(&psp->tmr_bo, &psp->tmr_mc_addr, NULL);
>   	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,
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h
> index bc0947f..b73d4aa 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h
> @@ -171,6 +171,7 @@ struct psp_context
>   	/* tmr buffer */
>   	struct amdgpu_bo		*tmr_bo;
>   	uint64_t			tmr_mc_addr;
> +	void				*tmr_buf;
>   
>   	/* asd firmware and buffer */
>   	const struct firmware		*asd_fw;

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

      parent reply	other threads:[~2019-08-29  7:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-28 14:59 [PATCH] drm/amdgpu: fix gfx ib test failed in sriov Huang, JinHuiEric
     [not found] ` <1567004342-10726-1-git-send-email-JinhuiEric.Huang-5C7GfCeVMHo@public.gmane.org>
2019-08-29  7:11   ` Christian König [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=083833e2-aed1-c4e3-d348-0e54a0953d67@gmail.com \
    --to=ckoenig.leichtzumerken-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=JinHuiEric.Huang-5C7GfCeVMHo@public.gmane.org \
    --cc=Tianci.Yin-5C7GfCeVMHo@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=christian.koenig-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox