All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: check CG flag before querying CG status
@ 2021-08-02  9:30 Lang Yu
  2021-08-02 16:32 ` Alex Deucher
  0 siblings, 1 reply; 2+ messages in thread
From: Lang Yu @ 2021-08-02  9:30 UTC (permalink / raw)
  To: amd-gfx; +Cc: Huang Rui, Alex Deucher, Lang Yu

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] drm/amdgpu: check CG flag before querying CG status
  2021-08-02  9:30 [PATCH] drm/amdgpu: check CG flag before querying CG status Lang Yu
@ 2021-08-02 16:32 ` Alex Deucher
  0 siblings, 0 replies; 2+ messages in thread
From: Alex Deucher @ 2021-08-02 16:32 UTC (permalink / raw)
  To: Lang Yu; +Cc: amd-gfx list, Huang Rui, Alex Deucher

On Mon, Aug 2, 2021 at 5:31 AM Lang Yu <lang.yu@amd.com> wrote:
>
> 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;
> +       }

This is fine if someone has disabled all CG flags, but maybe it would
be better to check each flag individually within the
get_clockgating_state() callback for each IP.  Do we need a similar
check for PG flags?

Alex

> +
>         for (i = 0; i < adev->num_ip_blocks; i++) {
>                 if (!adev->ip_blocks[i].status.valid)
>                         continue;
> --
> 2.25.1
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-08-02 16:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-02  9:30 [PATCH] drm/amdgpu: check CG flag before querying CG status Lang Yu
2021-08-02 16:32 ` Alex Deucher

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.