1. 08 2月, 2017 1 次提交
  2. 12 1月, 2017 1 次提交
    • T
      fbcon: Fix vc attr at deinit · 8aac7f34
      Takashi Iwai 提交于
      fbcon can deal with vc_hi_font_mask (the upper 256 chars) and adjust
      the vc attrs dynamically when vc_hi_font_mask is changed at
      fbcon_init().  When the vc_hi_font_mask is set, it remaps the attrs in
      the existing console buffer with one bit shift up (for 9 bits), while
      it remaps with one bit shift down (for 8 bits) when the value is
      cleared.  It works fine as long as the font gets updated after fbcon
      was initialized.
      
      However, we hit a bizarre problem when the console is switched to
      another fb driver (typically from vesafb or efifb to drmfb).  At
      switching to the new fb driver, we temporarily rebind the console to
      the dummy console, then rebind to the new driver.  During the
      switching, we leave the modified attrs as is.  Thus, the new fbcon
      takes over the old buffer as if it were to contain 8 bits chars
      (although the attrs are still shifted for 9 bits), and effectively
      this results in the yellow color texts instead of the original white
      color, as found in the bugzilla entry below.
      
      An easy fix for this is to re-adjust the attrs before leaving the
      fbcon at con_deinit callback.  Since the code to adjust the attrs is
      already present in the current fbcon code, in this patch, we simply
      factor out the relevant code, and call it from fbcon_deinit().
      
      Bugzilla: https://bugzilla.suse.com/show_bug.cgi?id=1000619Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      Signed-off-by: NBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
      8aac7f34
  3. 27 10月, 2016 1 次提交
    • J
      tty: vt, cleanup and document con_scroll · d705ff38
      Jiri Slaby 提交于
      Scrolling helpers scrup and scrdown both accept 'top' and 'bottom' as
      unsigned int. Number of lines 'nr' is accepted as int, but all callers
      pass down unsigned too. So change the type of 'nr' to unsigned too.
      Now, promote unsigned int from the helpers up to the con_scroll
      hook which actually accepted all those as signed int.
      
      Next, the 'dir' parameter can have only two values and we define
      constants for that: SM_UP and SM_DOWN. Switch them to enum and do
      proper type checking on 'dir' too.
      
      Finally, document the behaviour of the hook.
      Signed-off-by: NJiri Slaby <jslaby@suse.cz>
      Cc: Thomas Winischhofer <thomas@winischhofer.net>
      Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
      Cc: "James E.J. Bottomley" <jejb@parisc-linux.org>
      Cc: Helge Deller <deller@gmx.de>
      Cc: <linux-fbdev@vger.kernel.org>
      Cc: <linux-usb@vger.kernel.org>
      Cc: <linux-parisc@vger.kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d705ff38
  4. 26 6月, 2016 4 次提交
    • J
      tty: vt, convert more macros to functions · 6ca8dfd7
      Jiri Slaby 提交于
      Namely convert:
      * IS_FG -> con_is_fg
      * DO_UPDATE -> con_should_update
      * CON_IS_VISIBLE -> con_is_visible
      
      DO_UPDATE was a weird name for a yes/no answer, so the new name is
      con_should_update.
      Signed-off-by: NJiri Slaby <jslaby@suse.cz>
      Cc: Thomas Winischhofer <thomas@winischhofer.net>
      Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
      Cc: linux-usb@vger.kernel.org
      Cc: linux-fbdev@vger.kernel.org
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      6ca8dfd7
    • J
      tty: vt, remove consw->con_bmove · 52ad1f38
      Jiri Slaby 提交于
      It is never called since commit 81732c3b (tty vt: Fix line
      garbage in virtual console on command line edition) in 3.7. So remove
      all the callbacks.
      Signed-off-by: NJiri Slaby <jslaby@suse.cz>
      Cc: Thomas Winischhofer <thomas@winischhofer.net>
      Cc: linux-usb@vger.kernel.org
      Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
      Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
      Cc: "James E.J. Bottomley" <jejb@parisc-linux.org>
      Cc: Helge Deller <deller@gmx.de>
      Cc: linux-fbdev@vger.kernel.org
      Cc: linux-parisc@vger.kernel.org
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      52ad1f38
    • J
      tty: vt, consw->con_set_palette cleanup · 709280da
      Jiri Slaby 提交于
      * allow NULL consw->con_set_palette (some consoles define an empty
        hook)
      * => remove empty hooks now
      * return value of consw->con_set_palette is never checked => make the
        function void
      * document consw->con_set_palette a bit
      Signed-off-by: NJiri Slaby <jslaby@suse.cz>
      Cc: Thomas Winischhofer <thomas@winischhofer.net>
      Cc: linux-usb@vger.kernel.org
      Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
      Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
      Cc: "James E.J. Bottomley" <jejb@parisc-linux.org>
      Cc: Helge Deller <deller@gmx.de>
      Cc: linux-fbdev@vger.kernel.org
      Cc: linux-parisc@vger.kernel.org
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      709280da
    • J
      tty: vt, consw->con_scrolldelta cleanup · 97293de9
      Jiri Slaby 提交于
      * allow NULL consw->con_scrolldelta (some consoles define an empty
        hook)
      * => remove empty hooks now
      * return value of consw->con_scrolldelta is never checked => make the
        function void
      * document consw->con_scrolldelta a bit
      Signed-off-by: NJiri Slaby <jslaby@suse.cz>
      Cc: Thomas Winischhofer <thomas@winischhofer.net>
      Cc: linux-usb@vger.kernel.org
      Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
      Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
      Cc: "James E.J. Bottomley" <jejb@parisc-linux.org>
      Cc: Helge Deller <deller@gmx.de>
      Cc: linux-fbdev@vger.kernel.org
      Cc: linux-parisc@vger.kernel.org
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      97293de9
  5. 01 5月, 2016 1 次提交
  6. 26 2月, 2016 1 次提交
    • J
      fbcon: set a default value to blink interval · a1e533ec
      Jean-Philippe Brucker 提交于
      Since commit 27a4c827
      	fbcon: use the cursor blink interval provided by vt
      
      two attempts have been made at fixing a possible hang caused by
      cursor_timer_handler. That function registers a timer to be triggered at
      "jiffies + fbcon_ops.cur_blink_jiffies".
      
      A new case had been encountered during initialisation of clcd-pl11x:
      
          fbcon_fb_registered
          do_fbcon_takeover
      
          ->  do_register_con_driver
              fbcon_startup
          (A) add_cursor_timer (with cur_blink_jiffies = 0)
      
          ->  do_bind_con_driver
              visual_init
              fbcon_init
          (B) cur_blink_jiffies = msecs_to_jiffies(vc->vc_cur_blink_ms);
      
      If we take an softirq anywhere between A and B (and we do),
      cursor_timer_handler executes indefinitely.
      
      Instead of patching all possible paths that lead to this case one at a
      time, fix the issue at the source and initialise cur_blink_jiffies to
      200ms when allocating fbcon_ops. This was its default value before
      aforesaid commit. fbcon_cursor or fbcon_init will refine this value
      downstream.
      Signed-off-by: NJean-Philippe Brucker <jean-philippe.brucker@arm.com>
      Cc: <stable@vger.kernel.org> # v4.2
      Tested-by: NScot Doyle <lkml14@scotdoyle.com>
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      a1e533ec
  7. 18 10月, 2015 1 次提交
  8. 10 8月, 2015 1 次提交
  9. 27 5月, 2015 1 次提交
    • T
      fbcon: Avoid deleting a timer in IRQ context · a5edce42
      Thierry Reding 提交于
      Commit 27a4c827 ("fbcon: use the cursor blink interval provided by
      vt") unconditionally removes the cursor blink timer. Unfortunately that
      wreaks havoc under some circumstances. An easily reproducible way is to
      use both the framebuffer console and a debug serial port as the console
      output for kernel messages (e.g. "console=ttyS0 console=tty1" on the
      kernel command-line. Upon boot this triggers a warning from within the
      del_timer_sync() function because it is called from IRQ context:
      
      	[    5.070096] ------------[ cut here ]------------
      	[    5.070110] WARNING: CPU: 0 PID: 0 at ../kernel/time/timer.c:1098 del_timer_sync+0x4c/0x54()
      	[    5.070115] Modules linked in:
      	[    5.070120] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.1.0-rc4-next-20150519 #1
      	[    5.070123] Hardware name: SAMSUNG EXYNOS (Flattened Device Tree)
      	[    5.070142] [] (unwind_backtrace) from [] (show_stack+0x10/0x14)
      	[    5.070156] [] (show_stack) from [] (dump_stack+0x70/0xbc)
      	[    5.070164] [] (dump_stack) from [] (warn_slowpath_common+0x74/0xb0)
      	[    5.070169] [] (warn_slowpath_common) from [] (warn_slowpath_null+0x1c/0x24)
      	[    5.070174] [] (warn_slowpath_null) from [] (del_timer_sync+0x4c/0x54)
      	[    5.070183] [] (del_timer_sync) from [] (fbcon_del_cursor_timer+0x2c/0x40)
      	[    5.070190] [] (fbcon_del_cursor_timer) from [] (fbcon_cursor+0x9c/0x180)
      	[    5.070198] [] (fbcon_cursor) from [] (hide_cursor+0x30/0x98)
      	[    5.070204] [] (hide_cursor) from [] (vt_console_print+0x2a8/0x340)
      	[    5.070212] [] (vt_console_print) from [] (call_console_drivers.constprop.23+0xc8/0xec)
      	[    5.070218] [] (call_console_drivers.constprop.23) from [] (console_unlock+0x498/0x4f0)
      	[    5.070223] [] (console_unlock) from [] (vprintk_emit+0x1f0/0x508)
      	[    5.070228] [] (vprintk_emit) from [] (vprintk_default+0x24/0x2c)
      	[    5.070234] [] (vprintk_default) from [] (printk+0x70/0x88)
      
      After which the system starts spewing all kinds of weird and seemingly
      unrelated error messages.
      
      This commit fixes this by restoring the condition under which the call
      to fbcon_del_cursor_timer() happens.
      Reported-by: NDaniel Stone <daniel@fooishbar.org>
      Reported-by: NKevin Hilman <khilman@kernel.org>
      Tested-by: NKevin Hilman <khilman@linaro.org>
      Tested-by: NScot Doyle <lkml14@scotdoyle.com>
      Signed-off-by: NThierry Reding <treding@nvidia.com>
      Tested-by: NAndrew Vagin <avagin@virtuozzo.com>
      Tested-by: NTomeu Vizoso <tomeu.vizoso@collabora.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a5edce42
  10. 11 5月, 2015 1 次提交
  11. 26 1月, 2015 1 次提交
  12. 14 11月, 2014 1 次提交
  13. 22 10月, 2014 1 次提交
  14. 09 5月, 2014 1 次提交
    • M
      fbcon: Fix memory leak in con2fb_release_oldinfo() · 7a966fbd
      Masami Ichikawa 提交于
      kmemleak reported a memory leak as below.
      
      unreferenced object 0xffff8800dab6d8d8 (size 96):
        comm "swapper/0", pid 1, jiffies 4294877598 (age 38.483s)
        hex dump (first 32 bytes):
          00 00 00 00 00 01 00 00 08 00 00 00 10 00 00 00  ................
          07 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00  ................
        backtrace:
          [<ffffffff814e8f2e>] kmemleak_alloc+0x4e/0xb0
          [<ffffffff811a0600>] __kmalloc+0x280/0x320
          [<ffffffff81309b61>] soft_cursor+0x231/0x290
          [<ffffffff81309393>] bit_cursor+0x613/0x650
          [<ffffffff8130556b>] fbcon_cursor+0x13b/0x1c0
          [<ffffffff813755f8>] hide_cursor+0x28/0xa0
          [<ffffffff81376e98>] redraw_screen+0x168/0x240
          [<ffffffff81303891>] fbcon_prepare_logo+0x381/0x420
          [<ffffffff81303c7e>] fbcon_init+0x34e/0x590
          [<ffffffff81375828>] visual_init+0xb8/0x120
          [<ffffffff81377c93>] do_bind_con_driver+0x163/0x380
          [<ffffffff81378494>] do_take_over_console+0x114/0x1c0
          [<ffffffff81303f23>] do_fbcon_takeover+0x63/0xd0
          [<ffffffff813086dd>] fbcon_event_notify+0x68d/0x7e0
          [<ffffffff814ff7ac>] notifier_call_chain+0x4c/0x70
          [<ffffffff8108c85d>] __blocking_notifier_call_chain+0x4d/0x70
      
      This memory leak cause is, fbcon_ops's cursor_src is allocated in
      soft_cursor() but not released in con2fb_release_oldinfo().
      so, cursor_src is needed to be released when oldinfo is going to be
      released.
      Signed-off-by: NMasami Ichikawa <masami256@gmail.com>
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      7a966fbd
  15. 11 2月, 2014 1 次提交
    • K
      fbcon: Clean up fbcon data in fb_info on FB_EVENT_FB_UNBIND with 0 fbs · 5f4dc28b
      Keith Packard 提交于
      When FB_EVENT_FB_UNBIND is sent, fbcon has two paths, one path taken
      when there is another frame buffer to switch any affected vcs to and
      another path when there isn't.
      
      In the case where there is another frame buffer to use,
      fbcon_fb_unbind calls set_con2fb_map to remap all of the affected vcs
      to the replacement frame buffer. set_con2fb_map will eventually call
      con2fb_release_oldinfo when the last vcs gets unmapped from the old
      frame buffer.
      
      con2fb_release_oldinfo frees the fbcon data that is hooked off of the
      fb_info structure, including the cursor timer.
      
      In the case where there isn't another frame buffer to use,
      fbcon_fb_unbind simply calls fbcon_unbind, which doesn't clear the
      con2fb_map or free the fbcon data hooked from the fb_info
      structure. In particular, it doesn't stop the cursor blink timer. When
      the fb_info structure is then freed, we end up with a timer queue
      pointing into freed memory and "bad things" start happening.
      
      This patch first changes con2fb_release_oldinfo so that it can take a
      NULL pointer for the new frame buffer, but still does all of the
      deallocation and cursor timer cleanup.
      
      Finally, the patch tries to replicate some of what set_con2fb_map does
      by clearing the con2fb_map for the affected vcs and calling the
      modified con2fb_release_info function to clean up the fb_info structure.
      Signed-off-by: NKeith Packard <keithp@keithp.com>
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      5f4dc28b
  16. 17 1月, 2014 2 次提交
    • M
      fbcon: Fix memory leak in fbcon_exit(). · 46862145
      Masami Ichikawa 提交于
      kmemleak reported a memory leak as below.
      
      unreferenced object 0xffff880036ca84c0 (size 16):
        comm "swapper/0", pid 1, jiffies 4294877407 (age 4434.633s)
        hex dump (first 16 bytes):
          00 00 00 00 00 00 00 00 00 00 00 00 00 00 ff ff  ................
        backtrace:
          [<ffffffff814ed01e>] kmemleak_alloc+0x4e/0xb0
          [<ffffffff8118913c>] __kmalloc+0x1fc/0x290
          [<ffffffff81302c9e>] bit_cursor+0x24e/0x6c0
          [<ffffffff812ff2f4>] fbcon_cursor+0x154/0x1d0
          [<ffffffff813675d8>] hide_cursor+0x28/0xa0
          [<ffffffff81368acf>] update_region+0x6f/0x90
          [<ffffffff81300268>] fbcon_switch+0x518/0x550
          [<ffffffff813695b9>] redraw_screen+0x189/0x240
          [<ffffffff8136a0e0>] do_bind_con_driver+0x360/0x380
          [<ffffffff8136a6e4>] do_take_over_console+0x114/0x1c0
          [<ffffffff812fdc83>] do_fbcon_takeover+0x63/0xd0
          [<ffffffff813023e5>] fbcon_event_notify+0x605/0x720
          [<ffffffff81501dcc>] notifier_call_chain+0x4c/0x70
          [<ffffffff81087f8d>] __blocking_notifier_call_chain+0x4d/0x70
          [<ffffffff81087fc6>] blocking_notifier_call_chain+0x16/0x20
          [<ffffffff812f201b>] fb_notifier_call_chain+0x1b/0x20
      
      In this case ops->cursor_state.mask is allocated in bit_cursor() but
      not freed in fbcon_exit(). So, fbcon_exit() needs to free buffer in its
      process.
      In the case, fbcon_exit() was called from fbcon_deinit() when driver
      called remove_conflicting_framebuffers().
      Signed-off-by: NMasami Ichikawa <masami256@gmail.com>
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      46862145
    • W
      fbcon: trivial optimization for fbcon_exit · 5aa133d6
      Wang YanQing 提交于
      Break out as soon as we find a mapped entry con2fb_map.
      Signed-off-by: NWang YanQing <udknight@gmail.com>
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      5aa133d6
  17. 21 5月, 2013 4 次提交
  18. 15 5月, 2013 1 次提交
    • V
      fbcon: queue work on power efficient wq · a85f1a41
      Viresh Kumar 提交于
      fbcon uses workqueues and it has no real dependency of scheduling these on the
      cpu which scheduled them.
      
      On a idle system, it is observed that and idle cpu wakes up many times just to
      service this work. It would be better if we can schedule it on a cpu which the
      scheduler believes to be the most appropriate one.
      
      This patch replaces system_wq with system_power_efficient_wq.
      
      Cc: Dave Airlie <airlied@redhat.com>
      Cc: linux-fbdev@vger.kernel.org
      Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: NTejun Heo <tj@kernel.org>
      a85f1a41
  19. 24 4月, 2013 1 次提交
  20. 22 2月, 2013 1 次提交
  21. 08 2月, 2013 3 次提交
  22. 07 2月, 2013 1 次提交
    • D
      fbcon: don't lose the console font across generic->chip driver switch · ae128786
      Dave Airlie 提交于
      If grub2 loads efifb/vesafb, then when systemd starts it can set the console
      font on that framebuffer device, however when we then load the native KMS
      driver, the first thing it does is tear down the generic framebuffer driver.
      
      The thing is the generic code is doing the right thing, it frees the font
      because otherwise it would leak memory. However we can assume that if you
      are removing the generic firmware driver (vesa/efi/offb), that a new driver
      *should* be loading soon after, so we effectively leak the font.
      
      However the old code left a dangling pointer in vc->vc_font.data and we
      can now reuse that dangling pointer to load the font into the new
      driver, now that we aren't freeing it.
      
      Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=892340
      
      Cc: Kay Sievers <kay.sievers@vrfy.org>
      Cc: stable@vger.kernel.org
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      ae128786
  23. 23 8月, 2012 1 次提交
  24. 22 8月, 2012 2 次提交
    • D
      fbcon: fix race condition between console lock and cursor timer (v1.1) · d8636a27
      Dave Airlie 提交于
      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.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      d8636a27
    • D
      fbcon: fix race condition between console lock and cursor timer · ec5da7f8
      Dave Airlie 提交于
      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.
      Signed-off-by: NDavid Airlie <airlied@redhat.com>
      Acked-by: NAlan Cox <alan@lxorguk.ukuu.org.uk>
      Cc: stable@vger.kernel.org
      Tested-by: NJosh Boyer <jwboyer@gmail.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      ec5da7f8
  25. 29 3月, 2012 1 次提交
  26. 31 3月, 2011 1 次提交
  27. 22 3月, 2011 1 次提交
    • D
      fbcon: fix situation where fbcon gets deinitialised and can't reinit. · 32b98bf8
      Dave Airlie 提交于
      Situation as follow:
      2 GPUs + vesafb + kms.
      
      GPU 1 is primary, vesafb binds to it as fb0
      radeon loads
      GPU 0 loads as fb1
      GPU 1 loads, vesafb gets kicked off which causes fb0 to unbind
      console, which causes the dummy console to rebind.
      
      this means fbcon_deinit gets called, which calls fbcon_exit
      since the console isn't bound anymore and we set fbcon_has_exited.
      
      GPU 1 creates a new fb0 which is primary and we want to be console.
      fbcon_fb_registered gets called sets the primary up and calls set_con2fb_map,
      however as fbcon_has_exited is set nothing further ever happens.
      
      This patch bypasses the fbcon_has_exited and checks if the console is unbound,
      if its unbound it calls the fbcon_takeover which calls the vt layer to
      call the fbcon_startup method and everthing works.
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
      32b98bf8
  28. 26 1月, 2011 1 次提交
    • T
      console: rename acquire/release_console_sem() to console_lock/unlock() · ac751efa
      Torben Hohn 提交于
      The -rt patches change the console_semaphore to console_mutex.  As a
      result, a quite large chunk of the patches changes all
      acquire/release_console_sem() to acquire/release_console_mutex()
      
      This commit makes things use more neutral function names which dont make
      implications about the underlying lock.
      
      The only real change is the return value of console_trylock which is
      inverted from try_acquire_console_sem()
      
      This patch also paves the way to switching console_sem from a semaphore to
      a mutex.
      
      [akpm@linux-foundation.org: coding-style fixes]
      [akpm@linux-foundation.org: make console_trylock return 1 on success, per Geert]
      Signed-off-by: NTorben Hohn <torbenh@gmx.de>
      Cc: Thomas Gleixner <tglx@tglx.de>
      Cc: Greg KH <gregkh@suse.de>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      ac751efa
  29. 23 9月, 2010 1 次提交
    • J
      fbcon: fix lockdep warning from fbcon_deinit() · 142092e5
      Jarek Poplawski 提交于
      Fix the lockdep warning:
      
      [   13.657164] INFO: trying to register non-static key.
      [   13.657169] the code is fine but needs lockdep annotation.
      [   13.657171] turning off the locking correctness validator.
      [   13.657177] Pid: 622, comm: modprobe Not tainted 2.6.36-rc3c #8
      [   13.657180] Call Trace:
      [   13.657194]  [<c13002c8>] ? printk+0x18/0x20
      [   13.657202]  [<c1056cf6>] register_lock_class+0x336/0x350
      [   13.657208]  [<c1058bf9>] __lock_acquire+0x449/0x1180
      [   13.657215]  [<c1059997>] lock_acquire+0x67/0x80
      [   13.657222]  [<c1042bf1>] ? __cancel_work_timer+0x51/0x230
      [   13.657227]  [<c1042c23>] __cancel_work_timer+0x83/0x230
      [   13.657231]  [<c1042bf1>] ? __cancel_work_timer+0x51/0x230
      [   13.657236]  [<c10582b2>] ? mark_held_locks+0x62/0x80
      [   13.657243]  [<c10b3a2f>] ? kfree+0x7f/0xe0
      [   13.657248]  [<c105853c>] ? trace_hardirqs_on_caller+0x11c/0x160
      [   13.657253]  [<c105858b>] ? trace_hardirqs_on+0xb/0x10
      [   13.657259]  [<c117f4cd>] ? fbcon_deinit+0x16d/0x1e0
      [   13.657263]  [<c117f4cd>] ? fbcon_deinit+0x16d/0x1e0
      [   13.657268]  [<c1042dea>] cancel_work_sync+0xa/0x10
      [   13.657272]  [<c117f444>] fbcon_deinit+0xe4/0x1e0
      ...
      
      The warning is caused by trying to cancel an uninitialized work from
      fbcon_exit().  Fix it by adding a check for queue.func, similarly to other
      places in this code.
      Signed-off-by: NJarek Poplawski <jarkao2@gmail.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      142092e5
  30. 11 8月, 2010 1 次提交