From: Lang Yu <lang.yu@amd.com>
To: <amd-gfx@lists.freedesktop.org>
Cc: Huang Rui <ray.huang@amd.com>,
Alex Deucher <alexander.deucher@amd.com>,
Lang Yu <lang.yu@amd.com>
Subject: [PATCH] drm/amdgpu: check CG flag before querying CG status
Date: Mon, 2 Aug 2021 17:30:26 +0800 [thread overview]
Message-ID: <20210802093026.277263-1-lang.yu@amd.com> (raw)
For ASICs which don't supoort clock gating, querying CG status
may cause a hardware hang issue. So add a CG flag check to exit
directly in such a case.
Signed-off-by: Lang Yu <lang.yu@amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index b1d2dc39e8be..a7afcdc50ca8 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -1671,6 +1671,11 @@ void amdgpu_device_ip_get_clockgating_state(struct amdgpu_device *adev,
{
int i;
+ if (!adev->cg_flags) {
+ *flags = 0;
+ return;
+ }
+
for (i = 0; i < adev->num_ip_blocks; i++) {
if (!adev->ip_blocks[i].status.valid)
continue;
--
2.25.1
next reply other threads:[~2021-08-02 9:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-02 9:30 Lang Yu [this message]
2021-08-02 16:32 ` [PATCH] drm/amdgpu: check CG flag before querying CG status 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=20210802093026.277263-1-lang.yu@amd.com \
--to=lang.yu@amd.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=ray.huang@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.