linux/drivers/pci
Yoichi Yuasa fd6e732186 PCI: fix IDE legacy mode resources
I got the following error on MIPS Cobalt.

PCI: Unable to reserve I/O region #1:8@f00001f0 for device 0000:00:09.1
pata_via 0000:00:09.1: failed to request/iomap BARs for port 0 (errno=-16)
PCI: Unable to reserve I/O region #3:8@f0000170 for device 0000:00:09.1
pata_via 0000:00:09.1: failed to request/iomap BARs for port 1 (errno=-16)
pata_via 0000:00:09.1: no available native port

The legacy mode IDE resources set the following order.

pci_setup_device()
    Legacy mode ATA controllers have fixed addresses.
    IDE resources: 0x1F0-0x1F7, 0x3F6, 0x170-0x177, 0x376
    |
    V
pcibios_fixup_bus()
    MIPS Cobalt PCI bus regions have the -0x10000000 offset from PCI resources.
    pcibios_fixup_bus() fix PCI bus regions.
    0x1F0 - 0x10000000 = 0xF00001F0
    |
    V
ata_pci_init_one()
    PCI: Unable to reserve I/O region #1:8@f00001f0 for device 0000:00:09.1

In some architectures, PCI bus regions have the offset from PCI resources. 
For this reason, pci_setup_device() should set PCI bus regions to
dev->resource[].

[akpm@linux-foundation.org: use struct initialiser]
Signed-off-by: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Greg KH <greg@kroah.com>
Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2007-10-12 15:03:17 -07:00
..
hotplug cpqphp: Use PCI_CLASS_REVISION instead of PCI_REVISION_ID for read 2007-10-12 15:03:16 -07:00
pcie pciehp: remove CONFIG_HOTPLUG_PCI_PCIE_POLL_EVENT_MODE 2007-10-12 15:03:14 -07:00
.gitignore
access.c [PATCH] severing module.h->sched.h 2006-12-04 02:00:22 -05:00
bus.c pci: do not mark exported functions as __devinit 2007-05-02 19:02:35 -07:00
hotplug.c [PATCH] driver core: replace "hotplug" by "uevent" 2006-01-04 16:18:08 -08:00
htirq.c PCI: Use pci_find_ht_capability() in drivers/pci/htirq.c 2006-12-20 10:54:42 -08:00
Kconfig PCI: remove the broken PCI_MULTITHREAD_PROBE option 2007-05-02 19:02:38 -07:00
Makefile PCI: Only build PCI syscalls on architectures that want them 2007-07-11 16:02:13 -07:00
msi.c MSI: Use correct data offset for 32-bit MSI in read_msi_msg() 2007-10-12 15:03:17 -07:00
msi.h PCI: Make some MSI-X #defines generic 2006-12-01 14:36:56 -08:00
pci-acpi.c ACPI: restore CONFIG_ACPI_SLEEP 2007-07-29 16:53:59 -07:00
pci-driver.c PCI: Fix incorrect argument order to list_add_tail() in PCI dynamic ID code 2007-10-12 15:03:17 -07:00
pci-sysfs.c Remove capability.h from mm.h 2007-07-16 09:05:45 -07:00
pci.c PCI: is_power_of_2 in drivers/pci/pci.c 2007-10-12 15:03:15 -07:00
pci.h PCI: Move prototypes for pci_bus_find_capability to include/linux/pci.h 2007-08-22 14:48:40 -07:00
probe.c PCI: fix IDE legacy mode resources 2007-10-12 15:03:17 -07:00
proc.c Remove capability.h from mm.h 2007-07-16 09:05:45 -07:00
quirks.c PCI: re-enable onboard sound on "MSI K8T Neo2-FIR" 2007-10-12 15:03:16 -07:00
remove.c PCI: add pci_stop_bus_device 2006-09-26 17:43:54 -07:00
rom.c [IA64] SN: Correct ROM resource length for BIOS copy 2007-07-09 13:37:18 -07:00
search.c use no_pci_devices() in pci/search.c 2007-07-16 09:05:41 -07:00
setup-bus.c PCI: ROUND_UP macro cleanup in drivers/pci 2007-07-11 16:02:11 -07:00
setup-irq.c PCI: PCI devices get assigned redundant IRQs 2007-02-16 15:30:10 -08:00
setup-res.c pci: do not mark exported functions as __devinit 2007-05-02 19:02:35 -07:00
syscall.c pci syscall.c: Switch to refcounting API 2007-07-11 16:02:07 -07:00