提交 080c652d 编写于 作者: D Dmitry Torokhov

Input: i8042 - give more trust to PNP data on i386

On some boxes that don't have PS/2 mice connected at startup BIOS
completely disables AUX port and attempts to access it result in
hosed keyboard. Historically we do not trust ACPI/PNP data on
i386 and try to poke AUX port even if we did not find an active
PNP node for it. However in cases when BIOS writers got KBD port
properly described we can assume that they did the right thing
for AUX port as well.
Signed-off-by: NDmitry Torokhov <dtor@mail.ru>
上级 85f202d5
...@@ -366,6 +366,7 @@ static void i8042_pnp_exit(void) ...@@ -366,6 +366,7 @@ static void i8042_pnp_exit(void)
static int __init i8042_pnp_init(void) static int __init i8042_pnp_init(void)
{ {
char kbd_irq_str[4] = { 0 }, aux_irq_str[4] = { 0 }; char kbd_irq_str[4] = { 0 }, aux_irq_str[4] = { 0 };
int pnp_data_busted = 0;
int err; int err;
if (i8042_nopnp) { if (i8042_nopnp) {
...@@ -413,28 +414,49 @@ static int __init i8042_pnp_init(void) ...@@ -413,28 +414,49 @@ static int __init i8042_pnp_init(void)
#endif #endif
if (((i8042_pnp_data_reg & ~0xf) == (i8042_data_reg & ~0xf) && if (((i8042_pnp_data_reg & ~0xf) == (i8042_data_reg & ~0xf) &&
i8042_pnp_data_reg != i8042_data_reg) || !i8042_pnp_data_reg) { i8042_pnp_data_reg != i8042_data_reg) ||
printk(KERN_WARNING "PNP: PS/2 controller has invalid data port %#x; using default %#x\n", !i8042_pnp_data_reg) {
printk(KERN_WARNING
"PNP: PS/2 controller has invalid data port %#x; "
"using default %#x\n",
i8042_pnp_data_reg, i8042_data_reg); i8042_pnp_data_reg, i8042_data_reg);
i8042_pnp_data_reg = i8042_data_reg; i8042_pnp_data_reg = i8042_data_reg;
pnp_data_busted = 1;
} }
if (((i8042_pnp_command_reg & ~0xf) == (i8042_command_reg & ~0xf) && if (((i8042_pnp_command_reg & ~0xf) == (i8042_command_reg & ~0xf) &&
i8042_pnp_command_reg != i8042_command_reg) || !i8042_pnp_command_reg) { i8042_pnp_command_reg != i8042_command_reg) ||
printk(KERN_WARNING "PNP: PS/2 controller has invalid command port %#x; using default %#x\n", !i8042_pnp_command_reg) {
printk(KERN_WARNING
"PNP: PS/2 controller has invalid command port %#x; "
"using default %#x\n",
i8042_pnp_command_reg, i8042_command_reg); i8042_pnp_command_reg, i8042_command_reg);
i8042_pnp_command_reg = i8042_command_reg; i8042_pnp_command_reg = i8042_command_reg;
pnp_data_busted = 1;
} }
if (!i8042_nokbd && !i8042_pnp_kbd_irq) { if (!i8042_nokbd && !i8042_pnp_kbd_irq) {
printk(KERN_WARNING "PNP: PS/2 controller doesn't have KBD irq; using default %d\n", i8042_kbd_irq); printk(KERN_WARNING
"PNP: PS/2 controller doesn't have KBD irq; "
"using default %d\n", i8042_kbd_irq);
i8042_pnp_kbd_irq = i8042_kbd_irq; i8042_pnp_kbd_irq = i8042_kbd_irq;
pnp_data_busted = 1;
} }
if (!i8042_noaux && !i8042_pnp_aux_irq) { if (!i8042_noaux && !i8042_pnp_aux_irq) {
printk(KERN_WARNING "PNP: PS/2 controller doesn't have AUX irq; using default %d\n", i8042_aux_irq); if (!pnp_data_busted && i8042_pnp_kbd_irq) {
printk(KERN_WARNING
"PNP: PS/2 appears to have AUX port disabled, "
"if this is incorrect please boot with "
"i8042.nopnp\n");
i8042_noaux = 1;
} else {
printk(KERN_WARNING
"PNP: PS/2 controller doesn't have AUX irq; "
"using default %d\n", i8042_aux_irq);
i8042_pnp_aux_irq = i8042_aux_irq; i8042_pnp_aux_irq = i8042_aux_irq;
} }
}
i8042_data_reg = i8042_pnp_data_reg; i8042_data_reg = i8042_pnp_data_reg;
i8042_command_reg = i8042_pnp_command_reg; i8042_command_reg = i8042_pnp_command_reg;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册