patch-2.3.7 linux/drivers/video/vgacon.c

Next file: linux/fs/Config.in
Previous file: linux/drivers/video/cyber2000fb.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.6/linux/drivers/video/vgacon.c linux/drivers/video/vgacon.c
@@ -135,9 +135,17 @@
  */
 static inline void write_vga(unsigned char reg, unsigned int val)
 {
-#ifndef SLOW_VGA
 	unsigned int v1, v2;
+	unsigned long flags;
+
+	/*
+	 * ddprintk might set the console position from interrupt
+	 * handlers, thus the write has to be IRQ-atomic.
+	 */
+	save_flags(flags);
+	cli();
 
+#ifndef SLOW_VGA
 	v1 = reg + (val & 0xff00);
 	v2 = reg + 1 + ((val << 8) & 0xff00);
 	outw(v1, vga_video_port_reg);
@@ -148,6 +156,7 @@
 	outb_p(reg+1, vga_video_port_reg);
 	outb_p(val & 0xff, vga_video_port_val);
 #endif
+	restore_flags(flags);
 }
 
 __initfunc(static const char *vgacon_startup(void))

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)