android_kernel_google_msm/drivers/video/console
Dave Airlie 13e902acc5 fbcon: fix race condition between console lock and cursor timer (v1.1)
commit d8636a2717 upstream.

So we've had a fair few reports of fbcon handover breakage between
efi/vesafb and i915 surface recently, so I dedicated a couple of
days to finding the problem.

Essentially the last thing we saw was the conflicting framebuffer
message and that was all.

So after much tracing with direct netconsole writes (printks
under console_lock not so useful), I think I found the race.

Thread A (driver load)    Thread B (timer thread)
  unbind_con_driver ->              |
  bind_con_driver ->                |
  vc->vc_sw->con_deinit ->          |
  fbcon_deinit ->                   |
  console_lock()                    |
      |                             |
      |                       fbcon_flashcursor timer fires
      |                       console_lock() <- blocked for A
      |
      |
fbcon_del_cursor_timer ->
  del_timer_sync
  (BOOM)

Of course because all of this is under the console lock,
we never see anything, also since we also just unbound the active
console guess what we never see anything.

Hopefully this fixes the problem for anyone seeing vesafb->kms
driver handoff.

v1.1: add comment suggestion from Alan.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Acked-by: Alan Cox <alan@lxorguk.ukuu.org.uk>
Tested-by: Josh Boyer <jwboyer@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-02 10:30:22 -07:00
..
bitblit.c
dummycon.c
fbcon.c fbcon: fix race condition between console lock and cursor timer (v1.1) 2012-10-02 10:30:22 -07:00
fbcon.h
fbcon_ccw.c
fbcon_cw.c
fbcon_rotate.c
fbcon_rotate.h
fbcon_ud.c
font_6x11.c
font_7x14.c
font_8x8.c
font_8x16.c
font_10x18.c
font_acorn_8x8.c
font_mini_4x6.c Fix common misspellings 2011-03-31 11:26:23 -03:00
font_pearl_8x8.c
font_sun8x16.c
font_sun12x22.c
fonts.c
Kconfig Kconfig: remove a few puzzling comments 2011-10-31 10:58:48 +01:00
Makefile
mdacon.c
newport_con.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
softcursor.c
sticon.c
sticore.c parisc: move definition of PAGE0 to asm/page.h 2012-05-10 15:12:08 -07:00
tileblit.c fbcon: Bugfix soft cursor detection in Tile Blitting 2011-03-22 16:41:08 +09:00
vgacon.c locking, video: Annotate vga console lock as raw 2011-09-13 11:12:04 +02:00