提交 07df3043 编写于 作者: M Marcin Slusarz 提交者: Ben Skeggs

drm/nouveau/therm: use workqueue to shutdown the machine

orderly_poweroff cannot be called from atomic context.
Signed-off-by: NMarcin Slusarz <marcin.slusarz@gmail.com>
Acked-by: NMartin Peres <martin.peres@labri.fr>
Signed-off-by: NBen Skeggs <bskeggs@redhat.com>
上级 d0a5191d
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册