Re: [PATCH] drm/amdgpu: check CG flag before querying CG status

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Aug 2, 2021 at 5:31 AM Lang Yu <lang.yu@xxxxxxx> 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@xxxxxxx>
> ---
>  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
>



[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux