[PATCH] 2.2.15-pre7 and console system...

From: Petr Vandrovec (vandrove@vc.cvut.cz)
Date: Fri Feb 18 2000 - 04:54:23 EST


Hi Alan,
  few minutes ago I promised on linux-kernel to send this patch to you.
This adds disable_bh/enable_bh around cursor operations, as they can
cause screen repaint and thus console reenter (with possible crash).
  Second part (video/fbcon.c) fixes crash when scrollback occurs
on non-fg console (it happens usually only on multihead systems).
This patch was already included in 2.3.x, but no-one ported it
back.
  As I do not use 2.2.x, I can only say that now it booted and I
write this letter on it. In good old 2.2.5 times, it worked for
singlehead and I do not see any reason, why it should be broken...
                                        Best regards,
                                                Petr Vandrovec
                                                vandrove@vc.cvut.cz

diff -urdN linux/drivers/char/console.c linux/drivers/char/console.c
--- linux/drivers/char/console.c Tue Jan 4 18:12:14 2000
+++ linux/drivers/char/console.c Fri Feb 18 09:33:47 2000
@@ -503,6 +503,9 @@
 {
     if (!IS_FG || console_blanked || vcmode == KD_GRAPHICS)
         return;
+
+ disable_bh(CONSOLE_BH);
+
     if (deccm) {
         if (currcons == sel_cons)
                 clear_selection();
@@ -511,6 +514,8 @@
             sw->con_cursor(vc_cons[currcons].d,CM_DRAW);
     } else
         hide_cursor(currcons);
+
+ enable_bh(CONSOLE_BH);
 }
 
 static void set_origin(int currcons)
@@ -1809,11 +1814,12 @@
         himask = hi_font_mask;
         charmask = himask ? 0x1ff : 0xff;
 
+ disable_bh(CONSOLE_BH);
+
         /* undraw cursor first */
         if (IS_FG)
                 hide_cursor(currcons);
 
- disable_bh(CONSOLE_BH);
         while (!tty->stopped && count) {
                 enable_bh(CONSOLE_BH);
                 if (from_user)
diff -urdN linux/drivers/video/fbcon.c linux/drivers/video/fbcon.c
--- linux/drivers/video/fbcon.c Thu Aug 26 00:29:49 1999
+++ linux/drivers/video/fbcon.c Fri Feb 18 09:33:29 2000
@@ -1087,8 +1087,12 @@
 
 static inline void fbcon_softback_note(struct vc_data *conp, int t, int count)
 {
- unsigned short *p = (unsigned short *)
- (conp->vc_origin + t * conp->vc_size_row);
+ unsigned short *p;
+
+ if (conp->vc_num != fg_console)
+ return;
+ p = (unsigned short *)(conp->vc_origin + t * conp->vc_size_row);
+
     while (count) {
             scr_memcpyw((u16 *)softback_in, p, conp->vc_size_row);
             count--;

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed Feb 23 2000 - 21:00:21 EST