All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <christian.koenig@amd.com>
To: Rohit Khaire <rohit.khaire@amd.com>,
	amd-gfx@lists.freedesktop.org,
	Felix Kuehling <Felix.Kuehling@amd.com>,
	Alexander Deucher <Alexander.Deucher@amd.com>,
	Hawking Zhang <Hawking.Zhang@amd.com>,
	Emily Deng <Emily.Deng@amd.com>, Monk Liu <Monk.Liu@amd.com>,
	Peng Ju Zhou <PengJu.Zhou@amd.com>,
	Horace Chen <Horace.Chen@amd.com>
Cc: Davis Ming <Davis.Ming@amd.com>
Subject: Re: [PATCH] drm/amdgpu: Use PSP to program IH_RB_CNTL_RING1/2 on SRIOV
Date: Mon, 7 Jun 2021 21:41:55 +0200	[thread overview]
Message-ID: <9a2f4e4d-8f5e-e3db-9d90-73fe3f46c2ae@amd.com> (raw)
In-Reply-To: <20210607193929.24239-1-rohit.khaire@amd.com>



Am 07.06.21 um 21:39 schrieb Rohit Khaire:
> This is similar to IH_RB_CNTL programming in
> navi10_ih_toggle_ring_interrupts
>
> Signed-off-by: Rohit Khaire <rohit.khaire@amd.com>

Acked-by: Christian König <christian.koenig@amd.com>

> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c |  2 ++
>   drivers/gpu/drm/amd/amdgpu/navi10_ih.c  | 20 +++++++++++++++-----
>   2 files changed, 17 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> index 47ceb783e2a5..058b1b1271e1 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> @@ -683,6 +683,8 @@ int psp_reg_program(struct psp_context *psp, enum psp_reg_prog_id reg,
>   
>   	psp_prep_reg_prog_cmd_buf(cmd, reg, value);
>   	ret = psp_cmd_submit_buf(psp, NULL, cmd, psp->fence_buf_mc_addr);
> +	if (ret)
> +		DRM_ERROR("PSP failed to program reg id %d", reg);
>   
>   	kfree(cmd);
>   	return ret;
> diff --git a/drivers/gpu/drm/amd/amdgpu/navi10_ih.c b/drivers/gpu/drm/amd/amdgpu/navi10_ih.c
> index eac564e8dd52..376ea281c4a7 100644
> --- a/drivers/gpu/drm/amd/amdgpu/navi10_ih.c
> +++ b/drivers/gpu/drm/amd/amdgpu/navi10_ih.c
> @@ -120,11 +120,23 @@ force_update_wptr_for_self_int(struct amdgpu_device *adev,
>   	ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL_RING1,
>   				   RB_USED_INT_THRESHOLD, threshold);
>   
> -	WREG32_SOC15(OSSSYS, 0, mmIH_RB_CNTL_RING1, ih_rb_cntl);
> +	if (amdgpu_sriov_vf(adev) && amdgpu_sriov_reg_indirect_ih(adev)) {
> +		if (psp_reg_program(&adev->psp, PSP_REG_IH_RB_CNTL_RING1, ih_rb_cntl))
> +			return;
> +	} else {
> +		WREG32_SOC15(OSSSYS, 0, mmIH_RB_CNTL_RING1, ih_rb_cntl);
> +	}
> +
>   	ih_rb_cntl = RREG32_SOC15(OSSSYS, 0, mmIH_RB_CNTL_RING2);
>   	ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL_RING2,
>   				   RB_USED_INT_THRESHOLD, threshold);
> -	WREG32_SOC15(OSSSYS, 0, mmIH_RB_CNTL_RING2, ih_rb_cntl);
> +	if (amdgpu_sriov_vf(adev) && amdgpu_sriov_reg_indirect_ih(adev)) {
> +		if (psp_reg_program(&adev->psp, PSP_REG_IH_RB_CNTL_RING2, ih_rb_cntl))
> +			return;
> +	} else {
> +		WREG32_SOC15(OSSSYS, 0, mmIH_RB_CNTL_RING2, ih_rb_cntl);
> +	}
> +
>   	WREG32_SOC15(OSSSYS, 0, mmIH_CNTL2, ih_cntl);
>   }
>   
> @@ -153,10 +165,8 @@ static int navi10_ih_toggle_ring_interrupts(struct amdgpu_device *adev,
>   		tmp = REG_SET_FIELD(tmp, IH_RB_CNTL, ENABLE_INTR, (enable ? 1 : 0));
>   
>   	if (amdgpu_sriov_vf(adev) && amdgpu_sriov_reg_indirect_ih(adev)) {
> -		if (psp_reg_program(&adev->psp, ih_regs->psp_reg_id, tmp)) {
> -			DRM_ERROR("PSP program IH_RB_CNTL failed!\n");
> +		if (psp_reg_program(&adev->psp, ih_regs->psp_reg_id, tmp))
>   			return -ETIMEDOUT;
> -		}
>   	} else {
>   		WREG32(ih_regs->ih_rb_cntl, tmp);
>   	}

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

  reply	other threads:[~2021-06-07 19:42 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-07 14:23 [PATCH] drm/amdgpu: Use PSP to program IH_RB_CNTL_RING1/2 on SRIOV Rohit Khaire
2021-06-07 14:31 ` Christian König
2021-06-07 15:30   ` Khaire, Rohit
2021-06-07 15:57     ` Christian König
2021-06-07 15:59       ` Khaire, Rohit
2021-06-07 16:29         ` Christian König
2021-06-07 16:36           ` Felix Kuehling
2021-06-07 16:42             ` Christian König
2021-06-07 17:33               ` Khaire, Rohit
2021-06-07 17:40                 ` Christian König
2021-06-07 19:39                   ` Rohit Khaire
2021-06-07 19:41                     ` Christian König [this message]
2021-06-08 14:08                       ` 回复: " Chen, Horace

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=9a2f4e4d-8f5e-e3db-9d90-73fe3f46c2ae@amd.com \
    --to=christian.koenig@amd.com \
    --cc=Alexander.Deucher@amd.com \
    --cc=Davis.Ming@amd.com \
    --cc=Emily.Deng@amd.com \
    --cc=Felix.Kuehling@amd.com \
    --cc=Hawking.Zhang@amd.com \
    --cc=Horace.Chen@amd.com \
    --cc=Monk.Liu@amd.com \
    --cc=PengJu.Zhou@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=rohit.khaire@amd.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.