TTY fixes for 2.6.36-git
Subsystems (2)
PATCH 1/1 TTY fixes for 2.6.36-git
Here are some tty and serial bugfixes for your 2.6.36-git tree.
Please pull from:
master.kernel.org:/pub/scm/linux/kernel/git/gregkh/tty-2.6.git/
These patches have been in the linux-next tree and -mm for a while now.
Patches will be sent to the linux-kernel mailing list, if anyone wants to see them.
thanks,
greg k-h
------------
MAINTAINERS | 3 +-- drivers/char/tty_io.c | 2 +- drivers/char/vt.c | 15 ++++----------- drivers/serial/bfin_sport_uart.c | 2 +- include/linux/serial.h | 3 +-- include/linux/serial_core.h | 3 ++- 6 files changed, 10 insertions(+), 18 deletions(-)
---------------
Francisco Jerez (1):
vt: Fix console corruption on driver hand-over.
Jiri Slaby (1):
MAINTAINERS: orphan isicom
Nathael Pajani (1):
tty: fix tty_line must not be equal to number of allocated tty pointers in tty driver
Philippe Langlais (1):
serial: fix port type conflict between NS16550A & U6_16550A
Sonic Zhang (1):
serial: bfin_sport_uart: restore transmit frame sync fix
PATCH 1/5 vt: Fix console corruption on driver hand-over.
From: Francisco Jerez <[email protected]>
After 02f0777a0d6560eb995aade34a1b82f95c0452da "vc_origin" is no longer reset to the screen buffer before calling the con_init() hook of the new console driver.
If the old driver wasn't using a fixed scanout buffer (e.g. the case of vgacon) "vc_origin" may be a pointer to a VRAM location, and its contents aren't guaranteed to be preserved after calling con_deinit() on the old driver and con_init() on the new driver, i.e. the subsequent console resize may fill the framebuffer with garbage.
It can be reproduced in the transition from vgacon to the nouveau framebuffer driver: in that case the legacy VGA aperture "vc_origin" points to becomes unreadable after fbcon_init().
This patch reverts the mentioned commit. To avoid the problem it intended to fix, stop using "vc_scr_end" in vc_do_resize() to calculate how many rows we have to copy (actually the code looks simpler this way without the help of "vc_scr_end").
--- drivers/char/vt.c | 15 ++++----------- 1 files changed, 4 insertions(+), 11 deletions(-)
drivers/char/vt.c +4 -11
@@ -906,22 +906,16 @@ static int vc_do_resize(struct tty_struct *tty, struct vc_data *vc,* bottom of buffer */ old_origin += (old_rows - new_rows) * old_row_size; - end = vc->vc_scr_end; }else {/* * Cursor is in no man's land, copy 1/2 screenful * from the top and bottom of cursor position */ old_origin += (vc->vc_y - new_rows/2 ) * old_row_size; - end = old_origin + (old_row_size * new_rows); } - }else -/* -* Cursor near the top, copy contents from the top of buffer -*/ - end = (old_rows > new_rows) ? old_origin + - (old_row_size * new_rows) : - vc->vc_scr_end; + } + + end = old_origin + old_row_size *min (old_rows, new_rows);update_attr (vc);
@@ -3075,8 +3069,7 @@ static int bind_con_driver(const struct consw *csw, int first, int last, old_was_color = vc->vc_can_do_color; vc->vc_sw->con_deinit (vc); -if (!vc->vc_origin) - vc->vc_origin = (unsigned long )vc->vc_screenbuf; + vc->vc_origin = (unsigned long )vc->vc_screenbuf;visual_init (vc, i,0 );set_origin (vc);update_attr (vc);
Signature · 1 line
1.7.2
PATCH 2/5 MAINTAINERS: orphan isicom
In reply to Greg KHFrom: Jiri Slaby <[email protected]>
I do not maintain isicom anymore...
--- MAINTAINERS | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-)
MAINTAINERS +1 -2
@@ -3923,8 +3923,7 @@ F: Documentation/sound/oss/MultiSound F: sound/oss/msnd* MULTITECH MULTIPORT CARD (ISICOM) -M: Jiri Slaby <[email protected]> -S: Maintained +S: Orphan F: drivers/char/isicom.c F: include/linux/isicom.h
Signature · 1 line
1.7.2
PATCH 3/5 serial: fix port type conflict between NS16550A & U6_16550A
In reply to Greg KHFrom: Philippe Langlais <[email protected]>
Bug seen by Dr. David Alan Gilbert with sparse
--- include/linux/serial.h | 3 +-- include/linux/serial_core.h | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-)
include/linux/serial.h +1 -2
@@ -77,8 +77,7 @@ struct serial_struct {#define PORT_16654 11#define PORT_16850 12#define PORT_RSA 13/* RSA-DV II/S card */ -#define PORT_U6_16550A 14 -#define PORT_MAX 14 +#define PORT_MAX 13#define SERIAL_IO_PORT 0#define SERIAL_IO_HUB6 1
include/linux/serial_core.h +2 -1
@@ -44,7 +44,8 @@#define PORT_RM9000 16/* PMC-Sierra RM9xxx internal UART */ #define PORT_OCTEON 17/* Cavium OCTEON internal UART */ #define PORT_AR7 18/* Texas Instruments AR7 internal UART */ -#define PORT_MAX_8250 18/* max port ID */ +#define PORT_U6_16550A 19/* ST-Ericsson U6xxx internal UART */ +#define PORT_MAX_8250 19/* max port ID */ /* * ARM specific type numbers. These are not currently guaranteed
Signature · 1 line
1.7.2
PATCH 5/5 tty: fix tty_line must not be equal to number of allocated tty pointers in tty driver
In reply to Greg KHFrom: Nathael Pajani <[email protected]>
I found a bug "by chance" in drivers/char/tty_io.c
I mean "by chance" because I was just reading the code of the tty_find_polling_driver() to make a new tty_find_by_name() function.
In tty_find_polling_driver() the driver actually test "tty_line <= p->num" while num refers to the number of struct tty_struct pointers allocated for the p->ttys (p is a tty_driver), and tty_line is scanned in a tty name, which can be for example ttyS2. Then tty_line equals 2. And if p->num is 2, we have only p->ttys[0] and p->ttys[1], but no p->ttys[2].
This is actually unharmful, for tty_find_polling_driver() is used only in drivers/serial/kgdboc.c, and there's a test over there to find a console with a matching index, which will never happen.
This is still a bug anyway.
--- drivers/char/tty_io.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/char/tty_io.c +1 -1
@@ -355,7 +355,7 @@ struct tty_driver *tty_find_polling_driver(char *name, int *line)if (*stp =='\0' ) stp =NULL ; -if (tty_line >=0 && tty_line <= p->num && p->ops && +if (tty_line >=0 && tty_line < p->num && p->ops && p->ops->poll_init && !p->ops->poll_init (p, tty_line, stp)) { res =tty_driver_kref_get (p); *line = tty_line;
Signature · 1 line
1.7.2