public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "David N. Welton" <davidw@eidetix.com>
To: Sascha Wilde <wilde@sha-bang.de>
Cc: Dmitry Torokhov <dtor_core@ameritech.net>,
	LKML <linux-kernel@vger.kernel.org>,
	Vojtech Pavlik <vojtech@suse.cz>
Subject: Re: 2.6 kernel won't reboot on AMD system - 8042 problem?
Date: Thu, 12 Aug 2004 19:00:04 +0200	[thread overview]
Message-ID: <411BA214.2060306@eidetix.com> (raw)
In-Reply-To: <20040811175613.GA829@kenny.sha-bang.local>

Sascha Wilde wrote:

>>> Is PS/2 supposed to support hotpluging at all?  I guess it's not,
>>>  but I may be wrong...
>> 
>> Yes it is, at least with newer (or rather not ancient) hardware...
> 
> 
> well, so the patch obviously can't be a final solution...

Yes, it doesn't strike me as being ideal.

More playing with the triple fault leads me to this:


static int i8042_command(unsigned char *param, int command)
{
	unsigned long flags;
	int retval = 0, i = 0;

	spin_lock_irqsave(&i8042_lock, flags);

	retval = i8042_wait_write();
	if (!retval) {
		dbg("%02x -> i8042 (command)", command & 0xff);
		i8042_write_command(command & 0xff);
	}

=====> A

	if (!retval)
		for (i = 0; i < ((command >> 12) & 0xf); i++) {
			if ((retval = i8042_wait_write())) break;
			dbg("%02x -> i8042 (parameter)", param[i]);
			i8042_write_data(param[i]);
		}

=====> B

Point 'B' is the "point of no reboot", at A we can still triple fault it
and get a nice normal reboot, so it's the parameter that it's writing
that it causing it to go funny.

I noticed something odd though... I reported this in another email:

*With keyboard* :

mice: PS/2 mouse device common for all mice
drivers/input/serio/i8042.c: 20 -> i8042 (command) [0]
drivers/input/serio/i8042.c: 65 <- i8042 (return) [0]

*Without keyboard* :

mice: PS/2 mouse device common for all mice
drivers/input/serio/i8042.c: fa <- i8042 (flush, aux) [0]
drivers/input/serio/i8042.c: 20 -> i8042 (command) [0]
drivers/input/serio/i8042.c: 9a <- i8042 (return) [0]

I noticed that
0x9a is the 'inverse' of 0x65.  If I set it to 0x65 and write that out,
it still reboots afterwards!  Hrm.  I don't know what that means
exactly, but apparently it *is* possible to write something to the
controller and have it keep going.

Sascha, if you want to test it out, try this in i8042_controller_init,
at about line 724 (near this: i8042_initial_ctr = i8042_ctr;)

	{
	    unsigned char pram;
	    pram = (~i8042_ctr) & 0xff ;
	    i8042_command(&pram, I8042_CMD_CTL_WCTR);
	}

	{
	    static struct
	    {
		unsigned short       size __attribute__ ((packed));
		unsigned long long * base __attribute__ ((packed));
	    } no_idt = { 0, 0 };

	    __asm__ __volatile__("lidt %0": :"m" (no_idt));
	    __asm__ __volatile__("int3");
	}

It reboots!

-- 
David N. Welton
davidw@eidetix.com

  reply	other threads:[~2004-08-12 17:00 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-11 14:14 2.6 kernel won't reboot on AMD system - 8042 problem? Dmitry Torokhov
2004-08-11 17:56 ` Sascha Wilde
2004-08-12 17:00   ` David N. Welton [this message]
2004-08-12 17:23     ` David N. Welton
2004-08-13 21:29       ` Sascha Wilde
2004-08-12 20:13     ` Vojtech Pavlik
2004-08-13 10:13       ` David N. Welton
2004-08-13 12:03         ` Vojtech Pavlik
2004-08-13 12:58           ` David N. Welton
     [not found] <auto-000000462036@appliedminds.com>
2004-08-09  8:28 ` David N. Welton
2004-08-10  9:37   ` Sascha Wilde
2004-08-10 15:38     ` James Lamanna
     [not found] <4112A626.1000706@appliedminds.com>
2004-08-06  8:22 ` David N. Welton
2004-08-06 16:55   ` James Lamanna
2004-08-08 12:18   ` Sascha Wilde
2004-08-08 15:05     ` Dmitry Torokhov
2004-08-11 20:06       ` Sascha Wilde
  -- strict thread matches above, loose matches on Subject: below --
2004-07-28 17:51 2.6 kernel won't reboot on AMD system (no, not the BIOS...) David N. Welton
2004-08-05 12:48 ` 2.6 kernel won't reboot on AMD system - 8042 problem? David N. Welton
2004-08-05 19:25   ` Sascha Wilde
2004-08-11  6:31   ` Dmitry Torokhov
2004-08-11  8:36     ` David N. Welton
2004-08-11 12:27     ` Vojtech Pavlik
2004-08-11 12:45       ` David N. Welton
2004-08-11 13:43       ` Sascha Wilde
2004-08-11 14:17         ` Vojtech Pavlik
2004-08-11 13:55       ` David Ford
2004-08-11 20:14     ` Sascha Wilde

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=411BA214.2060306@eidetix.com \
    --to=davidw@eidetix.com \
    --cc=dtor_core@ameritech.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vojtech@suse.cz \
    --cc=wilde@sha-bang.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox