* [PATCH 2/3] drm/nv40/therm: reset temperature sensor on init
@ 2013-02-03 20:07 Marcin Slusarz
[not found] ` <1359922077-3347-2-git-send-email-marcin.slusarz-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Marcin Slusarz @ 2013-02-03 20:07 UTC (permalink / raw)
To: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Martin Peres
Current uninitialized sensor detection does not work for me on nv4b and
sensor returns crazy values (>190°C). It stabilises later, but it's too
late - therm code shutdowns the machine...
Let's just reset it on init.
Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
---
drivers/gpu/drm/nouveau/core/subdev/therm/nv40.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/nouveau/core/subdev/therm/nv40.c b/drivers/gpu/drm/nouveau/core/subdev/therm/nv40.c
index accc628..7d90844 100644
--- a/drivers/gpu/drm/nouveau/core/subdev/therm/nv40.c
+++ b/drivers/gpu/drm/nouveau/core/subdev/therm/nv40.c
@@ -173,13 +173,23 @@ nv40_therm_ctor(struct nouveau_object *parent,
return nouveau_therm_preinit(&priv->base.base);
}
+int
+nv40_therm_init(struct nouveau_object *object)
+{
+ struct nouveau_therm *therm = (void *)object;
+
+ nv40_sensor_setup(therm);
+
+ return _nouveau_therm_init(object);
+}
+
struct nouveau_oclass
nv40_therm_oclass = {
.handle = NV_SUBDEV(THERM, 0x40),
.ofuncs = &(struct nouveau_ofuncs) {
.ctor = nv40_therm_ctor,
.dtor = _nouveau_therm_dtor,
- .init = _nouveau_therm_init,
+ .init = nv40_therm_init,
.fini = _nouveau_therm_fini,
},
};
--
1.8.1
_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/nouveau
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 2/3] drm/nv40/therm: reset temperature sensor on init
[not found] ` <1359922077-3347-2-git-send-email-marcin.slusarz-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2013-02-03 20:33 ` Marcin Slusarz
2013-02-04 12:29 ` Martin Peres
1 sibling, 0 replies; 3+ messages in thread
From: Marcin Slusarz @ 2013-02-03 20:33 UTC (permalink / raw)
To: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Martin Peres
On Sun, Feb 03, 2013 at 09:07:56PM +0100, Marcin Slusarz wrote:
> Current uninitialized sensor detection does not work for me on nv4b and
> sensor returns crazy values (>190°C). It stabilises later, but it's too
> late - therm code shutdowns the machine...
>
> Let's just reset it on init.
>
> Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
> ---
> drivers/gpu/drm/nouveau/core/subdev/therm/nv40.c | 12 +++++++++++-
> 1 file changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/nouveau/core/subdev/therm/nv40.c b/drivers/gpu/drm/nouveau/core/subdev/therm/nv40.c
> index accc628..7d90844 100644
> --- a/drivers/gpu/drm/nouveau/core/subdev/therm/nv40.c
> +++ b/drivers/gpu/drm/nouveau/core/subdev/therm/nv40.c
> @@ -173,13 +173,23 @@ nv40_therm_ctor(struct nouveau_object *parent,
> return nouveau_therm_preinit(&priv->base.base);
> }
>
> +int
> +nv40_therm_init(struct nouveau_object *object)
Tiny issue: this function should be static.
> +{
> + struct nouveau_therm *therm = (void *)object;
> +
> + nv40_sensor_setup(therm);
> +
> + return _nouveau_therm_init(object);
> +}
> +
> struct nouveau_oclass
> nv40_therm_oclass = {
> .handle = NV_SUBDEV(THERM, 0x40),
> .ofuncs = &(struct nouveau_ofuncs) {
> .ctor = nv40_therm_ctor,
> .dtor = _nouveau_therm_dtor,
> - .init = _nouveau_therm_init,
> + .init = nv40_therm_init,
> .fini = _nouveau_therm_fini,
> },
> };
> --
> 1.8.1
>
_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/nouveau
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 2/3] drm/nv40/therm: reset temperature sensor on init
[not found] ` <1359922077-3347-2-git-send-email-marcin.slusarz-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-02-03 20:33 ` Marcin Slusarz
@ 2013-02-04 12:29 ` Martin Peres
1 sibling, 0 replies; 3+ messages in thread
From: Martin Peres @ 2013-02-04 12:29 UTC (permalink / raw)
To: Marcin Slusarz; +Cc: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
On 03/02/2013 21:07, Marcin Slusarz wrote:
> Current uninitialized sensor detection does not work for me on nv4b and
> sensor returns crazy values (>190°C). It stabilises later, but it's too
> late - therm code shutdowns the machine...
>
> Let's just reset it on init.
>
> Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Hmm, so it means the bios initializes your sensor at POST. This was not
the case on mine and we used to rely on the fact that nv4x's sensor was
not initialized.
Anyway, forcing a reset is not a bad idea. Please add my signed-off-by.
Thanks for your ptherm patchset :)
_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/nouveau
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-02-04 12:29 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-03 20:07 [PATCH 2/3] drm/nv40/therm: reset temperature sensor on init Marcin Slusarz
[not found] ` <1359922077-3347-2-git-send-email-marcin.slusarz-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-02-03 20:33 ` Marcin Slusarz
2013-02-04 12:29 ` Martin Peres
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.