Re: [PATCH] x86: provide a DMI based port 0x80 I/O delay override.

From: Ingo Molnar
Date: Mon Dec 17 2007 - 11:49:47 EST



* Alan Cox <alan@xxxxxxxxxxxxxxxxxxx> wrote:

> I don't think we should be offering udelay based delays at this point.
> There are a lot of drivers to fix first. This is just one trivial
> example
>
> ...
>
> --- drivers/watchdog/wdt.c~ 2007-12-17 15:58:49.000000000 +0000
> +++ drivers/watchdog/wdt.c 2007-12-17 15:58:49.000000000 +0000
> @@ -70,6 +70,8 @@
> static int io=0x240;
> static int irq=11;
>
> +static DEFINE_SPINLOCK(wdt_lock);
> +
> module_param(io, int, 0);
> MODULE_PARM_DESC(io, "WDT io port (default=0x240)");
> module_param(irq, int, 0);
> @@ -109,6 +111,8 @@
>
> static int wdt_start(void)
> {
> + unsigned long flags;
> + spin_lock_irqsave(&wdt_lock, flags);
> inb_p(WDT_DC); /* Disable watchdog */
> wdt_ctr_mode(0,3); /* Program CTR0 for Mode 3:

a really stupid question, in what way does:

inb_p(WDT_DC);

work better than:

inb(WDT_DC);
delay(2);

?

(i'm not suggesting you are wrong, this detail just fails to click at
the moment.)

Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/