* [GIT PATCH] TTY fixes for 2.6.36-git
@ 2010-09-04 2:09 Greg KH
2010-09-04 2:13 ` [PATCH 1/5] vt: Fix console corruption on driver hand-over Greg Kroah-Hartman
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Greg KH @ 2010-09-04 2:09 UTC (permalink / raw)
To: Linus Torvalds, Andrew Morton; +Cc: linux-kernel
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/5] vt: Fix console corruption on driver hand-over.
2010-09-04 2:09 [GIT PATCH] TTY fixes for 2.6.36-git Greg KH
@ 2010-09-04 2:13 ` Greg Kroah-Hartman
2010-09-04 2:13 ` [PATCH 2/5] MAINTAINERS: orphan isicom Greg Kroah-Hartman
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Greg Kroah-Hartman @ 2010-09-04 2:13 UTC (permalink / raw)
To: linux-kernel
Cc: Francisco Jerez, qiaochong, Greg Kroah-Hartman, Andrew Morton,
Alan Cox
From: Francisco Jerez <currojerez@riseup.net>
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").
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Cc: qiaochong <qiaochong@loongson.cn>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/char/vt.c | 15 ++++-----------
1 files changed, 4 insertions(+), 11 deletions(-)
diff --git a/drivers/char/vt.c b/drivers/char/vt.c
index 50590c7..281aada 100644
--- a/drivers/char/vt.c
+++ b/drivers/char/vt.c
@@ -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);
--
1.7.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/5] MAINTAINERS: orphan isicom
2010-09-04 2:09 [GIT PATCH] TTY fixes for 2.6.36-git Greg KH
2010-09-04 2:13 ` [PATCH 1/5] vt: Fix console corruption on driver hand-over Greg Kroah-Hartman
@ 2010-09-04 2:13 ` Greg Kroah-Hartman
2010-09-04 2:13 ` [PATCH 3/5] serial: fix port type conflict between NS16550A & U6_16550A Greg Kroah-Hartman
2010-09-04 2:13 ` [PATCH 5/5] tty: fix tty_line must not be equal to number of allocated tty pointers in tty driver Greg Kroah-Hartman
3 siblings, 0 replies; 5+ messages in thread
From: Greg Kroah-Hartman @ 2010-09-04 2:13 UTC (permalink / raw)
To: linux-kernel; +Cc: Jiri Slaby, Greg Kroah-Hartman
From: Jiri Slaby <jslaby@suse.cz>
I do not maintain isicom anymore...
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
MAINTAINERS | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/MAINTAINERS b/MAINTAINERS
index c36f5d7..c5afc93d 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -3923,8 +3923,7 @@ F: Documentation/sound/oss/MultiSound
F: sound/oss/msnd*
MULTITECH MULTIPORT CARD (ISICOM)
-M: Jiri Slaby <jirislaby@gmail.com>
-S: Maintained
+S: Orphan
F: drivers/char/isicom.c
F: include/linux/isicom.h
--
1.7.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 3/5] serial: fix port type conflict between NS16550A & U6_16550A
2010-09-04 2:09 [GIT PATCH] TTY fixes for 2.6.36-git Greg KH
2010-09-04 2:13 ` [PATCH 1/5] vt: Fix console corruption on driver hand-over Greg Kroah-Hartman
2010-09-04 2:13 ` [PATCH 2/5] MAINTAINERS: orphan isicom Greg Kroah-Hartman
@ 2010-09-04 2:13 ` Greg Kroah-Hartman
2010-09-04 2:13 ` [PATCH 5/5] tty: fix tty_line must not be equal to number of allocated tty pointers in tty driver Greg Kroah-Hartman
3 siblings, 0 replies; 5+ messages in thread
From: Greg Kroah-Hartman @ 2010-09-04 2:13 UTC (permalink / raw)
To: linux-kernel; +Cc: Philippe Langlais, stable, Greg Kroah-Hartman
From: Philippe Langlais <philippe.langlais@stericsson.com>
Bug seen by Dr. David Alan Gilbert with sparse
Signed-off-by: Philippe Langlais <philippe.langlais@stericsson.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
include/linux/serial.h | 3 +--
include/linux/serial_core.h | 3 ++-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/include/linux/serial.h b/include/linux/serial.h
index 1ebc694..ef91406 100644
--- a/include/linux/serial.h
+++ b/include/linux/serial.h
@@ -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
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index 64458a9..563e234 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -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
--
1.7.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 5/5] tty: fix tty_line must not be equal to number of allocated tty pointers in tty driver
2010-09-04 2:09 [GIT PATCH] TTY fixes for 2.6.36-git Greg KH
` (2 preceding siblings ...)
2010-09-04 2:13 ` [PATCH 3/5] serial: fix port type conflict between NS16550A & U6_16550A Greg Kroah-Hartman
@ 2010-09-04 2:13 ` Greg Kroah-Hartman
3 siblings, 0 replies; 5+ messages in thread
From: Greg Kroah-Hartman @ 2010-09-04 2:13 UTC (permalink / raw)
To: linux-kernel; +Cc: Nathael Pajani, Greg Kroah-Hartman
From: Nathael Pajani <nathael.pajani@ed3l.fr>
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.
Signed-off-by: Nathael Pajani <nathael.pajani@ed3l.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/char/tty_io.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c
index 949067a..613c852 100644
--- a/drivers/char/tty_io.c
+++ b/drivers/char/tty_io.c
@@ -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;
--
1.7.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-09-04 2:13 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-04 2:09 [GIT PATCH] TTY fixes for 2.6.36-git Greg KH
2010-09-04 2:13 ` [PATCH 1/5] vt: Fix console corruption on driver hand-over Greg Kroah-Hartman
2010-09-04 2:13 ` [PATCH 2/5] MAINTAINERS: orphan isicom Greg Kroah-Hartman
2010-09-04 2:13 ` [PATCH 3/5] serial: fix port type conflict between NS16550A & U6_16550A Greg Kroah-Hartman
2010-09-04 2:13 ` [PATCH 5/5] tty: fix tty_line must not be equal to number of allocated tty pointers in tty driver Greg Kroah-Hartman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox