diff options
author | Marcin Slusarz <marcin.slusarz@gmail.com> | 2013-02-03 19:28:14 +0100 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2013-02-20 16:00:42 +1000 |
commit | 07df30435eecce98961dabbac16787969975a080 (patch) | |
tree | ef214fe622088a431096b830912fa03f760e5428 /drivers/gpu/drm | |
parent | d0a5191dcf5f37cf0942c4b65fa4a2c975631c0b (diff) |
drm/nouveau/therm: use workqueue to shutdown the machine
orderly_poweroff cannot be called from atomic context.
Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Acked-by: Martin Peres <martin.peres@labri.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r-- | drivers/gpu/drm/nouveau/core/subdev/therm/temp.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/drivers/gpu/drm/nouveau/core/subdev/therm/temp.c b/drivers/gpu/drm/nouveau/core/subdev/therm/temp.c index 8f27b44db4da..b37624af8297 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/therm/temp.c +++ b/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; |