Re: patch for buggy APM implentations

Stephen.Rothwell@canb.auug.org.au
Sun, 29 Nov 1998 03:45:59 +1100


Hi Chad,

cmiller@surfsouth.com writes:
>
> This may have been discussed before, but I don't remember or see it
> discussed in the archives.
>
> During a resume from suspend, some* DOS-centric BIOSi "reset" the timer
> interrupt to DOS' frequency (~18Hz), instead of restoring linux' (100Hz).
>
> Millions of jiffies ago, David Chen prepared a patch for 2.0 that remained
> unofficial. With the new restructuring, it didn't apply at all, so I pre-
> pared the patch below, based on his code.
>
> It prolly should be disabled, by default (ref. KISS).

I have added this patch (with INIT_TIMER_AFTER_SUSPEND undefined)
and will submit it to Linus soon.

> + #ifdef INIT_TIMER_AFTER_SUSPEND
> + cli();
> + /* set the clock to 100 Hz */
> + outb_p(0x34,0x43); /* binary, mode 2, LSB/MSB, ch 0 */
> + udelay(10);
> + outb_p(LATCH & 0xff , 0x40); /* LSB */
> + udelay(10);
> + outb(LATCH >> 8 , 0x40); /* MSB */
> + udelay(10);
> + #endif

One question: why the "udelay(10);"? arch/i386/kernel/irq.c doesn't
have them.

Cheers,
Stephen

--
Stephen Rothwell                    Stephen.Rothwell@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

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