kernel-ark/drivers/video
Jeremy Kerr 8dab637612 ps3fb: fix deadlock on kexec()
Since the introduction of the acquire_console_sem calls in
0333d83509, kexecing can cause the
kernel to deadlock:

 ps3fb_shutdown()
  -> unregister_framebuffer()
  -> fb_notifier_call_chain(FB_EVENT_FB_UNBIND)
  -> fbcon_fb_unbind()
  -> unbind_con_driver()
  -> bind_con_driver()
	[ acquires console_sem ]
  -> fbcon_deinit()
  -> fbops->fb_release(newinfo, 0)
  -> ps3fb_release()
  -> ps3fb_sync()
	[ acquires console_sem ]

This change avoids the deadlock by moving the acquire_console_sem()
out of ps3fb_sync(), and puts it into the two other callsites, leaving
ps3fb_release() to call ps3fb_sync() without the console semaphore.

[Geert]
  - Corrected call sequence above
  - ps3fb_release() may be called with and without console_sem held. This is an
    inconsistency that should be fixed at the fb level, but for now, try to
    acquire console_sem in ps3fb_release().

    I think it's safer to let ps3fb_release() try to acquire console_sem and
    not refresh the screen if it fails, than to call ps3fb_sync() without
    holding console_sem, as ps3fb_par may be modified at the same time, causing
    crashes or lockups.

    Besides, ps3fb_release() only calls ps3fb_sync() to refresh the screen
    when display flipping is disabled, which is an uncommon case (except during
    shutdown/kexec).

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-01-11 11:47:43 -08:00
..
aty radeonfb: add chip definition for RV370 5b63 2007-11-26 19:19:19 -08:00
backlight fbdev: change asm/uaccess.h to linux/uaccess.h 2007-10-16 09:43:17 -07:00
console Blackfin arch: punt CONFIG_BFIN -- we already have CONFIG_BLACKFIN 2007-11-23 14:28:44 +08:00
display
geode LXFB: use the correct MSR number for panel support 2007-11-14 18:45:38 -08:00
i810
intelfb Convert files to UTF-8 and some cleanups 2007-10-19 23:21:04 +02:00
kyro fbdev: change asm/uaccess.h to linux/uaccess.h 2007-10-16 09:43:17 -07:00
logo logo.c: get rid of mips_machgroup 2007-10-18 14:37:17 -07:00
matrox fbdev: change asm/uaccess.h to linux/uaccess.h 2007-10-16 09:43:17 -07:00
mbx
nvidia nvidiafb: Correctly assign the i2c class with the port reversal 2007-10-16 09:43:20 -07:00
omap fb menu: fix FB_OMAP dependencies so that menu is displayed correctly 2007-10-30 08:06:55 -07:00
pnx4008 define global BIT macro 2007-10-19 11:53:42 -07:00
riva
savage fbdev: change asm/uaccess.h to linux/uaccess.h 2007-10-16 09:43:17 -07:00
sis video/sis/: fix negative array index 2007-11-14 18:45:38 -08:00
vermilion more UTF-8 conversions 2007-10-19 23:22:11 +02:00
68328fb.c
acornfb.c Remove the arm26 port 2007-07-31 15:39:39 -07:00
acornfb.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
amba-clcd.c
amifb.c Convert files to UTF-8 and some cleanups 2007-10-19 23:21:04 +02:00
arcfb.c fbdev: change asm/uaccess.h to linux/uaccess.h 2007-10-16 09:43:17 -07:00
arkfb.c
asiliantfb.c
atafb_iplan2p2.c
atafb_iplan2p4.c
atafb_iplan2p8.c
atafb_mfb.c
atafb_utils.h m68k: Atari fb revival 2007-05-04 17:59:05 -07:00
atafb.c fbdev: change asm/uaccess.h to linux/uaccess.h 2007-10-16 09:43:17 -07:00
atafb.h
atmel_lcdfb.c atmel_lcdfb: LCDC startup fix 2007-11-29 09:24:53 -08:00
au1100fb.c au1100fb: fix modpost warnings 2007-10-18 14:37:17 -07:00
au1100fb.h
au1200fb.c
au1200fb.h
bf54x-lq043fb.c bf54x-lq043fb: framebuffer driver for Blackfin BF54x framebuffer device driver 2007-10-16 09:43:20 -07:00
bt431.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
bt455.h
bw2.c [VIDEO]: Do not prom_halt() in cg3 and bw2 device probe. 2007-08-26 18:49:08 -07:00
c2p.c
c2p.h
cfbcopyarea.c fbdev: copyarea function taught to fully support swapped pixel order in byte 2007-10-16 09:43:23 -07:00
cfbfillrect.c fbdev: Support for byte-reversed framebuffer formats 2007-10-16 09:43:19 -07:00
cfbimgblt.c fbdev: Support for byte-reversed framebuffer formats 2007-10-16 09:43:19 -07:00
cg3.c
cg6.c
cg14.c
chipsfb.c
cirrusfb.c cirrusfb nonsense 2007-10-27 22:18:12 -07:00
clps711xfb.c fbdev: change asm/uaccess.h to linux/uaccess.h 2007-10-16 09:43:17 -07:00
controlfb.c
controlfb.h
cyber2000fb.c [ARM] 4645/1: Cyberpro: Trivial fix to restore 16bpp mode. 2007-11-08 23:29:36 +00:00
cyber2000fb.h
cyblafb.c
dnfb.c [PATCH] vt: Remove VT-specific declarations and definitions from tty.h 2006-07-10 13:24:16 -07:00
edid.h
efifb.c x86_64 EFI boot support: EFI frame buffer driver 2007-11-29 09:24:54 -08:00
epson1355fb.c fbdev: change asm/uaccess.h to linux/uaccess.h 2007-10-16 09:43:17 -07:00
fb_ddc.c fb_ddc: fix DDC lines quirk 2007-11-29 09:24:52 -08:00
fb_defio.c fbdev: change asm/uaccess.h to linux/uaccess.h 2007-10-16 09:43:17 -07:00
fb_draw.h fbdev: copyarea function taught to fully support swapped pixel order in byte 2007-10-16 09:43:23 -07:00
fb_notify.c
fb_sys_fops.c fbdev: change asm/uaccess.h to linux/uaccess.h 2007-10-16 09:43:17 -07:00
fbcmap.c fbdev: change asm/uaccess.h to linux/uaccess.h 2007-10-16 09:43:17 -07:00
fbcvt.c
fbmem.c fb: move and rename extern declaration for global_mode_option 2007-10-16 09:43:22 -07:00
fbmon.c
fbsysfs.c
ffb.c
fm2fb.c
g364fb.c
gbefb.c gbefb: fix section mismatch warnings 2007-11-14 18:45:42 -08:00
gxt4500.c Add missing newlines to some uses of dev_<level> messages 2007-10-18 14:37:28 -07:00
hecubafb.c fbdev: change asm/uaccess.h to linux/uaccess.h 2007-10-16 09:43:17 -07:00
hgafb.c
hitfb.c
hpfb.c
igafb.c
imacfb.c imacfb: remove reference to otherwise-unused, non-existent screen_info.imacpm_seg 2007-11-29 09:24:53 -08:00
imsttfb.c fbdev: change asm/uaccess.h to linux/uaccess.h 2007-10-16 09:43:17 -07:00
imxfb.c imxfb: fast read flag and nonstandard field configurable 2007-10-16 09:43:21 -07:00
imxfb.h
Kconfig x86_64 EFI boot support: EFI frame buffer driver 2007-11-29 09:24:54 -08:00
leo.c
macfb.c
macmodes.c drivers/video/macmodes.c:mac_find_mode() mustn't be __devinit 2007-07-17 10:23:13 -07:00
macmodes.h
Makefile x86_64 EFI boot support: EFI frame buffer driver 2007-11-29 09:24:54 -08:00
maxinefb.c
modedb.c fb modedb: Refactor confusing mode_option assignment 2007-10-18 14:37:17 -07:00
neofb.c fbdev: change asm/uaccess.h to linux/uaccess.h 2007-10-16 09:43:17 -07:00
offb.c
output.c
p9100.c
platinumfb.c [POWERPC] Fix platinumfb framebuffer 2007-09-22 14:49:22 +10:00
platinumfb.h
pm2fb.c pm2fb: replace busy waiting with cpu_relax 2007-10-16 09:43:19 -07:00
pm3fb.c pm3fb: replace busy waiting with cpu_relax 2007-10-16 09:43:19 -07:00
pmag-aa-fb.c
pmag-ba-fb.c drivers/video/pmag-ba-fb.c: improve diagnostics 2007-10-16 09:43:19 -07:00
pmagb-b-fb.c pmagb-b-fb: improve diagnostics 2007-10-16 09:43:20 -07:00
ps3fb.c ps3fb: fix deadlock on kexec() 2008-01-11 11:47:43 -08:00
pvr2fb.c fbdev: change asm/uaccess.h to linux/uaccess.h 2007-10-16 09:43:17 -07:00
pxafb.c fbdev: change asm/uaccess.h to linux/uaccess.h 2007-10-16 09:43:17 -07:00
pxafb.h
q40fb.c
s1d13xxxfb.c drivers/video/s1d13xxxfb.c: fix build as module with dbg 2007-11-14 18:45:38 -08:00
s3c2410fb.c Convert files to UTF-8 and some cleanups 2007-10-19 23:21:04 +02:00
s3c2410fb.h s3c2410fb: source code improvements 2007-10-16 09:43:18 -07:00
s3fb.c s3fb: do not allow incorrect pixclock settings 2007-10-16 09:43:23 -07:00
sa1100fb.c fbdev: change asm/uaccess.h to linux/uaccess.h 2007-10-16 09:43:17 -07:00
sa1100fb.h
sbuslib.c
sbuslib.h [SPARC]: Fix sbusfb build. 2006-01-17 15:53:11 -08:00
sgivwfb.c sgivwfb: the pseudo_palette is only 16 elements long 2007-07-17 10:23:12 -07:00
skeletonfb.c
sm501fb.c
sstfb.c fbdev: change asm/uaccess.h to linux/uaccess.h 2007-10-16 09:43:17 -07:00
sticore.h
stifb.c
sunxvr500.c
sunxvr2500.c
svgalib.c svgalib: mode selection updates 2007-10-16 09:43:22 -07:00
syscopyarea.c
sysfillrect.c
sysimgblt.c
tcx.c
tdfxfb.c tdfxfb: checkpatch fixes 2007-10-16 09:43:19 -07:00
tgafb.c tgafb: remove a redundant non-mono test in mono imageblit 2007-10-16 09:43:23 -07:00
tridentfb.c
uvesafb.c uvesafb: fix warnings about unused variables on non-x86 2007-11-14 18:45:37 -08:00
valkyriefb.c
valkyriefb.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
vesafb.c
vfb.c vfb: make virtual framebuffer mmapable 2007-10-16 09:43:18 -07:00
vga16fb.c Remove magic macros for screen_info structure members 2007-10-16 22:57:17 -07:00
vgastate.c vga: vgastate fix 2007-05-08 11:15:32 -07:00
vt8623fb.c
w100fb.c
w100fb.h [PATCH] w100fb: Add acceleration support to ATI Imageon 2006-03-31 12:19:00 -08:00
xilinxfb.c