All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: don't ignore the return from thermal_init
@ 2020-07-13 13:47 Shashank Sharma
  2020-07-13 17:36 ` Alex Deucher
  0 siblings, 1 reply; 2+ messages in thread
From: Shashank Sharma @ 2020-07-13 13:47 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alex Deucher, Sonny Jing, Maruthi Bayyavarapu, Shashank Sharma

The current hw_init code for si_dpm ignores the return value of the
function attempting to initialize the thermal controller, which in
turn sets the dpm_enabled status wrongly to true in hw_init, which
should be actually false.

This patch:
- Adds the return value check for thermal controller initialization,
  and passes the return value to dpm_enable().
- Adds a DRM_ERROR to indicate this failure.

Cc: Alex Deucher <Alexander.Deucher@amd.com>
Cc: Maruthi Bayyavarapu <maruthi.bayyavarapu@amd.com>
Cc: Sonny Jing <Sonny.Jiang@amd.com>

PS: This issue was observed on OLAND while running the reboot
stress test.

Signed-off-by: Shashank Sharma <shashank.sharma@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/si_dpm.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/si_dpm.c b/drivers/gpu/drm/amd/amdgpu/si_dpm.c
index c00ba4b23c9a..923a1da554b3 100644
--- a/drivers/gpu/drm/amd/amdgpu/si_dpm.c
+++ b/drivers/gpu/drm/amd/amdgpu/si_dpm.c
@@ -6868,7 +6868,11 @@ static int si_dpm_enable(struct amdgpu_device *adev)
 	si_start_dpm(adev);
 
 	si_enable_auto_throttle_source(adev, AMDGPU_DPM_AUTO_THROTTLE_SRC_THERMAL, true);
-	si_thermal_start_thermal_controller(adev);
+	ret = si_thermal_start_thermal_controller(adev);
+	if (ret) {
+		DRM_ERROR("si_thermal_start_thermal_controller failed\n");
+		return ret;
+	}
 
 	return 0;
 }
-- 
2.25.1

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

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

* Re: [PATCH] drm/amdgpu: don't ignore the return from thermal_init
  2020-07-13 13:47 [PATCH] drm/amdgpu: don't ignore the return from thermal_init Shashank Sharma
@ 2020-07-13 17:36 ` Alex Deucher
  0 siblings, 0 replies; 2+ messages in thread
From: Alex Deucher @ 2020-07-13 17:36 UTC (permalink / raw)
  To: Shashank Sharma
  Cc: Alex Deucher, Sonny Jing, Maruthi Bayyavarapu, amd-gfx list

On Mon, Jul 13, 2020 at 9:48 AM Shashank Sharma <shashank.sharma@amd.com> wrote:
>
> The current hw_init code for si_dpm ignores the return value of the
> function attempting to initialize the thermal controller, which in
> turn sets the dpm_enabled status wrongly to true in hw_init, which
> should be actually false.
>
> This patch:
> - Adds the return value check for thermal controller initialization,
>   and passes the return value to dpm_enable().
> - Adds a DRM_ERROR to indicate this failure.
>
> Cc: Alex Deucher <Alexander.Deucher@amd.com>
> Cc: Maruthi Bayyavarapu <maruthi.bayyavarapu@amd.com>
> Cc: Sonny Jing <Sonny.Jiang@amd.com>
>
> PS: This issue was observed on OLAND while running the reboot
> stress test.
>
> Signed-off-by: Shashank Sharma <shashank.sharma@amd.com>

I have vague memories of this not being a fatal issue so it didn't
need to be checked, but it was so long ago I can't remember, and the
relevant history is not coming to me.
Acked-by: Alex Deucher <alexander.deucher@amd.com>

> ---
>  drivers/gpu/drm/amd/amdgpu/si_dpm.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/si_dpm.c b/drivers/gpu/drm/amd/amdgpu/si_dpm.c
> index c00ba4b23c9a..923a1da554b3 100644
> --- a/drivers/gpu/drm/amd/amdgpu/si_dpm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/si_dpm.c
> @@ -6868,7 +6868,11 @@ static int si_dpm_enable(struct amdgpu_device *adev)
>         si_start_dpm(adev);
>
>         si_enable_auto_throttle_source(adev, AMDGPU_DPM_AUTO_THROTTLE_SRC_THERMAL, true);
> -       si_thermal_start_thermal_controller(adev);
> +       ret = si_thermal_start_thermal_controller(adev);
> +       if (ret) {
> +               DRM_ERROR("si_thermal_start_thermal_controller failed\n");
> +               return ret;
> +       }
>
>         return 0;
>  }
> --
> 2.25.1
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

end of thread, other threads:[~2020-07-13 17:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-13 13:47 [PATCH] drm/amdgpu: don't ignore the return from thermal_init Shashank Sharma
2020-07-13 17:36 ` 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.