02 Nov, 2017

1 commit

  • Many source files in the tree are missing licensing information, which
    makes it harder for compliance tools to determine the correct license.

    By default all files without license information are under the default
    license of the kernel, which is GPL version 2.

    Update the files which contain no license information with the 'GPL-2.0'
    SPDX license identifier. The SPDX identifier is a legally binding
    shorthand, which can be used instead of the full boiler plate text.

    This patch is based on work done by Thomas Gleixner and Kate Stewart and
    Philippe Ombredanne.

    How this work was done:

    Patches were generated and checked against linux-4.14-rc6 for a subset of
    the use cases:
    - file had no licensing information it it.
    - file was a */uapi/* one with no licensing information in it,
    - file was a */uapi/* one with existing licensing information,

    Further patches will be generated in subsequent months to fix up cases
    where non-standard license headers were used, and references to license
    had to be inferred by heuristics based on keywords.

    The analysis to determine which SPDX License Identifier to be applied to
    a file was done in a spreadsheet of side by side results from of the
    output of two independent scanners (ScanCode & Windriver) producing SPDX
    tag:value files created by Philippe Ombredanne. Philippe prepared the
    base worksheet, and did an initial spot review of a few 1000 files.

    The 4.13 kernel was the starting point of the analysis with 60,537 files
    assessed. Kate Stewart did a file by file comparison of the scanner
    results in the spreadsheet to determine which SPDX license identifier(s)
    to be applied to the file. She confirmed any determination that was not
    immediately clear with lawyers working with the Linux Foundation.

    Criteria used to select files for SPDX license identifier tagging was:
    - Files considered eligible had to be source code files.
    - Make and config files were included as candidates if they contained >5
    lines of source
    - File already had some variant of a license header in it (even if
    Reviewed-by: Philippe Ombredanne
    Reviewed-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

27 Oct, 2016

1 commit

  • The code is mirrorred in scrolldelta implementations of both vgacon
    and sisusb. Let's move the code to a separate helper where we will
    perform a common cleanup and further changes.

    While we are moving the code, make it linear and save one indentation
    level. This is done by returning from the "!lines" then-branch
    immediatelly. This allows flushing the else-branch 1 level to the
    left, obviously.

    Few more new lines and comments were added too.

    And do not forget to export the helper function given sisusb can be
    built as module.

    Signed-off-by: Jiri Slaby
    Cc: Thomas Winischhofer
    Cc: Tomi Valkeinen
    Cc:
    Cc:
    Signed-off-by: Greg Kroah-Hartman

    Jiri Slaby
     

26 Jun, 2016

2 commits


27 May, 2013

1 commit


21 May, 2013

2 commits

  • 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: Wang YanQing
    Signed-off-by: Greg Kroah-Hartman

    Wang YanQing
     
  • 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

    ======================================================
    [ 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: [] flush_work+0x5/0x2e0

    but task is already holding lock:
    blocked: (console_lock){+.+.+.}, instance: ffffffff81c2fde0, at: [] vt_ioctl+0xb61/0x1230

    which lock already depends on the new lock.

    the existing dependency chain (in reverse order) is:

    -> #1 (console_lock){+.+.+.}:
    [] lock_acquire+0xa4/0x210
    [] console_lock+0x77/0x80
    [] con_flush_chars+0x2d/0x50
    [] n_tty_receive_buf+0x122/0x14d0
    [] flush_to_ldisc+0x119/0x170
    [] process_one_work+0x211/0x700
    [] worker_thread+0x11b/0x3a0
    [] kthread+0xed/0x100
    [] ret_from_fork+0x7c/0xb0

    -> #0 ((&buf->work)){+.+...}:
    [] __lock_acquire+0x193a/0x1c00
    [] lock_acquire+0xa4/0x210
    [] flush_work+0x4e/0x2e0
    [] __cancel_work_timer+0x95/0x130
    [] cancel_work_sync+0x10/0x20
    [] tty_port_destroy+0x12/0x20
    [] vc_deallocate+0xf8/0x110
    [] vt_ioctl+0xb6c/0x1230
    [] tty_ioctl+0x285/0xd50
    [] do_vfs_ioctl+0x305/0x530
    [] sys_ioctl+0x81/0xa0
    [] 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: [] vt_ioctl+0xb61/0x1230
    stack backtrace:
    Pid: 26163, comm: (agetty) Not tainted 3.9.0+ #16
    Call Trace:
    [] print_circular_bug+0x200/0x20e
    [] __lock_acquire+0x193a/0x1c00
    [] ? sched_clock+0x9/0x10
    [] ? sched_clock+0x9/0x10
    [] ? native_sched_clock+0x20/0x80
    [] lock_acquire+0xa4/0x210
    [] ? flush_work+0x5/0x2e0
    [] flush_work+0x4e/0x2e0
    [] ? flush_work+0x5/0x2e0
    [] ? mark_held_locks+0xbb/0x140
    [] ? __free_pages_ok.part.57+0x93/0xc0
    [] ? mark_held_locks+0xbb/0x140
    [] ? __cancel_work_timer+0x82/0x130
    [] __cancel_work_timer+0x95/0x130
    [] cancel_work_sync+0x10/0x20
    [] tty_port_destroy+0x12/0x20
    [] vc_deallocate+0xf8/0x110
    [] vt_ioctl+0xb6c/0x1230
    [] ? lock_release_holdtime.part.30+0xa1/0x170
    [] tty_ioctl+0x285/0xd50
    [] ? inode_has_perm.isra.46.constprop.61+0x56/0x80
    [] do_vfs_ioctl+0x305/0x530
    [] ? selinux_file_ioctl+0x5b/0x110
    [] sys_ioctl+0x81/0xa0
    [] system_call_fastpath+0x16/0x1b

    Cc: Dave Jones
    Signed-off-by: Peter Hurley
    Signed-off-by: Greg Kroah-Hartman

    Peter Hurley
     

08 Feb, 2013

2 commits

  • (not the fbcon maintainer pull 2)

    fix bug in vgacon on bootup and fbcon losing fonts on startup.

    * console-fixes: (50 commits)
    fbcon: don't lose the console font across generic->chip driver switch
    vgacon/vt: clear buffer attributes when we load a 512 character font (v2)

    Dave Airlie
     
  • I've still got lockdep warnings even after Alan's patch, and it seems that
    yet more band aids are required to paper over similar paths for
    unbind_con_driver() and unregister_con_driver(). After this hack, lockdep
    warnings are finally gone.

    Signed-off-by: Takashi Iwai
    Cc: Alan Cox
    Cc: Florian Tobias Schandinat
    Cc: Jiri Kosina
    Cc: stable
    Tested-by: Sedat Dilek
    Signed-off-by: Andrew Morton
    Signed-off-by: Dave Airlie

    Takashi Iwai
     

07 Feb, 2013

1 commit

  • 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: Dave Airlie

    Dave Airlie
     

25 Apr, 2012

1 commit

  • When we do this it becomes clear the lock we should be holding is the vc
    lock, and in fact many of our other helpers are properly invoked this way.

    We don't at this point guarantee not to race the keyboard code but the results
    of that appear harmless and that was true before we started as well.

    We now have no users of tty_lock in the console driver...

    Signed-off-by: Alan Cox
    Signed-off-by: Greg Kroah-Hartman

    Alan Cox
     

09 Mar, 2012

1 commit

  • 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: Alan Cox
    Signed-off-by: Greg Kroah-Hartman

    Alan Cox
     

25 Feb, 2012

1 commit

  • First step to debletcherising the vt console layer - pick a victim and fix
    the locking

    This is a nice simple object with its own rules so lets pick it out for
    treatment. The user of the table already has a lock so we will also use the
    same lock for updates.

    Signed-off-by: Alan Cox
    Signed-off-by: Greg Kroah-Hartman

    Alan Cox
     

27 Jul, 2011

1 commit

  • 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: Mandeep Singh Baines
    Cc: Huang Ying
    Cc: Andi Kleen
    Cc: Hugh Dickins
    Cc: Olaf Hering
    Cc: Jesse Barnes
    Cc: Dave Airlie
    Cc: Greg Kroah-Hartman
    Acked-by: Alan Cox
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mandeep Singh Baines
     

18 Feb, 2011

1 commit

  • 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: Jiri Olsa
    Signed-off-by: Greg Kroah-Hartman

    Jiri Olsa
     

11 Aug, 2010

2 commits

  • 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: Kevin Winchester
    Signed-off-by: Greg Kroah-Hartman

    Kevin Winchester
     
  • 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: Dave Airlie
    Signed-off-by: Jesse Barnes
    Acked-by: James Simmons
    Cc: Alan Cox
    Signed-off-by: Andrew Morton
    Signed-off-by: Greg Kroah-Hartman

    Jesse Barnes
     

14 Nov, 2009

1 commit


20 Sep, 2009

3 commits

  • We have vt_kern.h for this

    Signed-off-by: Alan Cox
    Signed-off-by: Greg Kroah-Hartman

    Alan Cox
     
  • In the past someone gratuitiously borrowed chunks of kernel internal vt
    code and dumped them in kernel/power. They have all sorts of deep relations
    with the vt code so put them in the vt tree instead

    Signed-off-by: Alan Cox
    Signed-off-by: Greg Kroah-Hartman

    Alan Cox
     
  • This is needed and requested in various forms for ConsoleKit, screenblank
    handling and the like so do the job with a single interface. Also build the
    interface so that unlike VT_WAITACTIVE and friends it won't miss events.

    FIXME: Should this be a waitactive ioctl or a new device file you can poll
    and read events from. We need the code anyway to fix up the existing broken
    wait for console switch logic but the ConsoleKit people would prefer the
    new device to the ioctl we have here

    Signed-off-by: Alan Cox
    Signed-off-by: Greg Kroah-Hartman

    Alan Cox
     

14 Oct, 2008

1 commit


16 Aug, 2008

1 commit

  • This moves it to being a tty operation. That removes special cases and now
    also means that resize can be picked up by um and other non vt consoles
    which may have a resize operation.

    Signed-off-by: Alan Cox
    Signed-off-by: Linus Torvalds

    Alan Cox
     

03 Aug, 2008

1 commit


02 Aug, 2008

1 commit

  • This fixes a bug in operator precedence in the newly introduced vc_translate
    macro. Without this fix, the translation of some characters on the
    kernel console is garbled.

    This patch was copied to the e-mail list previously for testing. Now,
    all reports confirm that it works, so this is an official post for
    application.

    Signed-off-by: Tim Bird
    Signed-off-by: David Woodhouse

    Tim Bird
     

04 Jun, 2008

1 commit

  • By turning off the new CONSOLE_TRANSLATIONS option and dropping the
    associated code and tables from the kernel, we can save about 7KiB.

    Taken from linux-tiny project by Tim Bird and mangled further by dwmw2.

    Signed-off-by: Tim Bird
    Signed-off-by: David Woodhouse

    David Woodhouse
     

07 Feb, 2008

1 commit


17 Oct, 2007

1 commit

  • As of now, the kernel defaults to non-unicode and XLATE for the keyboard.
    We've been changing this in Fedora, but that requires patching the defaults
    in the kernel.

    The attached introduces CONFIG_VT_UNICODE, which sets the console in
    unicode mode by default on boot, including both the virtual terminal and
    the keyboard driver.

    Signed-off-by: Bill Nottingham
    Cc: Samuel Thibault
    Cc: Dmitry Torokhov
    Cc: Jiri Kosina
    Cc: Alan Cox
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Bill Nottingham
     

18 Jul, 2007

2 commits

  • - add comment for unbind_con_driver().
    - bind_con_driver() is made private again

    Signed-off-by: Jesse Barnes
    Signed-off-by: Antonino Daplas
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jesse Barnes
     
  • Allow fbcon to select the primary display adapter using the
    fb_is_primary_device() arch-specific helper. If a a primary adapter is
    detected, fbcon will unbind the old adapter from the VT layer, then rebind
    using the new adapter. This requires that bind_/unbind_con_driver() be made
    public.

    Because this feature may produce unexpected behavior (from the user's POV),
    this must be explicitly enabled in Kconfig.

    [akpm@linux-foundation.org: export unbind_con_driver]
    Signed-off-by: Antonino Daplas
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Antonino A. Daplas
     

09 May, 2007

1 commit


17 Mar, 2007

1 commit

  • When the console is in VT_AUTO+KD_GRAPHICS mode, switching to the
    SUSPEND_CONSOLE fails, resulting in vt_waitactive() waiting indefinitely or
    until the task is interrupted. This patch tests if a console switch can
    occur in set_console() and returns early if a console switch is not
    possible.

    [akpm@linux-foundation.org: cleanup]
    Signed-off-by: Andrew Johnson
    Acked-by: Pavel Machek
    Cc: "Antonino A. Daplas"
    Cc: "Rafael J. Wysocki"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Johnson
     

02 Oct, 2006

1 commit

  • This is such a rare path it took me a while to figure out how to test
    this after soring out the locking.

    This patch does several things.
    - The variables used are moved into a structure and declared in vt_kern.h
    - A spinlock is added so we don't have SMP races updating the values.
    - Instead of raw pid_t value a struct_pid is used to guard against
    pid wrap around issues, if the daemon to spawn a new console dies.

    Signed-off-by: Eric W. Biederman
    Cc: Oleg Nesterov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Eric W. Biederman
     

30 Sep, 2006

1 commit

  • 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: Alan Cox
    Cc: Paul Fulghum
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alan Cox
     

11 Jul, 2006

1 commit

  • MAX_NR_CONSOLES, fg_console, want_console and last_console are more of a
    function of the VT layer than the TTY one. Moving these to vt.h and vt_kern.h
    allows all of the framebuffer and VT console drivers to remove their
    dependency on tty.h.

    [akpm@osdl.org: fix alpha build]
    Signed-off-by: Jon Smirl
    Signed-off-by: Antonino Daplas
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jon Smirl
     

21 Jun, 2006

1 commit

  • * git://git.infradead.org/hdrcleanup-2.6: (63 commits)
    [S390] __FD_foo definitions.
    Switch to __s32 types in joystick.h instead of C99 types for consistency.
    Add to headers included for userspace in
    Move inclusion of out of user scope in asm-x86_64/mtrr.h
    Remove struct fddi_statistics from user view in
    Move user-visible parts of drivers/s390/crypto/z90crypt.h to include/asm-s390
    Revert include/media changes: Mauro says those ioctls are only used in-kernel(!)
    Include and use __uXX types in
    Use __uXX types in , include too
    Remove private struct dx_hash_info from public view in
    Include and use __uXX types in
    Use __uXX types in for struct divert_blk et al.
    Use __u32 for elf_addr_t in , not u32. It's user-visible.
    Remove PPP_FCS from user view in , remove __P mess entirely
    Use __uXX types in user-visible structures in
    Don't use 'u32' in user-visible struct ip_conntrack_old_tuple.
    Use __uXX types for S390 DASD volume label definitions which are user-visible
    S390 BIODASDREADCMB ioctl should use __u64 not u64 type.
    Remove unneeded inclusion of from
    Fix private integer types used in V4L2 ioctls.
    ...

    Manually resolve conflict in include/linux/mtd/physmap.h

    Linus Torvalds
     

01 Jun, 2006

1 commit

  • From: Andrew Morton

    Revert commit ff4da2e262d2509fe1bacff70dd00934be569c66.

    It broke APM suspend, probably because APM doesn't switch back to a VT
    when suspending.

    Tracked down by Matt Mackall

    Rafael sayeth:
    "It only fixed the theoretical issue that a quick-handed user could
    switch to X after processes have been frozen and before the devices
    are suspended.

    With the current userland suspend tools it shouldn't be necessary."

    Cc: Pavel Machek
    Cc: "Rafael J. Wysocki"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     

26 Apr, 2006

1 commit


23 Mar, 2006

1 commit


17 Apr, 2005

1 commit

  • 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!

    Linus Torvalds