From 986c3e1181bd907f9c0a61be3fb3e57a72e6212d Mon Sep 17 00:00:00 2001 From: Marcin Slusarz Date: Sun, 3 Feb 2013 19:28:14 +0100 Subject: [PATCH] --- yaml --- r: 358276 b: refs/heads/master c: 07df30435eecce98961dabbac16787969975a080 h: refs/heads/master v: v3 --- [refs] | 2 +- .../gpu/drm/nouveau/core/subdev/therm/temp.c | 18 ++++++++++++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 4824084eacf8..34f9d5097db6 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: d0a5191dcf5f37cf0942c4b65fa4a2c975631c0b +refs/heads/master: 07df30435eecce98961dabbac16787969975a080 diff --git a/trunk/drivers/gpu/drm/nouveau/core/subdev/therm/temp.c b/trunk/drivers/gpu/drm/nouveau/core/subdev/therm/temp.c index 8f27b44db4da..b37624af8297 100644 --- a/trunk/drivers/gpu/drm/nouveau/core/subdev/therm/temp.c +++ b/trunk/drivers/gpu/drm/nouveau/core/subdev/therm/temp.c @@ -90,6 +90,13 @@ nouveau_therm_sensor_get_threshold_state(struct nouveau_therm *therm, return priv->sensor.alarm_state[thrs]; } +static void +nv_poweroff_work(struct work_struct *work) +{ + orderly_poweroff(true); + kfree(work); +} + void nouveau_therm_sensor_event(struct nouveau_therm *therm, enum nouveau_therm_thrs thrs, enum nouveau_therm_thrs_direction dir) @@ -128,8 +135,15 @@ void nouveau_therm_sensor_event(struct nouveau_therm *therm, priv->emergency.pause(therm, active); break; case NOUVEAU_THERM_THRS_SHUTDOWN: - if (active) - orderly_poweroff(true); + if (active) { + struct work_struct *work; + + work = kmalloc(sizeof(*work), GFP_ATOMIC); + if (work) { + INIT_WORK(work, nv_poweroff_work); + schedule_work(work); + } + } break; case NOUVEAU_THERM_THRS_NR: break;