mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] x86 reboot: Remove inb_p usage
@ 2008-01-19 15:44 Alan Cox
  2008-01-19 17:00 ` Ray Lee
  2008-01-22  9:55 ` Ingo Molnar
  0 siblings, 2 replies; 4+ messages in thread
From: Alan Cox @ 2008-01-19 15:44 UTC (permalink / raw)
  To: mingo, akpm, linux-kernel

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)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] x86 reboot: Remove inb_p usage
  2008-01-19 15:44 [PATCH] x86 reboot: Remove inb_p usage Alan Cox
@ 2008-01-19 17:00 ` Ray Lee
  2008-01-19 19:59   ` Alan Cox
  2008-01-22  9:55 ` Ingo Molnar
  1 sibling, 1 reply; 4+ messages in thread
From: Ray Lee @ 2008-01-19 17:00 UTC (permalink / raw)
  To: Alan Cox; +Cc: mingo, akpm, linux-kernel

On Jan 19, 2008 7:44 AM, Alan Cox <alan@lxorguk.ukuu.org.uk> wrote:
> 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)

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>.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] x86 reboot: Remove inb_p usage
  2008-01-19 17:00 ` Ray Lee
@ 2008-01-19 19:59   ` Alan Cox
  0 siblings, 0 replies; 4+ messages in thread
From: Alan Cox @ 2008-01-19 19:59 UTC (permalink / raw)
  To: Ray Lee; +Cc: mingo, akpm, linux-kernel

> 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

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] x86 reboot: Remove inb_p usage
  2008-01-19 15:44 [PATCH] x86 reboot: Remove inb_p usage Alan Cox
  2008-01-19 17:00 ` Ray Lee
@ 2008-01-22  9:55 ` Ingo Molnar
  1 sibling, 0 replies; 4+ messages in thread
From: Ingo Molnar @ 2008-01-22  9:55 UTC (permalink / raw)
  To: Alan Cox; +Cc: mingo, akpm, linux-kernel


* Alan Cox <alan@lxorguk.ukuu.org.uk> wrote:

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

thanks, applied.

	Ingo

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-01-22  9:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-19 15:44 [PATCH] x86 reboot: Remove inb_p usage Alan Cox
2008-01-19 17:00 ` Ray Lee
2008-01-19 19:59   ` Alan Cox
2008-01-22  9:55 ` Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®