]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915: unload: fix error_work races
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Fri, 20 Aug 2010 16:18:48 +0000 (18:18 +0200)
committerChris Wilson <chris@chris-wilson.co.uk>
Wed, 8 Sep 2010 09:13:24 +0000 (10:13 +0100)
commita62f109c45019d60b20b4a43a1ea9b3efe1ea33f
treeccbadf9db22bb0ff1db7bdb9a4414246f184a7bb
parentddee867c7f2e23e9e08dda81f6672d49682847db
drm/i915: unload: fix error_work races

This is the first patch to clean up module unload races due to
outstanding timers/work. Preparatory step: Thou shalt not destroy
the workqueue when new work might still get enqued.

Now error_work gets queued by the hangcheck timer and only (atomically)
reads the chip wedged status. So cancel it right after the hangcheck
timer is killed. But the hangcheck is armed by interrupts, so move
everything after irqs are disabled.

Also change a del_timer to a del_timer_sync in the ums gem code, the
hangcheck timer is self-rearming.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
drivers/gpu/drm/i915/i915_dma.c
drivers/gpu/drm/i915/i915_gem.c