Re: [PATCH] x86 reboot: Remove inb_p usage

Previous thread: Re: ACPI early ioremap problems by Ingo Molnar on Saturday, January 19, 2008 - 11:30 am. (7 messages)

Next thread: [PATCH] pata_pdc202xx_old: Fix crashes with ATAPI by Alan Cox on Saturday, January 19, 2008 - 11:51 am. (5 messages)
To: <mingo@...>, <akpm@...>, <linux-kernel@...>
Date: Saturday, January 19, 2008 - 11:44 am

We are driving a motherboard port so use a 2uS explicit delay at this
point.

Signed-off-by: Alan Cox <alan@redhat.com>

diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.24-rc8-mm1/arch/x86/kernel/reboot.c linux-2.6.24-rc8-mm1/arch/x86/kernel/reboot.c
--- linux.vanilla-2.6.24-rc8-mm1/arch/x86/kernel/reboot.c 2008-01-19 14:47:55.000000000 +0000
+++ linux-2.6.24-rc8-mm1/arch/x86/kernel/reboot.c 2008-01-19 14:53:58.000000000 +0000
@@ -319,9 +319,11 @@
{
int i;

- for (i = 0; i < 0x10000; i++)
- if ((inb_p(0x64) & 0x02) == 0)
+ for (i = 0; i < 0x10000; i++) {
+ if ((inb(0x64) & 0x02) == 0)
break;
+ udelay(2);
+ }
}

void machine_emergency_restart(void)
--

To: Alan Cox <alan@...>
Cc: <mingo@...>, <akpm@...>, <linux-kernel@...>
Date: Tuesday, January 22, 2008 - 5:55 am

thanks, applied.

Ingo
--

To: Alan Cox <alan@...>
Cc: <mingo@...>, <akpm@...>, <linux-kernel@...>
Date: Saturday, January 19, 2008 - 1:00 pm

Stupid question from the peanut gallery: If you're going to go through
all this, maybe it would be better to define an inline
isa_bus_delay(void) { udelay(2); } and use that instead? I can only
imagine some poor sod coming along later and wondering why there's a
udelay(2) there. OTOH, there is an inb right above it, so <shrug>.
--

To: Ray Lee <ray-lk@...>
Cc: <mingo@...>, <akpm@...>, <linux-kernel@...>
Date: Saturday, January 19, 2008 - 3:59 pm

There are very few places it crops up - in fact that one is the only non
pic/pit/cmos example in the core arch code.

Alan
--

Previous thread: Re: ACPI early ioremap problems by Ingo Molnar on Saturday, January 19, 2008 - 11:30 am. (7 messages)

Next thread: [PATCH] pata_pdc202xx_old: Fix crashes with ATAPI by Alan Cox on Saturday, January 19, 2008 - 11:51 am. (5 messages)