diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2006-12-19 16:12:08 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-12-20 13:54:43 -0500 |
commit | fb0f2b40faff41f03acaa2ee6e6231fc96ca497c (patch) | |
tree | 10f2f69cb43d6440313bb3efdc53ca69334830c0 /drivers/pci/probe.c | |
parent | 7e7a43c32a8970ea2bfc3d1af353dcb1a9237769 (diff) |
PCI legacy resource fix
Since commit 368c73d4f689dae0807d0a2aa74c61fd2b9b075f the kernel will try
to update the non-writeable BAR registers 0..3 of PIIX4 IDE adapters if
pci_assign_unassigned_resources() is used to do full resource assignment of
the bus. This fails because in the PIIX4 these BAR registers have
implicitly assumed values and read back as zero; it used to work because
the kernel used to just write zero to that register the read back value did
match what was written.
The fix is a new resource flag IORESOURCE_PCI_FIXED used to mark a resource
as non-movable. This will also be useful to keep other import system
resources from being moved around - for example system consoles on PCI
busses.
[akpm@osdl.org: cleanup]
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Acked-by: Alan Cox <alan@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/pci/probe.c')
-rw-r--r-- | drivers/pci/probe.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index 6a3c1e728900..1ae9c3f50ffa 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c | |||
@@ -649,6 +649,9 @@ static void pci_read_irq(struct pci_dev *dev) | |||
649 | * Returns 0 on success and -1 if unknown type of device (not normal, bridge | 649 | * Returns 0 on success and -1 if unknown type of device (not normal, bridge |
650 | * or CardBus). | 650 | * or CardBus). |
651 | */ | 651 | */ |
652 | |||
653 | #define LEGACY_IO_RESOURCE (IORESOURCE_IO | IORESOURCE_PCI_FIXED) | ||
654 | |||
652 | static int pci_setup_device(struct pci_dev * dev) | 655 | static int pci_setup_device(struct pci_dev * dev) |
653 | { | 656 | { |
654 | u32 class; | 657 | u32 class; |
@@ -692,18 +695,18 @@ static int pci_setup_device(struct pci_dev * dev) | |||
692 | if ((progif & 1) == 0) { | 695 | if ((progif & 1) == 0) { |
693 | dev->resource[0].start = 0x1F0; | 696 | dev->resource[0].start = 0x1F0; |
694 | dev->resource[0].end = 0x1F7; | 697 | dev->resource[0].end = 0x1F7; |
695 | dev->resource[0].flags = IORESOURCE_IO; | 698 | dev->resource[0].flags = LEGACY_IO_RESOURCE; |
696 | dev->resource[1].start = 0x3F6; | 699 | dev->resource[1].start = 0x3F6; |
697 | dev->resource[1].end = 0x3F6; | 700 | dev->resource[1].end = 0x3F6; |
698 | dev->resource[1].flags = IORESOURCE_IO; | 701 | dev->resource[1].flags = LEGACY_IO_RESOURCE; |
699 | } | 702 | } |
700 | if ((progif & 4) == 0) { | 703 | if ((progif & 4) == 0) { |
701 | dev->resource[2].start = 0x170; | 704 | dev->resource[2].start = 0x170; |
702 | dev->resource[2].end = 0x177; | 705 | dev->resource[2].end = 0x177; |
703 | dev->resource[2].flags = IORESOURCE_IO; | 706 | dev->resource[2].flags = LEGACY_IO_RESOURCE; |
704 | dev->resource[3].start = 0x376; | 707 | dev->resource[3].start = 0x376; |
705 | dev->resource[3].end = 0x376; | 708 | dev->resource[3].end = 0x376; |
706 | dev->resource[3].flags = IORESOURCE_IO; | 709 | dev->resource[3].flags = LEGACY_IO_RESOURCE; |
707 | } | 710 | } |
708 | } | 711 | } |
709 | break; | 712 | break; |