From: "Christian König" <ckoenig.leichtzumerken@gmail.com>
To: Alex Jivin <alex.jivin@amd.com>, amd-gfx@lists.freedesktop.org
Cc: Alex Deucher <alexander.deucher@amd.com>,
Luben Tuikov <luben.tuikov@amd.com>
Subject: Re: [PATCH] drm/amdgpu: Adding wait time before reading upll control register
Date: Fri, 26 Jun 2020 19:04:20 +0200 [thread overview]
Message-ID: <a3c7780c-d891-4cf6-f49b-e72692803615@gmail.com> (raw)
In-Reply-To: <20200626161239.19762-1-alex.jivin@amd.com>
Am 26.06.20 um 18:12 schrieb Alex Jivin:
> Adding a delay between writing to UVD control register and reading from it.
> This is to allow the HW to process the write command.
>
> Signed-off-by: Alex Jivin <alex.jivin@amd.com>
> Suggested-By: Luben Tukov <luben.tuikov@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/si.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/si.c b/drivers/gpu/drm/amd/amdgpu/si.c
> index 9d7b4ccd17b8..42cdc14fb79d 100644
> --- a/drivers/gpu/drm/amd/amdgpu/si.c
> +++ b/drivers/gpu/drm/amd/amdgpu/si.c
> @@ -1435,6 +1435,12 @@ static int si_uvd_send_upll_ctlreq(struct amdgpu_device *adev,
> /* Assert UPLL_CTLREQ */
> WREG32_P(cg_upll_func_cntl, UPLL_CTLREQ_MASK, ~UPLL_CTLREQ_MASK);
>
> + /* Waiting for HW to process the previous write.
> + * This is to give a chance to HW to act before
> + * the first read is done.
> + */
> + mdelay(1);
> +
Mhm, that is most likely not a good idea.
We need to issue a read after the write to make sure that the stuff is
send out to the hardware.
Adding a delay here is probably just postponing that. Do we have some
note in the documentation that this is necessary?
Christian.
> /* Wait for CTLACK and CTLACK2 to get asserted */
> for (i = 0; i < SI_MAX_CTLACKS_ASSERTION_WAIT; ++i) {
> uint32_t mask = UPLL_CTLACK_MASK | UPLL_CTLACK2_MASK;
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
next prev parent reply other threads:[~2020-06-26 17:04 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-26 16:12 [PATCH] drm/amdgpu: Adding wait time before reading upll control register Alex Jivin
2020-06-26 17:04 ` Christian König [this message]
2020-06-29 22:46 ` Luben Tuikov
2020-06-30 7:01 ` Christian König
2020-07-06 12:42 ` Luben Tuikov
2020-07-06 12:59 ` Christian König
2020-07-06 13:53 ` Luben Tuikov
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=a3c7780c-d891-4cf6-f49b-e72692803615@gmail.com \
--to=ckoenig.leichtzumerken@gmail.com \
--cc=alex.jivin@amd.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=christian.koenig@amd.com \
--cc=luben.tuikov@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).