1. 23 10月, 2012 1 次提交
  2. 12 10月, 2012 1 次提交
    • J
      kdb,vt_console: Fix missed data due to pager overruns · 17b572e8
      Jason Wessel 提交于
      It is possible to miss data when using the kdb pager.  The kdb pager
      does not pay attention to the maximum column constraint of the screen
      or serial terminal.  This result is not incrementing the shown lines
      correctly and the pager will print more lines that fit on the screen.
      Obviously that is less than useful when using a VGA console where you
      cannot scroll back.
      
      The pager will now look at the kdb_buffer string to see how many
      characters are printed.  It might not be perfect considering you can
      output ASCII that might move the cursor position, but it is a
      substantially better approximation for viewing dmesg and trace logs.
      
      This also means that the vt screen needs to set the kdb COLUMNS
      variable.
      
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NJason Wessel <jason.wessel@windriver.com>
      17b572e8
  3. 11 9月, 2012 1 次提交
    • J
      tty vt: Fix line garbage in virtual console on command line edition · 81732c3b
      Jean-François Moine 提交于
      On some machines using a specific hardware for console screen output,
      the update of the pixel frame buffer does not work correctly when
      using command line edition. This may be due to a memory cache bug
      in the machine on which the problem has been found, but an other
      solution is possible.
      
      This patch proposes to avoid touching directly the pixel frame buffer
      and to rebuild each character using the standard putc() function
      on command line edition.
      
      The resulting code is smaller and not obviously slower (no read
      access to the pixel frame buffer).
      
      Tested on a Cubox (ARM Marvell Dove 88AP510 SoC).
      Signed-off-by: NJean-François Moine <moinejf@free.fr>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      81732c3b
  4. 27 7月, 2012 1 次提交
    • R
      vt: fix race in vt_waitactive() · a7b12929
      Rabin Vincent 提交于
      pm_restore_console() is called from the suspend/resume path, and this
      calls vt_move_to_console(), which calls vt_waitactive().
      
      There's a race in this path which causes the process which requests the
      suspend to sleep indefinitely waiting for an event which already
      happened:
      
      P1                                      P2
       vt_move_to_console()
        set_console()
          schedule_console_callback()
        vt_waitactive()
          check n == fg_console +1
                                             console_callback()
                                               switch_screen()
                                               vt_event_post() // no waiters
      
          vt_event_wait() // forever
      
      Fix the race by ensuring we're registered for the event before we check
      if it's already completed.
      Signed-off-by: NRabin Vincent <rabin.vincent@stericsson.com>
      Acked-by: NAlan Cox <alan@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a7b12929
  5. 18 7月, 2012 2 次提交
  6. 17 7月, 2012 1 次提交
  7. 07 7月, 2012 1 次提交
  8. 15 6月, 2012 1 次提交
    • R
      vt: fix race in vt_waitactive() · 2fc46915
      Rabin Vincent 提交于
      pm_restore_console() is called from the suspend/resume path, and this
      calls vt_move_to_console(), which calls vt_waitactive().
      
      There's a race in this path which causes the process which requests the
      suspend to sleep indefinitely waiting for an event which already
      happened:
      
      P1                                      P2
       vt_move_to_console()
        set_console()
          schedule_console_callback()
        vt_waitactive()
          check n == fg_console +1
                                             console_callback()
                                               switch_screen()
                                               vt_event_post() // no waiters
      
          vt_event_wait() // forever
      
      Fix the race by ensuring we're registered for the event before we check
      if it's already completed.
      Signed-off-by: NRabin Vincent <rabin.vincent@stericsson.com>
      Acked-by: NAlan Cox <alan@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2fc46915
  9. 14 6月, 2012 2 次提交
  10. 15 5月, 2012 2 次提交
  11. 09 5月, 2012 1 次提交
  12. 02 5月, 2012 1 次提交
    • A
      vt: Fix deadlock on scroll-lock · 84f904ec
      Alan Cox 提交于
      Fixing the locking accidentally replaced a race in the scroll
      lock handling with a deadlock. Turn it back into a race for
      now.
      
      The basic problem is that there are two paths into the tty
      stop/start helpers. One via the tty layer ^S/^Q handling
      where we need to take the kbd_event_lock and one via the
      special keyboard handler for fn_hold where we already hold
      it. Probably we need to split out into a separate LED lock
      but for now just go back to the race as it's a bit close
      to release.
      Reported-by: NClemens Ladisch <clemens@ladisch.de>
      Cc: Jiri Kosina <jkosina@suse.cz>
      Signed-off-by: NAlan Cox <alan@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      84f904ec
  13. 25 4月, 2012 1 次提交
  14. 10 4月, 2012 2 次提交
    • M
      tty/vt: handle bad user buffer in {G,P}IO_CMAP ioctl · 871bdea6
      Michael Gehring 提交于
      set_get_cmap() ignored the result of {get,put}_user(), causing ioctl(vt,
      {G,P}IO_CMAP, 0xdeadbeef) to silently fail.
      
      Another side effect of this: calling the PIO_CMAP ioctl with an invalid
      buffer would zero the default colormap and the palette for all vts (all
      colors set to black).
      
      Leave the default colormap intact and return -EFAULT when
      reading/writing to the userspace buffer fails.
      Signed-off-by: NMichael Gehring <mg@ebfe.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      871bdea6
    • K
      printk(): add KERN_CONT where needed in hpet and vt code · 5da527aa
      Kay Sievers 提交于
      A prototype for kmsg records instead of a byte-stream buffer revealed
      a couple of missing printk(KERN_CONT ...) uses. Subsequent calls produce
      one record per printk() call, while all should have ended up in a single
      record.
      
      Instead of:
        ACPI: (supports S0 S5)
        ACPI: PCI Interrupt Link [LNKA] (IRQs 5 *10 11)
        hpet0: at MMIO 0xfed00000, IRQs 2 , 8 , 0
      
      It prints:
        ACPI: (supports S0
         S5
        )
        ACPI: PCI Interrupt Link [LNKA] (IRQs
         5
         *10
         11
        )
        hpet0: at MMIO 0xfed00000, IRQs
         2
        , 8
        , 0
      
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Len Brown <lenb@kernel.org>
      Signed-off-by: NKay Sievers <kay@vrfy.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      5da527aa
  15. 29 3月, 2012 1 次提交
  16. 16 3月, 2012 1 次提交
  17. 13 3月, 2012 1 次提交
  18. 09 3月, 2012 7 次提交
  19. 28 2月, 2012 1 次提交
  20. 25 2月, 2012 2 次提交
  21. 04 2月, 2012 1 次提交
  22. 03 2月, 2012 1 次提交
  23. 05 1月, 2012 1 次提交
    • Z
      tty: Fix memory leak in virtual console when enable unicode translation · 106b5fa7
      Zeng Zhaoming 提交于
      Virtual console unicode translation map leaks with following
      message when enable kmemleak:
      
      unreferenced object 0xeb5ec450 (size 192):
        comm "setfont", pid 665, jiffies 4294899028 (age 3696.220s)
        hex dump (first 32 bytes):
          e0 5b 9d eb 00 00 00 00 00 00 00 00 80 b9 ea eb  .[..............
          b0 5a 9d eb 00 00 00 00 00 00 00 00 00 00 00 00  .Z..............
        backtrace:
          [<c1533f8c>] kmemleak_alloc+0x3c/0xa0
          [<c114acc2>] kmem_cache_alloc_trace+0xe2/0x250
          [<c13498e8>] con_clear_unimap+0x78/0xd0
          [<c1345552>] vt_ioctl+0x1562/0x1d00
          [<c133aa00>] tty_ioctl+0x230/0x7c0
          [<c1171519>] do_vfs_ioctl+0x79/0x2d0
          [<c11717df>] sys_ioctl+0x6f/0x80
          [<c156601f>] sysenter_do_call+0x12/0x38
          [<ffffffff>] 0xffffffff
      unreferenced object 0xeb9d5be0 (size 128):
        comm "setfont", pid 660, jiffies 4294899030 (age 3696.212s)
        hex dump (first 32 bytes):
          60 c2 a6 eb 50 c8 a6 eb c0 54 9d eb 80 59 9d eb  `...P....T...Y..
          90 53 9d eb 60 52 9d eb 60 92 9b eb 00 00 00 00  .S..`R..`.......
        backtrace:
          [<c1533f8c>] kmemleak_alloc+0x3c/0xa0
          [<c114acc2>] kmem_cache_alloc_trace+0xe2/0x250
          [<c134938c>] con_insert_unipair+0x7c/0x150
          [<c1349f8c>] con_set_unimap+0x15c/0x1f0
          [<c13456fb>] vt_ioctl+0x170b/0x1d00
          [<c133aa00>] tty_ioctl+0x230/0x7c0
          [<c1171519>] do_vfs_ioctl+0x79/0x2d0
          [<c11717df>] sys_ioctl+0x6f/0x80
          [<c156601f>] sysenter_do_call+0x12/0x38
          [<ffffffff>] 0xffffffff
      
      The leak caused by con_set_default_unimap() not correct free the old map.
      Signed-off-by: NZeng Zhaoming <zengzm.kernel@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      106b5fa7
  24. 01 11月, 2011 1 次提交
  25. 23 9月, 2011 1 次提交
    • G
      keyboard: Do not include <linux/irq.> · 98c2b373
      Geert Uytterhoeven 提交于
      The top of <linux/irq.h> has this comment:
      
       * Please do not include this file in generic code.  There is currently
       * no requirement for any architecture to implement anything held
       * within this file.
       *
       * Thanks. --rmk
      
      Remove inclusion of <linux/irq.>, to prevent the following compile error
      from happening soon:
      
      | include/linux/irq.h:132: error: redefinition of ‘struct irq_data’
      | include/linux/irq.h:286: error: redefinition of ‘struct irq_chip’
      
      drivers/tty/vt/keyboard.c needs to include <asm/irq_regs.h> for get_irq_regs():
      
      | drivers/tty/vt/keyboard.c:497: error: implicit declaration of function ‘get_irq_regs’
      | drivers/tty/vt/keyboard.c:497: warning: initialization makes pointer from integer without a cast
      Signed-off-by: NGeert Uytterhoeven <geert@linux-m68k.org>
      Acked-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: Greg Kroah-Hartman <gregkh@suse.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      98c2b373
  26. 24 8月, 2011 2 次提交
  27. 04 6月, 2011 1 次提交
    • L
      Revert "tty: make receive_buf() return the amout of bytes received" · 55db4c64
      Linus Torvalds 提交于
      This reverts commit b1c43f82.
      
      It was broken in so many ways, and results in random odd pty issues.
      
      It re-introduced the buggy schedule_work() in flush_to_ldisc() that can
      cause endless work-loops (see commit a5660b41: "tty: fix endless
      work loop when the buffer fills up").
      
      It also used an "unsigned int" return value fo the ->receive_buf()
      function, but then made multiple functions return a negative error code,
      and didn't actually check for the error in the caller.
      
      And it didn't actually work at all.  BenH bisected down odd tty behavior
      to it:
        "It looks like the patch is causing some major malfunctions of the X
         server for me, possibly related to PTYs.  For example, cat'ing a
         large file in a gnome terminal hangs the kernel for -minutes- in a
         loop of what looks like flush_to_ldisc/workqueue code, (some ftrace
         data in the quoted bits further down).
      
         ...
      
         Some more data: It -looks- like what happens is that the
         flush_to_ldisc work queue entry constantly re-queues itself (because
         the PTY is full ?) and the workqueue thread will basically loop
         forver calling it without ever scheduling, thus starving the consumer
         process that could have emptied the PTY."
      
      which is pretty much exactly the problem we fixed in a5660b41.
      
      Milton Miller pointed out the 'unsigned int' issue.
      Reported-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Reported-by: NMilton Miller <miltonm@bga.com>
      Cc: Stefan Bigler <stefan.bigler@keymile.com>
      Cc: Toby Gray <toby.gray@realvnc.com>
      Cc: Felipe Balbi <balbi@ti.com>
      Cc: Greg Kroah-Hartman <gregkh@suse.de>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      55db4c64
  28. 23 4月, 2011 1 次提交