1. 21 5月, 2013 2 次提交
    • W
      vt: delete unneeded function unbind_con_driver · c1f5e38a
      Wang YanQing 提交于
      Now there is no place use unbind_con_driver,
      and we can achieve unbind_con_driver's function
      with do_unbind_con_driver easily, so just delete
      it to reduce code size and duplication.
      Signed-off-by: NWang YanQing <udknight@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c1f5e38a
    • P
      tty/vt: Fix vc_deallocate() lock order · 421b40a6
      Peter Hurley 提交于
      Now that the tty port owns the flip buffers and i/o is allowed
      from the driver even when no tty is attached, the destruction
      of the tty port (and the flip buffers) must ensure that no
      outstanding work is pending.
      
      Unfortunately, this creates a lock order problem with the
      console_lock (see attached lockdep report [1] below).
      
      For single console deallocation, drop the console_lock prior
      to port destruction. When multiple console deallocation,
      defer port destruction until the consoles have been
      deallocated.
      
      tty_port_destroy() is not required if the port has not
      been used; remove from vc_allocate() failure path.
      
      [1] lockdep report from Dave Jones <davej@redhat.com>
      
       ======================================================
       [ INFO: possible circular locking dependency detected ]
       3.9.0+ #16 Not tainted
       -------------------------------------------------------
       (agetty)/26163 is trying to acquire lock:
       blocked:  ((&buf->work)){+.+...}, instance: ffff88011c8b0020, at: [<ffffffff81062065>] flush_work+0x5/0x2e0
      
       but task is already holding lock:
       blocked:  (console_lock){+.+.+.}, instance: ffffffff81c2fde0, at: [<ffffffff813bc201>] vt_ioctl+0xb61/0x1230
      
       which lock already depends on the new lock.
      
       the existing dependency chain (in reverse order) is:
      
       -> #1 (console_lock){+.+.+.}:
              [<ffffffff810b3f74>] lock_acquire+0xa4/0x210
              [<ffffffff810416c7>] console_lock+0x77/0x80
              [<ffffffff813c3dcd>] con_flush_chars+0x2d/0x50
              [<ffffffff813b32b2>] n_tty_receive_buf+0x122/0x14d0
              [<ffffffff813b7709>] flush_to_ldisc+0x119/0x170
              [<ffffffff81064381>] process_one_work+0x211/0x700
              [<ffffffff8106498b>] worker_thread+0x11b/0x3a0
              [<ffffffff8106ce5d>] kthread+0xed/0x100
              [<ffffffff81601cac>] ret_from_fork+0x7c/0xb0
      
       -> #0 ((&buf->work)){+.+...}:
              [<ffffffff810b349a>] __lock_acquire+0x193a/0x1c00
              [<ffffffff810b3f74>] lock_acquire+0xa4/0x210
              [<ffffffff810620ae>] flush_work+0x4e/0x2e0
              [<ffffffff81065305>] __cancel_work_timer+0x95/0x130
              [<ffffffff810653b0>] cancel_work_sync+0x10/0x20
              [<ffffffff813b8212>] tty_port_destroy+0x12/0x20
              [<ffffffff813c65e8>] vc_deallocate+0xf8/0x110
              [<ffffffff813bc20c>] vt_ioctl+0xb6c/0x1230
              [<ffffffff813b01a5>] tty_ioctl+0x285/0xd50
              [<ffffffff811ba825>] do_vfs_ioctl+0x305/0x530
              [<ffffffff811baad1>] sys_ioctl+0x81/0xa0
              [<ffffffff81601d59>] system_call_fastpath+0x16/0x1b
      
       other info that might help us debug this:
      
       [ 6760.076175]  Possible unsafe locking scenario:
      
              CPU0                    CPU1
              ----                    ----
         lock(console_lock);
                                      lock((&buf->work));
                                      lock(console_lock);
         lock((&buf->work));
      
        *** DEADLOCK ***
      
       1 lock on stack by (agetty)/26163:
        #0: blocked:  (console_lock){+.+.+.}, instance: ffffffff81c2fde0, at: [<ffffffff813bc201>] vt_ioctl+0xb61/0x1230
       stack backtrace:
       Pid: 26163, comm: (agetty) Not tainted 3.9.0+ #16
       Call Trace:
        [<ffffffff815edb14>] print_circular_bug+0x200/0x20e
        [<ffffffff810b349a>] __lock_acquire+0x193a/0x1c00
        [<ffffffff8100a269>] ? sched_clock+0x9/0x10
        [<ffffffff8100a269>] ? sched_clock+0x9/0x10
        [<ffffffff8100a200>] ? native_sched_clock+0x20/0x80
        [<ffffffff810b3f74>] lock_acquire+0xa4/0x210
        [<ffffffff81062065>] ? flush_work+0x5/0x2e0
        [<ffffffff810620ae>] flush_work+0x4e/0x2e0
        [<ffffffff81062065>] ? flush_work+0x5/0x2e0
        [<ffffffff810b15db>] ? mark_held_locks+0xbb/0x140
        [<ffffffff8113c8a3>] ? __free_pages_ok.part.57+0x93/0xc0
        [<ffffffff810b15db>] ? mark_held_locks+0xbb/0x140
        [<ffffffff810652f2>] ? __cancel_work_timer+0x82/0x130
        [<ffffffff81065305>] __cancel_work_timer+0x95/0x130
        [<ffffffff810653b0>] cancel_work_sync+0x10/0x20
        [<ffffffff813b8212>] tty_port_destroy+0x12/0x20
        [<ffffffff813c65e8>] vc_deallocate+0xf8/0x110
        [<ffffffff813bc20c>] vt_ioctl+0xb6c/0x1230
        [<ffffffff810aec41>] ? lock_release_holdtime.part.30+0xa1/0x170
        [<ffffffff813b01a5>] tty_ioctl+0x285/0xd50
        [<ffffffff812b00f6>] ? inode_has_perm.isra.46.constprop.61+0x56/0x80
        [<ffffffff811ba825>] do_vfs_ioctl+0x305/0x530
        [<ffffffff812b04db>] ? selinux_file_ioctl+0x5b/0x110
        [<ffffffff811baad1>] sys_ioctl+0x81/0xa0
        [<ffffffff81601d59>] system_call_fastpath+0x16/0x1b
      
      Cc: Dave Jones <davej@redhat.com>
      Signed-off-by: NPeter Hurley <peter@hurleysoftware.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      421b40a6
  2. 08 2月, 2013 1 次提交
  3. 07 2月, 2013 1 次提交
    • D
      vgacon/vt: clear buffer attributes when we load a 512 character font (v2) · 2a248307
      Dave Airlie 提交于
      When we switch from 256->512 byte font rendering mode, it means the
      current contents of the screen is being reinterpreted. The bit that holds
      the high bit of the 9-bit font, may have been previously set, and thus
      the new font misrenders.
      
      The problem case we see is grub2 writes spaces with the bit set, so it
      ends up with data like 0x820, which gets reinterpreted into 0x120 char
      which the font translates into G with a circumflex. This flashes up on
      screen at boot and is quite ugly.
      
      A current side effect of this patch though is that any rendering on the
      screen changes color to a slightly darker color, but at least the screen
      no longer corrupts.
      
      v2: as suggested by hpa, always clear the attribute space, whether we
      are are going to or from 512 chars.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      2a248307
  4. 25 4月, 2012 1 次提交
  5. 09 3月, 2012 1 次提交
    • A
      vt:tackle kbd_table · 079c9534
      Alan Cox 提交于
      Keyboard struct lifetime is easy, but the locking is not and is completely
      ignored by the existing code. Tackle this one head on
      
      - Make the kbd_table private so we can run down all direct users
      - Hoick the relevant ioctl handlers into the keyboard layer
      - Lock them with the keyboard lock so they don't change mid keypress
      - Add helpers for things like console stop/start so we isolate the poking
        around properly
      - Tweak the braille console so it still builds
      
      There are a couple of FIXME locking cases left for ioctls that are so hideous
      they should be addressed in a later patch. After this patch the kbd_table is
      private and all the keyboard jiggery pokery is in one place.
      
      This update fixes speakup and also a memory leak in the original.
      Signed-off-by: NAlan Cox <alan@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      079c9534
  6. 25 2月, 2012 1 次提交
  7. 27 7月, 2011 1 次提交
    • M
      panic, vt: do not force oops output when panic_timeout < 0 · c958474b
      Mandeep Singh Baines 提交于
      Don't force output if you intend to reboot immediately.
      
      In this patch, I'm disabling the functionality enabled by
      vc->vc_panic_force_write if panic_timeout < 0 (i.e.  no timeout).
      vc_panic_force_write is only enabled for fb video consoles if the
      FBINFO_CAN_FORCE_OUTPUT flag is set.
      
      For our application, we're using ram_oops to preserved the panic in
      memory.  We want to reliably, and as fast as possible, machine_restart.
      The vc_panic_force_write flag results in a bunch of graphics driver code
      to be invoked which slows down restart and decreases reliability.  Since
      we're already storing the panic in RAM and are going to reboot
      immediately, there is no benefit in mode switching back to the vc in
      order to display the panic output.  The log buffer will get flushed by
      the console_unblank() call so remote management consoles should see all
      output.
      Signed-off-by: NMandeep Singh Baines <msb@chromium.org>
      Cc: Huang Ying <ying.huang@intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Hugh Dickins <hughd@google.com>
      Cc: Olaf Hering <olaf@aepfle.de>
      Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
      Cc: Dave Airlie <airlied@gmail.com>
      Cc: Greg Kroah-Hartman <gregkh@suse.de>
      Acked-by: NAlan Cox <alan@lxorguk.ukuu.org.uk>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      c958474b
  8. 18 2月, 2011 1 次提交
    • J
      tty,vcs removing con_buf/conf_buf_mtx · fcdba07e
      Jiri Olsa 提交于
      seems there's no longer need for using con_buf/conf_buf_mtx
      as vcs_read/vcs_write buffer for user's data.
      
      The do_con_write function, that was the other user of this,
      is currently using its own kmalloc-ed buffer.
      
      Not sure when this got changed, as I was able to find this code
      in 2.6.9, but it's already gone as far as current git history
      goes - 2.6.12-rc2.
      
      AFAICS there's a behaviour change with the current change.
      The lseek is not completely mutually exclusive with the
      vcs_read/vcs_write - the file->f_pos might get updated
      via lseek callback during the vcs_read/vcs_write processing.
      
      I tried to find out if the prefered behaviour is to keep
      this in sync within read/write/lseek functions, but I did
      not find any pattern on different places.
      
      I guess if user end up calling write/lseek from different
      threads she should know what she's doing. If needed we
      could use dedicated fd mutex/buffer.
      Signed-off-by: NJiri Olsa <jolsa@redhat.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      fcdba07e
  9. 11 8月, 2010 2 次提交
    • K
      vt: Fix warning: statement with no effect due to vt_kern.h · 75e0b946
      Kevin Winchester 提交于
      Using:
      
      	gcc (GCC) 4.5.0 20100610 (prerelease)
      
      with CONFIG_CONSOLE_TRANSLATIONS=n, the following warnings are seen:
      
      	drivers/char/vt_ioctl.c: In function ‘vt_ioctl’:
      	drivers/char/vt_ioctl.c:1309:4: warning: statement with no effect
      	drivers/char/vt.c: In function ‘vc_allocate’:
      	drivers/char/vt.c:774:3: warning: statement with no effect
      	drivers/video/console/vgacon.c: In function ‘vgacon_init’:
      	drivers/video/console/vgacon.c:587:3: warning: statement with no effect
      	drivers/video/console/vgacon.c: In function ‘vgacon_deinit’:
      	drivers/video/console/vgacon.c:606:2: warning: statement with no effect
      	drivers/video/console/fbcon.c: In function ‘fbcon_init’:
      	drivers/video/console/fbcon.c:1087:3: warning: statement with no effect
      	drivers/video/console/fbcon.c:1089:3: warning: statement with no effect
      	drivers/video/console/fbcon.c: In function ‘fbcon_set_disp’:
      	drivers/video/console/fbcon.c:1369:3: warning: statement with no effect
      	drivers/video/console/fbcon.c:1371:3: warning: statement with no effect
      
      This is because several functions in include/linux/vt_kern.h are
      defined to (0).  Convert them to static inline functions to
      silence the warnings and gain a bit of type safety.
      Signed-off-by: NKevin Winchester <kjwinchester@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      75e0b946
    • J
      vt/console: try harder to print output when panicing · 8fd4bd22
      Jesse Barnes 提交于
      Jesse's initial patch commit said:
      
      "At panic time (i.e.  when oops_in_progress is set) we should try a bit
      harder to update the screen and make sure output gets to the VT, since
      some drivers are capable of flipping back to it.
      
      So make sure we try to unblank and update the display if called from a
      panic context."
      
      I've enhanced this to add a flag to the vc that console layer can set to
      indicate they want this behaviour to occur.  This also adds support to
      fbcon for that flag and adds an fb flag for drivers to indicate they want
      to use the support.  It enables this for KMS drivers.
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Acked-by: NJames Simmons <jsimmons@infradead.org>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      8fd4bd22
  10. 14 11月, 2009 1 次提交
  11. 20 9月, 2009 3 次提交
  12. 14 10月, 2008 1 次提交
  13. 16 8月, 2008 1 次提交
  14. 03 8月, 2008 1 次提交
  15. 02 8月, 2008 1 次提交
  16. 04 6月, 2008 1 次提交
  17. 07 2月, 2008 1 次提交
  18. 17 10月, 2007 1 次提交
  19. 18 7月, 2007 2 次提交
  20. 09 5月, 2007 1 次提交
  21. 17 3月, 2007 1 次提交
  22. 02 10月, 2006 1 次提交
  23. 30 9月, 2006 1 次提交
    • A
      [PATCH] tty locking on resize · ca9bda00
      Alan Cox 提交于
      The current kernel serializes console resizes but does not serialize the
      resize against the tty structure updates.  This means that while two
      parallel resizes cannot mess up the console you can get incorrect results
      reported.
      
      Secondly while doing this I added vc_lock_resize() to lock and resize the
      console.  This leaves all knowledge of the console_sem in the vt/console
      driver and kicks it out of the tty layer, which is good
      
      Thirdly while doing this I decided I couldn't stand "disallocate" any
      longer so I switched it to "deallocate".
      Signed-off-by: NAlan Cox <alan@redhat.com>
      Cc: Paul Fulghum <paulkf@microgate.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      ca9bda00
  24. 11 7月, 2006 1 次提交
  25. 01 6月, 2006 1 次提交
  26. 26 4月, 2006 1 次提交
  27. 23 3月, 2006 1 次提交
  28. 17 4月, 2005 1 次提交
    • L
      Linux-2.6.12-rc2 · 1da177e4
      Linus Torvalds 提交于
      Initial git repository build. I'm not bothering with the full history,
      even though we have it. We can create a separate "historical" git
      archive of that later if we want to, and in the meantime it's about
      3.2GB when imported into git - space that would just make the early
      git days unnecessarily complicated, when we don't have a lot of good
      infrastructure for it.
      
      Let it rip!
      1da177e4