drm/nouveau/pm/fan: drop the fan lock in fan_update() before rescheduling
authorMartin Peres <martin.peres@labri.fr>
Thu, 13 Mar 2014 23:26:52 +0000 (00:26 +0100)
committerJiri Slaby <jslaby@suse.cz>
Mon, 9 Jun 2014 13:53:22 +0000 (15:53 +0200)
commit35147aa3d3f688da0e76f27e8cbfeca3c1ac57d6
tree80b7cb17179120fc07d15e0449987d5bf47b03c3
parent02dc875e06b7ba1551e47828dbcaf14560ac9724
drm/nouveau/pm/fan: drop the fan lock in fan_update() before rescheduling

commit 61679fe153b2b9ea5b5e2ab93305419e85e99a9d upstream.

This should fix a deadlock that has been reported to us where fan_update()
would hold the fan lock and try to grab the alarm_program_lock to reschedule
an update. On an other CPU, the alarm_program_lock would have been taken
before calling fan_update(), leading to a deadlock.

We should Cc: <stable@vger.kernel.org> # 3.9+

Reported-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Tested-by: Timothée Ravier <tim@siosm.fr>
Tested-by: Boris Fersing (IRC nick fersingb, no public email address)
Signed-off-by: Martin Peres <martin.peres@free.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
drivers/gpu/drm/nouveau/core/subdev/therm/fan.c