Re: RFC: outb 0x80 in inb_p, outb_p harmful on some modern AMD64 with MCP51 laptops

Alan Cox
2007-12-11T17:39:36Z

> below, from a list of those I needed to patch to eliminate refs to _b
> calls) or arch specific code (also listed below), who might know why the
> _p macros are actually needed (for any platform)?

Because the controllers were historically slower than the CPU and thus
clocked at half bus speed. Various chipsets simply shrank the logic
without fixing this.

> Note that many of the devices are not on the ISA/LPC bus now, even if
> they were, and the vga has never needed a bus-level pause since the
> original IBM PC existed. (it did need a sync with retrace, but that's
> another story).

Sync with retrace is MDA memory updates.

The vga driver is somewhat misnamed. In console mode we handle everything
back to MDA/HGA and some HGA adapters do need delays.

> 2) Why are opterons and so forth so slow on out's to x80 as the
> measurements show? That seems to me like there is a hidden bus timeout

Because the LPC bus cycles are run at ISA speed.

> I do remind all that 0x80 is a BIOS-specific standard, and is per BIOS -
> other ports have been used in the history of the IBM PC family by some
> vendors, and some machines have used it for DMA port mapping!! And

All do -thats why it is suitable.

> Windows XP does NOT use it at all. Therefore it may not be supported by

Older Windows does. Don't know about XP although DOS apps in XP will but
they may virtualise the port.

> I have a simple patch that fixes my primary concern - just change the
> CMOS_READ and CMOS_WRITE, 64-bit versions of I/O and bootcode vga
> accesses (first group below) to use the straight inb and outb code.

Which requires care. Have you verified all the main chipset vendors ?

> I may submit it so that the many others who share my pain will be made

All .. none of them ?

I can do some of these off the top of my head

> drivers/net/8390.h

Needed for some 8390 devices on ISA bus

> drivers/net/de600.c
> drivers/net/de600.h

Uses the parallel port which isnt guaranteed to be full ISA speed.

> drivers/scsi/ppa.h

Parallel port

> drivers/serial/8250.c

Some PC's need delays for certain ops.

> drivers/watchdog/wdt_pci.c

That one is a mistake I believe, I'll dig out the docs.