diff mbox

drivers/gpu/drm/nouveau/nvkm/subdev/therm/temp.c: broken emergency poweroff handling

Message ID 20170923190406.GA21587@amd (mailing list archive)
State New, archived
Headers show

Commit Message

Pavel Machek Sept. 23, 2017, 7:04 p.m. UTC
Hi!

Not only it is unneccessarily complex, it is also broken; GFP_ATOMIC
allocation can fail.. and then you fail to shut down the machine.

Someone please fix this.

Thanks,
								Pavel
diff mbox

Patch

--- a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/temp.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/temp.c
@@ -120,6 +120,11 @@  nvkm_therm_sensor_event(struct nvkm_therm *therm, enum nvkm_therm_thrs thrs,
                        struct work_struct *work;

                        work = kmalloc(sizeof(*work), GFP_ATOMIC);
+                       /* FIXME:
+                          1) this is total overkill, orderly_poweroff() already
+                          uses schedule_work internally
+                          2) it would  be good to at least printk what is going on
+                       */
                        if (work) {
                                INIT_WORK(work, nv_poweroff_work);
                                schedule_work(work);