]> git.hungrycats.org Git - linux/commit
[PATCH] PCI: fix bug in pci_setup_bridge()
authorIvan Kokshaysky <ink@jurassic.park.msu.ru>
Wed, 29 Oct 2003 07:20:38 +0000 (23:20 -0800)
committerGreg Kroah-Hartman <greg@kroah.com>
Wed, 29 Oct 2003 07:20:38 +0000 (23:20 -0800)
commit530ca2f111d5857a886e1ce6c4f07513f117270c
tree5a29dae4c893e32cd0e8065b4c75a93b939eaf41
parentc303d64b06ad883d1d22ab79c83aa97b7424089b
[PATCH] PCI: fix bug in pci_setup_bridge()

This bug prevents Alphas with older firmware from booting if there
is a card with PCI-PCI bridge that supports 32-bit IO.
This has happened on AS2100 with a quad-tulip card, for example:
 - initially, the I/O window of 21152 bridge was 0x10000-0x10fff,
   as set up by firmware;
 - pci_setup_bridge() is going to change this, say, to 0xa000-0xafff:
   first, it updates PCI_IO_BASE_UPPER16 and PCI_IO_LIMIT_UPPER16
   registers, so that IO window temporarily is at 0x0000-0x0fff,
   which effectively blocks up all legacy IO ports in the lower
   4K range, such as serial, floppy, RTC an so on;
   does debugging printk - machine dies here with recursive
   machine checks as the serial console has gone.

Moving (or disabling) the debugging printk is not a solution -
there is possibility that timer interrupt (which might access RTC
ports) occurs between writes to lower and upper parts of the
base/limit registers.

The patch temporarily disables the IO window of the bridge by
setting PCI_IO_BASE_UPPER16 > PCI_IO_LIMIT_UPPER16 before doing
an update. It's safe, as we don't have any active IO behind
the bridge at this point. Also, it's a NOP for bridges with
16-bit-only IO.
Similar (but simpler, as we always clear upper 32 bits) fix
for 64-bit prefetchable MMIO range.
drivers/pci/setup-bus.c