Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1738059 > unrolled thread

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

Started byPavel Machek <pavel@ucw.cz>
First post2017-09-23 21:10 +0200
Last post2017-09-23 21:10 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  drivers/gpu/drm/nouveau/nvkm/subdev/therm/temp.c: broken emergency  poweroff handling Pavel Machek <pavel@ucw.cz> - 2017-09-23 21:10 +0200

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

FromPavel Machek <pavel@ucw.cz>
Date2017-09-23 21:10 +0200
Subjectdrivers/gpu/drm/nouveau/nvkm/subdev/therm/temp.c: broken emergency poweroff handling
Message-ID<usXYm-6Zc-21@gated-at.bofh.it>

[Multipart message — attachments visible in raw view] — view raw

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

--- 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);


-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web