<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/include/linux/console.h, branch v4.14.262</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.14.262</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.14.262'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2021-11-26T10:40:24Z</updated>
<entry>
<title>serial: core: Fix initializing and restoring termios speed</title>
<updated>2021-11-26T10:40:24Z</updated>
<author>
<name>Pali Rohár</name>
<email>pali@kernel.org</email>
</author>
<published>2021-10-02T13:09:00Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=9112e7ef87149b3d8093e7446d784117f6e18d69'/>
<id>urn:sha1:9112e7ef87149b3d8093e7446d784117f6e18d69</id>
<content type='text'>
commit 027b57170bf8bb6999a28e4a5f3d78bf1db0f90c upstream.

Since commit edc6afc54968 ("tty: switch to ktermios and new framework")
termios speed is no longer stored only in c_cflag member but also in new
additional c_ispeed and c_ospeed members. If BOTHER flag is set in c_cflag
then termios speed is stored only in these new members.

Therefore to correctly restore termios speed it is required to store also
ispeed and ospeed members, not only cflag member.

In case only cflag member with BOTHER flag is restored then functions
tty_termios_baud_rate() and tty_termios_input_baud_rate() returns baudrate
stored in c_ospeed / c_ispeed member, which is zero as it was not restored
too. If reported baudrate is invalid (e.g. zero) then serial core functions
report fallback baudrate value 9600. So it means that in this case original
baudrate is lost and kernel changes it to value 9600.

Simple reproducer of this issue is to boot kernel with following command
line argument: "console=ttyXXX,86400" (where ttyXXX is the device name).
For speed 86400 there is no Bnnn constant and therefore kernel has to
represent this speed via BOTHER c_cflag. Which means that speed is stored
only in c_ospeed and c_ispeed members, not in c_cflag anymore.

If bootloader correctly configures serial device to speed 86400 then kernel
prints boot log to early console at speed speed 86400 without any issue.
But after kernel starts initializing real console device ttyXXX then speed
is changed to fallback value 9600 because information about speed was lost.

This patch fixes above issue by storing and restoring also ispeed and
ospeed members, which are required for BOTHER flag.

Fixes: edc6afc54968 ("[PATCH] tty: switch to ktermios and new framework")
Cc: stable@vger.kernel.org
Signed-off-by: Pali Rohár &lt;pali@kernel.org&gt;
Link: https://lore.kernel.org/r/20211002130900.9518-1-pali@kernel.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>console: move console_init() out of tty_io.c</title>
<updated>2017-04-18T16:01:52Z</updated>
<author>
<name>Nicolas Pitre</name>
<email>nicolas.pitre@linaro.org</email>
</author>
<published>2017-04-12T22:37:14Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=0c688614dcce84dfdbb305fd1c399c06cecea745'/>
<id>urn:sha1:0c688614dcce84dfdbb305fd1c399c06cecea745</id>
<content type='text'>
All the console driver handling code lives in printk.c.
Move console_init() there as well so console support can still be used
when the TTY code is configured out. No logical changes from this patch.

Signed-off-by: Nicolas Pitre &lt;nico@linaro.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>console: Add callback to flush scrollback buffer to consw struct</title>
<updated>2017-01-25T10:54:02Z</updated>
<author>
<name>Manuel Schölling</name>
<email>manuel.schoelling@gmx.de</email>
</author>
<published>2017-01-13T20:07:56Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=bcd375f7f71f7106c97516bf5395149954ef8810'/>
<id>urn:sha1:bcd375f7f71f7106c97516bf5395149954ef8810</id>
<content type='text'>
This new callback is in preparation for persistent scrollback buffer
support for VGA consoles.
With a single scrollback buffer for all consoles, we could flush the
buffer just by invocating consw-&gt;con_switch(). But when each VGA console
has its own scrollback buffer, we need a new callback to tell the
video console driver which buffer to flush.

Signed-off-by: Manuel Schölling &lt;manuel.schoelling@gmx.de&gt;
Reviewed-by: Andrey Utkin &lt;andrey_utkin@fastmail.com&gt;
Tested-by: Andrey Utkin &lt;andrey_utkin@fastmail.com&gt;
Tested-by: Adam Borowski &lt;kilobyte@angband.pl&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Merge tag 'tty-4.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty</title>
<updated>2016-12-13T19:18:24Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2016-12-13T19:18:24Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=5266e70335dac35c35b5ca9cea4251c1389d4a68'/>
<id>urn:sha1:5266e70335dac35c35b5ca9cea4251c1389d4a68</id>
<content type='text'>
Pull tty/serial updates from Greg KH:
 "Here's the tty/serial patchset for 4.10-rc1.

  It's been a quiet kernel cycle for this subsystem, just a small number
  of changes. A few new serial drivers, and some cleanups to the old
  vgacon logic, and other minor serial driver changes as well.

  All of these have been in linux-next for a while with no reported
  issues"

* tag 'tty-4.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (54 commits)
  serial: 8250_mid fix calltrace when hotplug 8250 serial controller
  console: Move userspace I/O out of console_lock to fix lockdep warning
  tty: nozomi: avoid sprintf buffer overflow
  serial: 8250_pci: Detach low-level driver during PCI error recovery
  serial: core: don't check port twice in a row
  mxs-auart: count FIFO overrun errors
  serial: 8250_dw: Add support for IrDA SIR mode
  serial: 8250: Expose set_ldisc function
  serial: 8250: Add IrDA to UART capabilities
  serial: 8250_dma: power off device after TX is done
  serial: 8250_port: export serial8250_rpm_{get|put}_tx()
  serial: sunsu: Free memory when probe fails
  serial: sunhv: Free memory when remove() is called
  vt: fix Scroll Lock LED trigger name
  tty: typo in comments in drivers/tty/vt/keyboard.c
  tty: amba-pl011: Add earlycon support for SBSA UART
  tty: nozomi: use permission-specific DEVICE_ATTR variants
  tty: serial: Make the STM32 serial port depend on it's arch
  serial: ifx6x60: Free memory when probe fails
  serial: ioc4_serial: Free memory when kzalloc fails during probe
  ...
</content>
</entry>
<entry>
<title>Revert "console: don't prefer first registered if DT specifies stdout-path"</title>
<updated>2016-11-11T16:12:37Z</updated>
<author>
<name>Hans de Goede</name>
<email>hdegoede@redhat.com</email>
</author>
<published>2016-11-10T18:46:26Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=c6c7d83b9c9e6a8b3e6d84c820ac61fbffc9e396'/>
<id>urn:sha1:c6c7d83b9c9e6a8b3e6d84c820ac61fbffc9e396</id>
<content type='text'>
This reverts commit 05fd007e4629 ("console: don't prefer first
registered if DT specifies stdout-path").

The reverted commit changes existing behavior on which many ARM boards
rely.  Many ARM small-board-computers, like e.g.  the Raspberry Pi have
both a video output and a serial console.  Depending on whether the user
is using the device as a more regular computer; or as a headless device
we need to have the console on either one or the other.

Many users rely on the kernel behavior of the console being present on
both outputs, before the reverted commit the console setup with no
console= kernel arguments on an ARM board which sets stdout-path in dt
would look like this:

  [root@localhost ~]# cat /proc/consoles
  ttyS0                -W- (EC p a)    4:64
  tty0                 -WU (E  p  )    4:1

Where as after the reverted commit, it looks like this:

  [root@localhost ~]# cat /proc/consoles
  ttyS0                -W- (EC p a)    4:64

This commit reverts commit 05fd007e4629 ("console: don't prefer first
registered if DT specifies stdout-path") restoring the original
behavior.

Fixes: 05fd007e4629 ("console: don't prefer first registered if DT specifies stdout-path")
Link: http://lkml.kernel.org/r/20161104121135.4780-2-hdegoede@redhat.com
Signed-off-by: Hans de Goede &lt;hdegoede@redhat.com&gt;
Cc: Paul Burton &lt;paul.burton@imgtec.com&gt;
Cc: Rob Herring &lt;robh+dt@kernel.org&gt;
Cc: Frank Rowand &lt;frowand.list@gmail.com&gt;
Cc: Thorsten Leemhuis &lt;regressions@leemhuis.info&gt;
Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Cc: Tejun Heo &lt;tj@kernel.org&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>tty: vt, cleanup and document con_scroll</title>
<updated>2016-10-27T14:37:43Z</updated>
<author>
<name>Jiri Slaby</name>
<email>jslaby@suse.cz</email>
</author>
<published>2016-10-03T09:18:33Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=d705ff38189fcfbbfa6aa97363d30c23348ad166'/>
<id>urn:sha1:d705ff38189fcfbbfa6aa97363d30c23348ad166</id>
<content type='text'>
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: Jiri Slaby &lt;jslaby@suse.cz&gt;
Cc: Thomas Winischhofer &lt;thomas@winischhofer.net&gt;
Cc: Tomi Valkeinen &lt;tomi.valkeinen@ti.com&gt;
Cc: "James E.J. Bottomley" &lt;jejb@parisc-linux.org&gt;
Cc: Helge Deller &lt;deller@gmx.de&gt;
Cc: &lt;linux-fbdev@vger.kernel.org&gt;
Cc: &lt;linux-usb@vger.kernel.org&gt;
Cc: &lt;linux-parisc@vger.kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>console: don't prefer first registered if DT specifies stdout-path</title>
<updated>2016-10-08T01:46:30Z</updated>
<author>
<name>Paul Burton</name>
<email>paul.burton@imgtec.com</email>
</author>
<published>2016-10-08T00:03:15Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=05fd007e46296afb24d15c7d589d535e5a5b9d5c'/>
<id>urn:sha1:05fd007e46296afb24d15c7d589d535e5a5b9d5c</id>
<content type='text'>
If a device tree specifies a preferred device for kernel console output
via the stdout-path or linux,stdout-path chosen node properties or the
stdout alias then the kernel ought to honor it &amp; output the kernel
console to that device.  As it stands, this isn't the case.  Whilst we
parse the stdout-path properties &amp; set an of_stdout variable from
of_alias_scan(), and use that from of_console_check() to determine
whether to add a console device as a preferred console whilst
registering it, we also prefer the first registered console if no other
has been selected at the time of its registration.

This means that if a console other than the one the device tree selects
via stdout-path is registered first, we will switch to using it &amp; when
the stdout-path console is later registered the call to
add_preferred_console() via of_console_check() is too late to do
anything useful.  In practice this seems to mean that we switch to the
dummy console device fairly early &amp; see no further console output:

    Console: colour dummy device 80x25
    console [tty0] enabled
    bootconsole [ns16550a0] disabled

Fix this by not automatically preferring the first registered console if
one is specified by the device tree.  This allows consoles to be
registered but not enabled, and once the driver for the console selected
by stdout-path calls of_console_check() the driver will be added to the
list of preferred consoles before any other console has been enabled.
When that console is then registered via register_console() it will be
enabled as expected.

Link: http://lkml.kernel.org/r/20160809151937.26118-1-paul.burton@imgtec.com
Signed-off-by: Paul Burton &lt;paul.burton@imgtec.com&gt;
Cc: Ralf Baechle &lt;ralf@linux-mips.org&gt;
Cc: Paul Burton &lt;paul.burton@imgtec.com&gt;
Cc: Tejun Heo &lt;tj@kernel.org&gt;
Cc: Sergey Senozhatsky &lt;sergey.senozhatsky@gmail.com&gt;
Cc: Jiri Slaby &lt;jslaby@suse.cz&gt;
Cc: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Cc: Ivan Delalande &lt;colona@arista.com&gt;
Cc: Thierry Reding &lt;treding@nvidia.com&gt;
Cc: Borislav Petkov &lt;bp@suse.de&gt;
Cc: Jan Kara &lt;jack@suse.com&gt;
Cc: Petr Mladek &lt;pmladek@suse.com&gt;
Cc: Joe Perches &lt;joe@perches.com&gt;
Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Cc: Rob Herring &lt;robh+dt@kernel.org&gt;
Cc: Frank Rowand &lt;frowand.list@gmail.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>tty: vt, remove consw-&gt;con_bmove</title>
<updated>2016-06-25T16:04:48Z</updated>
<author>
<name>Jiri Slaby</name>
<email>jslaby@suse.cz</email>
</author>
<published>2016-06-23T11:34:28Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=52ad1f38b4f6e2f2133668247036ad64ef7ae18a'/>
<id>urn:sha1:52ad1f38b4f6e2f2133668247036ad64ef7ae18a</id>
<content type='text'>
It is never called since commit 81732c3b2fede (tty vt: Fix line
garbage in virtual console on command line edition) in 3.7. So remove
all the callbacks.

Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
Cc: Thomas Winischhofer &lt;thomas@winischhofer.net&gt;
Cc: linux-usb@vger.kernel.org
Cc: Jean-Christophe Plagniol-Villard &lt;plagnioj@jcrosoft.com&gt;
Cc: Tomi Valkeinen &lt;tomi.valkeinen@ti.com&gt;
Cc: "James E.J. Bottomley" &lt;jejb@parisc-linux.org&gt;
Cc: Helge Deller &lt;deller@gmx.de&gt;
Cc: linux-fbdev@vger.kernel.org
Cc: linux-parisc@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>tty: vt, consw-&gt;con_set_palette cleanup</title>
<updated>2016-06-25T16:04:48Z</updated>
<author>
<name>Jiri Slaby</name>
<email>jslaby@suse.cz</email>
</author>
<published>2016-06-23T11:34:27Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=709280da6238629c3b488b7be87c6d9185f4d03e'/>
<id>urn:sha1:709280da6238629c3b488b7be87c6d9185f4d03e</id>
<content type='text'>
* allow NULL consw-&gt;con_set_palette (some consoles define an empty
  hook)
* =&gt; remove empty hooks now
* return value of consw-&gt;con_set_palette is never checked =&gt; make the
  function void
* document consw-&gt;con_set_palette a bit

Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
Cc: Thomas Winischhofer &lt;thomas@winischhofer.net&gt;
Cc: linux-usb@vger.kernel.org
Cc: Jean-Christophe Plagniol-Villard &lt;plagnioj@jcrosoft.com&gt;
Cc: Tomi Valkeinen &lt;tomi.valkeinen@ti.com&gt;
Cc: "James E.J. Bottomley" &lt;jejb@parisc-linux.org&gt;
Cc: Helge Deller &lt;deller@gmx.de&gt;
Cc: linux-fbdev@vger.kernel.org
Cc: linux-parisc@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>tty: vt, consw-&gt;con_scrolldelta cleanup</title>
<updated>2016-06-25T16:04:48Z</updated>
<author>
<name>Jiri Slaby</name>
<email>jslaby@suse.cz</email>
</author>
<published>2016-06-23T11:34:26Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=97293de977365fe672daec2523e66ef457104921'/>
<id>urn:sha1:97293de977365fe672daec2523e66ef457104921</id>
<content type='text'>
* allow NULL consw-&gt;con_scrolldelta (some consoles define an empty
  hook)
* =&gt; remove empty hooks now
* return value of consw-&gt;con_scrolldelta is never checked =&gt; make the
  function void
* document consw-&gt;con_scrolldelta a bit

Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
Cc: Thomas Winischhofer &lt;thomas@winischhofer.net&gt;
Cc: linux-usb@vger.kernel.org
Cc: Jean-Christophe Plagniol-Villard &lt;plagnioj@jcrosoft.com&gt;
Cc: Tomi Valkeinen &lt;tomi.valkeinen@ti.com&gt;
Cc: "James E.J. Bottomley" &lt;jejb@parisc-linux.org&gt;
Cc: Helge Deller &lt;deller@gmx.de&gt;
Cc: linux-fbdev@vger.kernel.org
Cc: linux-parisc@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
