30 Apr, 2008

3 commits

  • Fix update_console_cmdline() not to to read beyond the terminating zero of its
    name argument.

    Signed-off-by: Markus Armbruster
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Markus Armbruster
     
  • This adds a minimalistic braille screen reader support. This is meant to
    be used by blind people e.g. on boot failures or when / cannot be mounted
    etc and thus the userland screen readers can not work.

    [akpm@linux-foundation.org: fix exports]
    Signed-off-by: Samuel Thibault
    Cc: Jiri Kosina
    Cc: Dmitry Torokhov
    Acked-by: Alan Cox
    Cc: Randy Dunlap
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Samuel Thibault
     
  • - Operations are now a shared const function block as with most other Linux
    objects

    - Introduce wrappers for some optional functions to get consistent behaviour

    - Wrap put_char which used to be patched by the tty layer

    - Document which functions are needed/optional

    - Make put_char report success/fail

    - Cache the driver->ops pointer in the tty as tty->ops

    - Remove various surplus lock calls we no longer need

    - Remove proc_write method as noted by Alexey Dobriyan

    - Introduce some missing sanity checks where certain driver/ldisc
    combinations would oops as they didn't check needed methods were present

    [akpm@linux-foundation.org: fix fs/compat_ioctl.c build]
    [akpm@linux-foundation.org: fix isicom]
    [akpm@linux-foundation.org: fix arch/ia64/hp/sim/simserial.c build]
    [akpm@linux-foundation.org: fix kgdb]
    Signed-off-by: Alan Cox
    Acked-by: Greg Kroah-Hartman
    Cc: Jason Wessel
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alan Cox
     

29 Apr, 2008

1 commit

  • Due to the rcupreempt.h WARN_ON trigged, I got 2G syslog file. For some
    serious complaining of kernel, we need repeat the warnings, so here I isolate
    the ratelimit part of printk.c to a standalone file.

    Signed-off-by: Dave Young
    Acked-by: Paul E. McKenney
    Tested-by: Paul E. McKenney
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dave Young
     

16 Apr, 2008

1 commit

  • When I cleaned up printk() and split up the printk locking logic in
    commit 266c2e0abeca649fa6667a1a427ad1da507c6375 ("Make printk() console
    semaphore accesses sensible") I had incorrectly moved the call to
    have_callable_console() outside of the console semaphore.

    That was buggy. The console semaphore protects the console_drivers list
    that is used by have_callable_console().

    Thanks go to Bongani Hlope who saw this as a hang on shutdown and reboot
    and bisected the bug to the right commit, and tested this patch. See

    http://lkml.org/lkml/2008/4/11/315

    Bisected-and-tested-by: Bongani Hlope
    Cc: Alexey Dobriyan
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

25 Mar, 2008

1 commit


26 Feb, 2008

1 commit

  • printk recursion detection prepends message to printk_buf and offsets
    printk_buf when actual message is printed but it forgets to trim buffer
    length accordingly. This can result in overrun in extreme cases. Fix it.

    [ mingo@elte.hu:

    bug was introduced by me via:

    commit 32a76006683f7b28ae3cc491da37716e002f198e
    Author: Ingo Molnar
    Date: Fri Jan 25 21:07:58 2008 +0100

    printk: make printk more robust by not allowing recursion
    ]

    Signed-off-by: Tejun Heo
    Signed-off-by: Ingo Molnar
    Signed-off-by: Linus Torvalds

    Tejun Heo
     

09 Feb, 2008

3 commits


07 Feb, 2008

1 commit

  • Stop using unsigned _longs_ for printk buffer indexes. Log buffer is way
    smaller than 2 gigabytes and unsigned ints will work too . Indeed, they do
    work nicely on all 32-bit platforms where longs and ints are the same.

    With this patch, we have following size savings on amd64:

    text data bss dec hex filename
    5997 313 17736 24046 5dee 2.6.23.1.t64/kernel/printk.o
    5858 313 17700 23871 5d3f 2.6.23.1.printk.t64/kernel/printk.o

    Signed-off-by: Denys Vlasenko
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Denys Vlasenko
     

01 Feb, 2008

1 commit


30 Jan, 2008

1 commit


27 Jan, 2008

1 commit


26 Jan, 2008

4 commits

  • printk timestamps: use ktime_get().

    Some platforms have a functioning clocksource function only after
    they are done with early bootup, so delay this until out of
    SYSTEM_BOOTING state.

    it's also inherently safe now, as any bugs in this area will be
    caught by the printk recursion checks.

    Signed-off-by: Ingo Molnar

    Ingo Molnar
     
  • printk_clock() is obsolete - it has been replaced with cpu_clock().

    Signed-off-by: Ingo Molnar

    Ingo Molnar
     
  • Stefano Brivio reported weird printk timestamp behavior during
    CPU frequency changes:

    http://bugzilla.kernel.org/show_bug.cgi?id=9475

    fix CONFIG_PRINT_TIME's reliance on sched_clock() and use cpu_clock()
    instead.

    Reported-and-bisected-by: Stefano Brivio
    Signed-off-by: Ingo Molnar

    Ingo Molnar
     
  • make printk more robust by allowing recursion only if there's a crash
    going on. Also add recursion detection.

    I've tested it with an artificially injected printk recursion - instead
    of a lockup or spontaneous reboot or other crash, the output was a well
    controlled:

    [ 41.057335] SysRq : BUG: recent printk recursion!
    [ 41.057335] loglevel0-8 reBoot Crashdump show-all-locks(D) tErm Full kIll saK showMem Nice powerOff showPc show-all-timers(Q) unRaw Sync showTasks Unmount shoW-blocked-tasks

    also do all this printk-debug logic with irqs disabled.

    Signed-off-by: Ingo Molnar
    Reviewed-by: Nick Piggin

    Ingo Molnar
     

29 Dec, 2007

1 commit

  • We're exporting an __init function, oops :-)

    The core issue here is that add_preferred_console() is marked
    as __init, this makes it impossible to invoke this thing from
    a driver probe routine which is what the Sparc serial drivers
    need to do.

    There is no harm in dropping the __init marker. This code will
    actually work properly when invoked from a modular driver,
    except that init will probably not pick up the console change
    without some other support code.

    Then we can drop the __init from sunserial_console_match()
    and we're no longer exporting an __init function to modules.

    Signed-off-by: David S. Miller

    David S. Miller
     

19 Oct, 2007

1 commit

  • Currently, there's a CONFIG_DISABLE_CONSOLE_SUSPEND that allows one to stop
    the serial console from being suspended when the rest of the machine goes
    to sleep. This is incredibly useful for debugging power management-related
    things; however, having it as a compile-time option has proved to be
    incredibly inconvenient for us (OLPC). There are plenty of times that we
    want serial console to not suspend, but for the most part we'd like serial
    console to be suspended.

    This drops CONFIG_DISABLE_CONSOLE_SUSPEND, and replaces it with a kernel
    boot parameter (no_console_suspend). By default, the serial console will
    be suspended along with the rest of the system; by passing
    'no_console_suspend' to the kernel during boot, serial console will remain
    alive during suspend.

    For now, this is pretty serial console specific; further fixes could be
    applied to make this work for things like netconsole.

    Signed-off-by: Andres Salomon
    Acked-by: "Rafael J. Wysocki"
    Acked-by: Pavel Machek
    Cc: Nigel Cunningham
    Cc: Russell King
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andres Salomon
     

17 Oct, 2007

2 commits

  • Add two new functions for reading the kernel log buffer. The intention is for
    them to be used by recovery/dump/debug code so the kernel log can be easily
    retrieved/parsed in a crash scenario, but they are generic enough for other
    people to dream up other fun uses.

    [akpm@linux-foundation.org: buncha fixes]
    Signed-off-by: Mike Frysinger
    Cc: Robin Getz
    Cc: Greg Ungerer
    Cc: Russell King
    Cc: Paul Mundt
    Acked-by: Tim Bird
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Frysinger
     
  • Optionally add a boot delay after each kernel printk() call, crudely
    measured in milliseconds, with a maximum delay of 10 seconds per printk.

    Enable CONFIG_BOOT_PRINTK_DELAY=y and then add (e.g.):
    "lpj=loops_per_jiffy boot_delay=100"
    to the kernel command line.

    It has been useful in cases like "during boot, my machine just reboots or the
    screen goes black" by slowing down printk, (and adding initcall_debug), we can
    usually see the last thing that happened before the lights went out which is
    usually a valuable clue.

    [akpm@linux-foundation.org: not all architectures implement CONFIG_HZ]
    [akpm@linux-foundation.org: fix lots of stuff]
    [bunk@stusta.de: kernel/printk.c: make 2 variables static]
    [heiko.carstens@de.ibm.com: fix slow down printk on boot compile error]
    Signed-off-by: Randy Dunlap
    Signed-off-by: Dave Jones
    Signed-off-by: Adrian Bunk
    Signed-off-by: Heiko Carstens
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Randy Dunlap
     

22 Aug, 2007

1 commit


21 Aug, 2007

1 commit

  • This is a followup to the cleanups for earlyprintk patch from Gerd Hoffmann

    http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=69331af79cf29e26d1231152a172a1a10c2df511

    This ensures that a bootconsole is unregistered if it is not replaced.
    The current implementation spews garbage out the bootconsole in this case,
    since the bootconsole structure is normally in the init section, and is
    freed, but still used.

    Signed-off-by: Robin Getz
    Acked-by: Gerd Hoffmann
    Acked-by: Paul Mundt
    Cc: Mike Frysinger
    Signed-off-by: Linus Torvalds

    Robin Getz
     

04 Aug, 2007

1 commit

  • the early setup function serial8250_console_early_setup() can be called
    from non __init code (eg. hotpluggable serial ports like serial_cs) so
    remove the __init from the call chain to avoid crashes.

    Signed-off-by: Daniel Ritz
    Cc: Yinghai Lu
    Signed-off-by: Linus Torvalds

    Daniel Ritz
     

17 Jul, 2007

5 commits

  • kernel/printk.c: document possible deadlock against scheduler

    The printk's comment states that it can be called from every context,
    which might lead to false illusion that it could be called from everywhere
    without any restrictions.

    This is however not true - a call to printk() could deadlock if called from
    scheduler code (namely from schedule(), wake_up(), etc) on runqueue lock
    when it tries to wake up klogd. Document this.

    Signed-off-by: Jiri Kosina
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jiri Kosina
     
  • Allow printk_time to be enabled or disabled at boot time. Previously it
    could be enabled only, but not disabled.

    Change printk_time from an int to a bool since that's what it is. Make its
    logical (exposed) name just be "time" (was "printk_time").

    Note: Changes kernel boot option syntax from "time" to "printk.time=value".

    Since printk_time is declared as a module_param, it can also be
    changed at run-time by modifying
    /sys/module/printk/parameters/time
    to a value of 1/Y/y to enabled it or 0/N/n to disable it.

    Since printk_time is declared as a module_param, its value can also
    be set at boot-time by using
    linux printk.time=

    If the "time" boot option is used, print a message that it is deprecated
    and will be removed.

    Note its planned removal in feature-removal-schedule.txt.

    Signed-off-by: Randy Dunlap
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Randy Dunlap
     
  • Beacuse SERIAL_PORT_DFNS is removed from include/asm-i386/serial.h and
    include/asm-x86_64/serial.h. the serial8250_ports need to be probed late in
    serial initializing stage. the console_init=>serial8250_console_init=>
    register_console=>serial8250_console_setup will return -ENDEV, and console
    ttyS0 can not be enabled at that time. need to wait till uart_add_one_port in
    drivers/serial/serial_core.c to call register_console to get console ttyS0.
    that is too late.

    Make early_uart to use early_param, so uart console can be used earlier. Make
    it to be bootconsole with CON_BOOT flag, so can use console handover feature.
    and it will switch to corresponding normal serial console automatically.

    new command line will be:
    console=uart8250,io,0x3f8,9600n8
    console=uart8250,mmio,0xff5e0000,115200n8
    or
    earlycon=uart8250,io,0x3f8,9600n8
    earlycon=uart8250,mmio,0xff5e0000,115200n8

    it will print in very early stage:
    Early serial console at I/O port 0x3f8 (options '9600n8')
    console [uart0] enabled
    later for console it will print:
    console handover: boot [uart0] -> real [ttyS0]

    Signed-off-by:
    Cc: Andi Kleen
    Cc: Bjorn Helgaas
    Cc: Russell King
    Cc: Gerd Hoffmann
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Yinghai Lu
     
  • for earlyprintk=ttyS0,9600 console=tty0 console=ttyS0,9600n8

    the handover will happen from earlyser0 to tty0. but what we want is to
    hand over to ttyS0.

    Later with serial-convert-early_uart-to-earlycon-for-8250.patch,

    console=tty0 console=uart8250,io,0x3f8,9600n8

    will handover to ttyS0 instead of tty0.

    Signed-off-by: Yinghai Lu
    Cc: Andi Kleen
    Cc: Bjorn Helgaas
    Cc: Russell King
    Cc: Gerd Hoffmann
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Yinghai Lu
     
  • Change name to buf according to the usage as name + index

    Signed-off-by: Yinghai Lu
    Cc: Andi Kleen
    Cc: Bjorn Helgaas
    Cc: Russell King
    Cc: Gerd Hoffmann
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Yinghai Lu
     

09 May, 2007

2 commits

  • Remove includes of where it is not used/needed.
    Suggested by Al Viro.

    Builds cleanly on x86_64, i386, alpha, ia64, powerpc, sparc,
    sparc64, and arm (all 59 defconfigs).

    Signed-off-by: Randy Dunlap
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Randy Dunlap
     
  • The console subsystem already has an idea of a boot console, using the
    CON_BOOT flag. The implementation has some flaws though. The major
    problem is that presence of a boot console makes register_console() ignore
    any other console devices (unless explicitly specified on the kernel
    command line).

    This patch fixes the console selection code to *not* consider a boot
    console a full-featured one, so the first non-boot console registering will
    become the default console instead. This way the unregister call for the
    boot console in the register_console() function actually triggers and the
    handover from the boot console to the real console device works smoothly.
    Added a printk for the handover, so you know which console device the
    output goes to when the boot console stops printing messages.

    The disable_early_printk() call is obsolete with that patch, explicitly
    disabling the early console isn't needed any more as it works automagically
    with that patch.

    I've walked through the tree, dropped all disable_early_printk() instances
    found below arch/ and tagged the consoles with CON_BOOT if needed. The
    code is tested on x86, sh (thanks to Paul) and mips (thanks to Ralf).

    Changes to last version: Rediffed against -rc3, adapted to mips cleanups by
    Ralf, fixed "udbg-immortal" cmd line arg on powerpc.

    Signed-off-by: Gerd Hoffmann
    Acked-by: Paul Mundt
    Acked-by: Ralf Baechle
    Cc: Andi Kleen
    Cc: Alan Cox
    Cc: Richard Henderson
    Cc: Ivan Kokshaysky
    Cc: Paul Mackerras
    Cc: Benjamin Herrenschmidt
    Cc: Jeremy Fitzhardinge
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Gerd Hoffmann
     

18 Feb, 2007

1 commit


12 Feb, 2007

3 commits

  • The order of locking between lockdep_off/on() and local_irq_save/restore() in
    vprintk() should be changed.

    * In kernel/printk.c :

    vprintk() does :

    preempt_disable()
    local_irq_save()
    lockdep_off()
    spin_lock(&logbuf_lock)
    spin_unlock(&logbuf_lock)
    if(!down_trylock(&console_sem))
    up(&console_sem)
    lockdep_on()
    local_irq_restore()
    preempt_enable()

    The goals here is to make sure we do not call printk() recursively from
    kernel/lockdep.c:__lock_acquire() (called from spin_* and down/up) nor from
    kernel/lockdep.c:trace_hardirqs_on/off() (called from local_irq_restore/save).
    It can then potentially call printk() through mark_held_locks/mark_lock.

    It correctly protects against the spin_lock call and the up/down call, but it
    does not protect against local_irq_restore. It could cause infinite recursive
    printk/trace_hardirqs_on() calls when printk() is called from the
    mark_lock() error handing path.

    We should change the locking so it becomes correct :

    preempt_disable()
    lockdep_off()
    local_irq_save()
    spin_lock(&logbuf_lock)
    spin_unlock(&logbuf_lock)
    if(!down_trylock(&console_sem))
    up(&console_sem)
    local_irq_restore()
    lockdep_on()
    preempt_enable()

    Signed-off-by: Mathieu Desnoyers
    Acked-by: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mathieu Desnoyers
     
  • Remove hack with printing space to wake up klogd. Use explicit
    wake_up_klogd().

    See earlier discussion
    http://groups.google.com/group/fa.linux.kernel/browse_frm/thread/75f496668409f58d/1a8f28983a51e1ff?lnk=st&q=wake_up_klogd+group%3Afa.linux.kernel&rnum=2#1a8f28983a51e1ff

    Signed-off-by: Alexey Dobriyan
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kirill Korotaev
     
  • A variety of (mostly) innocuous fixes to the embedded kernel-doc content in
    source files, including:

    * make multi-line initial descriptions single line
    * denote some function names, constants and structs as such
    * change erroneous opening '/*' to '/**' in a few places
    * reword some text for clarity

    Signed-off-by: Robert P. J. Day
    Cc: "Randy.Dunlap"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Robert P. J. Day
     

23 Dec, 2006

1 commit


08 Dec, 2006

3 commits