Skip to contentSkip to conversation

PC keyboard: Disable interrupts during initialization

PATCH New Malware 1 participant 1 message Feb 22, 2003 Char and misc drivers

lore
Share & tools
lore

Malware

author
#0 lore raw

PATCH 1/1 PC keyboard: Disable interrupts during initialization

# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas:
# ChangeSet 1.757.40.2 -> 1.757.40.3
# drivers/char/pc_keyb.c 1.13 -> 1.14
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 03/02/22 [email protected] 1.757.40.3
# pc_keyb.c:
# Fix: Disable interrupts during keyboard initialization.

#      The initialization does cause keyboard interrupts. On most platforms this
#      should not be a problem. But if there is no interrupt controller the
#      interrupt might retriggered for ever. This happended on the m68k/TekXpress
#      port. 

# --------------------------------------------
#

drivers/char/pc_keyb.c +7 -0
diff -Nru a/drivers/char/pc_keyb.c b/drivers/char/pc_keyb.c
@@ -898,6 +898,8 @@
 
 void __init pckbd_init_hw(void)
 {
+	unsigned long flags;
+
 	if (!kbd_controller_present()) {
 		kbd_exists = 0;
 		return;
@@ -905,6 +907,9 @@
 
 	kbd_request_region();
 
+	save_flags(flags);
+	cli();
+
 	/* Flush any pending input. */
 	kbd_clear_input();
 
@@ -922,6 +927,8 @@
 
 	/* Ok, finally allocate the IRQ, and off we go.. */
 	kbd_request_irq(keyboard_interrupt);
+
+	restore_flags(flags);
 }
 
 #if defined CONFIG_PSMOUSE