2004-09-19 21:10:41

by Felipe Alfaro Solana

[permalink] [raw]
Subject: 2.6.9-rc2-mm1: i8042.c: Can't read CTR while initializing i8042

Hello,

My keyboard has suddenly stopped working with 2.6.9-rc2-mm1-VP-S1 and
2.6.9-rc2-mm1. This is part of the output of dmesg:

i8042: ACPI [P2KI] at I/O 0x0, 0x0, irq 1
i8042: ACPI [P2MI] at irq 12
i8042.c: Can't read CTR while initializing i8042.

This does happen on 2.6.9-rc2-mm1-VP-S1 and 2.6.9-rc2-mm1 on a NEC
Chrom@ laptop, with a 440BX motherboard, Pentium III Mobile and
integrated PS/2 keyboard and mouse. It doesn't happen in 2.6.8.1, not
does it happen on my Pentium 4 machine, however.

Any ideas?

Attached is the complete dmesg and config used to compile the kernel.
Thanks!


Attachments:
DMESG (7.50 kB)
config-2.6.9-rc2-mm1 (23.82 kB)
Download all attachments

2004-09-19 22:49:09

by Dmitry Torokhov

[permalink] [raw]
Subject: Re: 2.6.9-rc2-mm1: i8042.c: Can't read CTR while initializing i8042

On Sunday 19 September 2004 04:08 pm, Felipe Alfaro Solana wrote:
> Hello,
>
> My keyboard has suddenly stopped working with 2.6.9-rc2-mm1-VP-S1 and
> 2.6.9-rc2-mm1. This is part of the output of dmesg:
>
> i8042: ACPI [P2KI] at I/O 0x0, 0x0, irq 1
> i8042: ACPI [P2MI] at irq 12
> i8042.c: Can't read CTR while initializing i8042.
>
> This does happen on 2.6.9-rc2-mm1-VP-S1 and 2.6.9-rc2-mm1 on a NEC
> Chrom@ laptop, with a 440BX motherboard, Pentium III Mobile and
> integrated PS/2 keyboard and mouse. It doesn't happen in 2.6.8.1, not
> does it happen on my Pentium 4 machine, however.
>
> Any ideas?
>

It looks like your box has a badly written DSDT table. Try booting with
i8042.noacpi for now ot try Bjorn's patch that can be found here:

http://marc.theaimsgroup.com/?l=linux-kernel&m=109508824931419&w=2

--
Dmitry

2004-09-19 23:26:48

by Hans-Frieder Vogt

[permalink] [raw]
Subject: Re: 2.6.9-rc2-mm1: i8042.c: Can't read CTR while initializing i8042

Felipe Alfaro Solana wrote:
> My keyboard has suddenly stopped working with 2.6.9-rc2-mm1-VP-S1 and
2.6.9-rc2-mm1. This is part of the output of dmesg:
>
> i8042: ACPI [P2KI] at I/O 0x0, 0x0, irq 1
> i8042: ACPI [P2MI] at irq 12
> i8042.c: Can't read CTR while initializing i8042.
>
> This does happen on 2.6.9-rc2-mm1-VP-S1 and 2.6.9-rc2-mm1 on a NEC Chrom@
laptop, with a 440BX motherboard, Pentium III Mobile and integrated PS/2
keyboard and mouse. It doesn't happen in 2.6.8.1, not does it happen on my
Pentium 4 machine, however.
>
> Any ideas?

I had the same problem on my AMD64 system (MSI K8T Neo board). The reason, why
the ioports are not recognised on this board (i.e., why they show up as 0x0,
0x0) is, that the ACPI defines these ports as FixedIO () and not as IO () as
expected by the current linux code. FixedIO is perfectly fine and in line
with the ACPI standard. So the DSDT table is NOT bad but linux is currently
simply not flexible enough to cope with all possible (and allowable)
combinations.

With the small attached patch the i8042 IO-ports were recognised on my board
(only tested with keyboard).

Voytech, could you include this patch into your next patch set?

--- linux-2.6.9-rc1-mm5.orig/drivers/input/serio/i8042-x86ia64io.h 2004-09-13
15:39:39.061522663 +0200
+++ linux-2.6.9-rc1-mm5/drivers/input/serio/i8042-x86ia64io.h 2004-09-20
01:10:32.124593201 +0200
@@ -105,6 +105,7 @@ static acpi_status i8042_acpi_parse_reso
{
struct i8042_acpi_resources *i8042_res = data;
struct acpi_resource_io *io;
+ struct acpi_resource_fixed_io *fixed_io;
struct acpi_resource_irq *irq;
struct acpi_resource_ext_irq *ext_irq;

@@ -119,6 +120,16 @@ static acpi_status i8042_acpi_parse_reso
}
break;

+ case ACPI_RSTYPE_FIXED_IO:
+ fixed_io = &res->data.fixed_io;
+ if (fixed_io->range_length) {
+ if (!i8042_res->port1)
+ i8042_res->port1 = fixed_io->base_address;
+ else
+ i8042_res->port2 = fixed_io->base_address;
+ }
+ break;
+
case ACPI_RSTYPE_IRQ:
irq = &res->data.irq;
if (irq->number_of_interrupts > 0)

--
--
Hans-Frieder Vogt e-mail: hfvogt <at> arcor .dot. de
hfvogt <at> gmx .dot. net

2004-09-20 11:20:09

by Felipe Alfaro Solana

[permalink] [raw]
Subject: Re: 2.6.9-rc2-mm1: i8042.c: Can't read CTR while initializing i8042

On Sep 20, 2004, at 01:25, Hans-Frieder Vogt wrote:

> Felipe Alfaro Solana wrote:
>> My keyboard has suddenly stopped working with 2.6.9-rc2-mm1-VP-S1 and
> 2.6.9-rc2-mm1. This is part of the output of dmesg:
>>
>> i8042: ACPI [P2KI] at I/O 0x0, 0x0, irq 1
>> i8042: ACPI [P2MI] at irq 12
>> i8042.c: Can't read CTR while initializing i8042.
>>
>> This does happen on 2.6.9-rc2-mm1-VP-S1 and 2.6.9-rc2-mm1 on a NEC
>> Chrom@
> laptop, with a 440BX motherboard, Pentium III Mobile and integrated
> PS/2
> keyboard and mouse. It doesn't happen in 2.6.8.1, not does it happen
> on my
> Pentium 4 machine, however.
>>
>> Any ideas?
>
> I had the same problem on my AMD64 system (MSI K8T Neo board). The
> reason, why
> the ioports are not recognised on this board (i.e., why they show up
> as 0x0,
> 0x0) is, that the ACPI defines these ports as FixedIO () and not as IO
> () as
> expected by the current linux code. FixedIO is perfectly fine and in
> line
> with the ACPI standard. So the DSDT table is NOT bad but linux is
> currently
> simply not flexible enough to cope with all possible (and allowable)
> combinations.
>
> With the small attached patch the i8042 IO-ports were recognised on my
> board
> (only tested with keyboard).
>
> Voytech, could you include this patch into your next patch set?
>
> --- linux-2.6.9-rc1-mm5.orig/drivers/input/serio/i8042-x86ia64io.h
> 2004-09-13
> 15:39:39.061522663 +0200
> +++ linux-2.6.9-rc1-mm5/drivers/input/serio/i8042-x86ia64io.h
> 2004-09-20
> 01:10:32.124593201 +0200
> @@ -105,6 +105,7 @@ static acpi_status i8042_acpi_parse_reso
> {
> struct i8042_acpi_resources *i8042_res = data;
> struct acpi_resource_io *io;
> + struct acpi_resource_fixed_io *fixed_io;
> struct acpi_resource_irq *irq;
> struct acpi_resource_ext_irq *ext_irq;
>
> @@ -119,6 +120,16 @@ static acpi_status i8042_acpi_parse_reso
> }
> break;
>
> + case ACPI_RSTYPE_FIXED_IO:
> + fixed_io = &res->data.fixed_io;
> + if (fixed_io->range_length) {
> + if (!i8042_res->port1)
> + i8042_res->port1 = fixed_io->base_address;
> + else
> + i8042_res->port2 = fixed_io->base_address;
> + }
> + break;
> +
> case ACPI_RSTYPE_IRQ:
> irq = &res->data.irq;
> if (irq->number_of_interrupts > 0)
>
>

Bingo!
This patch solves my problems with i8042.
Please, include it upstream.
Thanks!