[v4,33/37] therm: trigger reclock in temperature daemon

Submitted by Karol Herbst on April 18, 2016, 7:14 p.m.

Details

Message ID 1461006851-5007-34-git-send-email-nouveau@karolherbst.de
State New
Headers show
Series "Volting/Clocking improvements for Fermi and newer" ( rev: 4 ) in Nouveau

Not browsing as part of any series.

Commit Message

Karol Herbst April 18, 2016, 7:14 p.m.
depending on the temperature, cstates might become unreachable or the maped
voltage of a cstate changes. We want to adjust to that.

Signed-off-by: Karol Herbst <nouveau@karolherbst.de>
---
 drm/nouveau/nvkm/subdev/therm/base.c | 5 +++++
 1 file changed, 5 insertions(+)

Patch hide | download patch | download mbox

diff --git a/drm/nouveau/nvkm/subdev/therm/base.c b/drm/nouveau/nvkm/subdev/therm/base.c
index 0c0feec..566fe5d 100644
--- a/drm/nouveau/nvkm/subdev/therm/base.c
+++ b/drm/nouveau/nvkm/subdev/therm/base.c
@@ -23,6 +23,8 @@ 
  */
 #include "priv.h"
 
+#include <subdev/clk.h>
+
 int
 nvkm_therm_temp_get(struct nvkm_therm *therm)
 {
@@ -153,7 +155,10 @@  nvkm_therm_alarm(struct nvkm_alarm *alarm)
 {
 	struct nvkm_therm *therm =
 	       container_of(alarm, struct nvkm_therm, alarm);
+	struct nvkm_clk *clk = therm->subdev.device->clk;
 	nvkm_therm_update(therm, -1);
+	if (clk)
+		nvkm_clk_update(clk, false);
 }
 
 int

Comments

On 18/04/16 22:14, Karol Herbst wrote:
> depending on the temperature, cstates might become unreachable or the maped
> voltage of a cstate changes. We want to adjust to that.

Yeah! That was a lot of plumbing to get to this, but it is here!

Reviewed-by: Martin Peres <martin.peres@free.fr>
>
> Signed-off-by: Karol Herbst <nouveau@karolherbst.de>
> ---
>   drm/nouveau/nvkm/subdev/therm/base.c | 5 +++++
>   1 file changed, 5 insertions(+)
>
> diff --git a/drm/nouveau/nvkm/subdev/therm/base.c b/drm/nouveau/nvkm/subdev/therm/base.c
> index 0c0feec..566fe5d 100644
> --- a/drm/nouveau/nvkm/subdev/therm/base.c
> +++ b/drm/nouveau/nvkm/subdev/therm/base.c
> @@ -23,6 +23,8 @@
>    */
>   #include "priv.h"
>   
> +#include <subdev/clk.h>
> +
>   int
>   nvkm_therm_temp_get(struct nvkm_therm *therm)
>   {
> @@ -153,7 +155,10 @@ nvkm_therm_alarm(struct nvkm_alarm *alarm)
>   {
>   	struct nvkm_therm *therm =
>   	       container_of(alarm, struct nvkm_therm, alarm);
> +	struct nvkm_clk *clk = therm->subdev.device->clk;
>   	nvkm_therm_update(therm, -1);
> +	if (clk)
> +		nvkm_clk_update(clk, false);
>   }
>   
>   int