Geert Uytterhoeven a684e7d330 fbdev: fix fb_compat_ioctl() deadlocks
commit 3e680aae4e53ab54cdbb0c29257dae0cbb158e1c ("fb: convert
lock/unlock_kernel() into local fb mutex") introduced several deadlocks
in the fb_compat_ioctl() path, as mutex_lock() doesn't allow recursion,
unlike lock_kernel().  This broke frame buffer applications on 64-bit
systems with a 32-bit userland.

commit 120a37470c2831fea49fdebaceb5a7039f700ce6 ("framebuffer compat_ioctl
deadlock") fixed one of the deadlocks.

This patch fixes the remaining deadlocks:
  - Revert commit 120a37470c2831fea49fdebaceb5a7039f700ce6,
  - Extract the core logic of fb_ioctl() into a new function do_fb_ioctl(),
  - Change all callsites of fb_ioctl() where info->lock is already held to
    call do_fb_ioctl() instead,
  - Add sparse annotations to all routines that take info->lock.

Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Cc: Mikulas Patocka <mpatocka@redhat.com>
Cc: Krzysztof Helt <krzysztof.h1@wp.pl>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-11-06 15:41:19 -08:00
..
2008-10-28 17:46:02 +09:00
2008-10-26 10:27:01 +01:00
2008-10-22 01:19:39 +02:00
2008-11-01 09:49:46 -07:00
2008-10-30 15:55:47 +01:00
2008-11-02 21:40:10 +01:00
2008-11-01 09:49:46 -07:00
2008-11-01 09:50:12 -07:00
2008-10-21 07:48:33 -04:00
2008-11-01 09:50:12 -07:00
2008-11-04 08:18:19 -08:00
2008-10-16 11:21:30 -07:00
2008-11-04 08:18:19 -08:00
2008-11-04 08:18:19 -08:00
2008-11-01 09:49:46 -07:00
2008-11-01 09:49:46 -07:00
2008-11-01 09:49:46 -07:00
2008-11-04 08:18:19 -08:00
2008-10-28 21:47:17 +00:00