diff options
author | Jesse Barnes <jbarnes@hobbes.lan> | 2008-07-16 19:21:47 -0400 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2008-07-16 19:21:47 -0400 |
commit | 58b6e5538460be358fdf1286d9a2fbcfcc2cfaba (patch) | |
tree | 58bd7f466a55905ad7a03a714b55d8da6ed81447 /arch/x86 | |
parent | 9fce1bc956c21dfe0f46be028f18c4d5057f2bd7 (diff) |
Revert "x86/PCI: ACPI based PCI gap calculation"
This reverts commit 809d9a8f93bd8504dcc34b16bbfdfd1a8c9bb1ed.
This one isn't quite ready for prime time. It needs more testing and
additional feedback from the ACPI guys.
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/pci/acpi.c | 80 |
1 files changed, 0 insertions, 80 deletions
diff --git a/arch/x86/pci/acpi.c b/arch/x86/pci/acpi.c index d1ffb5709174..d95de2f199cd 100644 --- a/arch/x86/pci/acpi.c +++ b/arch/x86/pci/acpi.c | |||
@@ -4,7 +4,6 @@ | |||
4 | #include <linux/irq.h> | 4 | #include <linux/irq.h> |
5 | #include <linux/dmi.h> | 5 | #include <linux/dmi.h> |
6 | #include <asm/numa.h> | 6 | #include <asm/numa.h> |
7 | #include <asm/e820.h> | ||
8 | #include "pci.h" | 7 | #include "pci.h" |
9 | 8 | ||
10 | struct pci_root_info { | 9 | struct pci_root_info { |
@@ -15,11 +14,6 @@ struct pci_root_info { | |||
15 | int busnum; | 14 | int busnum; |
16 | }; | 15 | }; |
17 | 16 | ||
18 | struct gap_info { | ||
19 | unsigned long gapstart; | ||
20 | unsigned long gapsize; | ||
21 | }; | ||
22 | |||
23 | static acpi_status | 17 | static acpi_status |
24 | resource_to_addr(struct acpi_resource *resource, | 18 | resource_to_addr(struct acpi_resource *resource, |
25 | struct acpi_resource_address64 *addr) | 19 | struct acpi_resource_address64 *addr) |
@@ -116,78 +110,6 @@ adjust_transparent_bridge_resources(struct pci_bus *bus) | |||
116 | } | 110 | } |
117 | } | 111 | } |
118 | 112 | ||
119 | static acpi_status search_gap(struct acpi_resource *resource, void *data) | ||
120 | { | ||
121 | struct acpi_resource_address64 addr; | ||
122 | acpi_status status; | ||
123 | struct gap_info *gap = data; | ||
124 | unsigned long long start_addr, end_addr; | ||
125 | |||
126 | status = resource_to_addr(resource, &addr); | ||
127 | if (ACPI_SUCCESS(status) && | ||
128 | addr.resource_type == ACPI_MEMORY_RANGE && | ||
129 | addr.address_length > gap->gapsize) { | ||
130 | start_addr = addr.minimum + addr.translation_offset; | ||
131 | /* | ||
132 | * We want space only in the 32bit address range | ||
133 | */ | ||
134 | if (start_addr < UINT_MAX) { | ||
135 | end_addr = start_addr + addr.address_length; | ||
136 | e820_search_gap(&gap->gapstart, &gap->gapsize, | ||
137 | start_addr, end_addr); | ||
138 | } | ||
139 | } | ||
140 | |||
141 | return AE_OK; | ||
142 | } | ||
143 | |||
144 | /* | ||
145 | * Search for a hole in the 32 bit address space for PCI to assign MMIO | ||
146 | * resources, for hotplug or unconfigured resources. | ||
147 | * We query the CRS object of the PCI root device to look for possible producer | ||
148 | * resources in the tree and consider these while calulating the start address | ||
149 | * for this hole. | ||
150 | */ | ||
151 | static void pci_setup_gap(acpi_handle *handle) | ||
152 | { | ||
153 | struct gap_info gap; | ||
154 | acpi_status status; | ||
155 | |||
156 | gap.gapstart = 0; | ||
157 | gap.gapsize = 0x400000; | ||
158 | |||
159 | status = acpi_walk_resources(handle, METHOD_NAME__CRS, | ||
160 | search_gap, &gap); | ||
161 | |||
162 | if (ACPI_SUCCESS(status)) { | ||
163 | unsigned long round; | ||
164 | |||
165 | if (!gap.gapstart) { | ||
166 | printk(KERN_ERR "ACPI: Warning: Cannot find a gap " | ||
167 | "in the 32bit address range for PCI\n" | ||
168 | "ACPI: PCI devices may collide with " | ||
169 | "hotpluggable memory address range\n"); | ||
170 | } | ||
171 | /* | ||
172 | * Round the gapstart, uses the same logic as in | ||
173 | * e820_gap_setup | ||
174 | */ | ||
175 | round = 0x100000; | ||
176 | while ((gap.gapsize >> 4) > round) | ||
177 | round += round; | ||
178 | /* Fun with two's complement */ | ||
179 | pci_mem_start = (gap.gapstart + round) & -round; | ||
180 | |||
181 | printk(KERN_INFO "ACPI: PCI resources should " | ||
182 | "start at %lx (gap: %lx:%lx)\n", | ||
183 | pci_mem_start, gap.gapstart, gap.gapsize); | ||
184 | } else { | ||
185 | printk(KERN_ERR "ACPI: Error while searching for gap in " | ||
186 | "the 32bit address range for PCI\n"); | ||
187 | } | ||
188 | } | ||
189 | |||
190 | |||
191 | static void | 113 | static void |
192 | get_current_resources(struct acpi_device *device, int busnum, | 114 | get_current_resources(struct acpi_device *device, int busnum, |
193 | int domain, struct pci_bus *bus) | 115 | int domain, struct pci_bus *bus) |
@@ -293,8 +215,6 @@ struct pci_bus * __devinit pci_acpi_scan_root(struct acpi_device *device, int do | |||
293 | 215 | ||
294 | if (bus && (pci_probe & PCI_USE__CRS)) | 216 | if (bus && (pci_probe & PCI_USE__CRS)) |
295 | get_current_resources(device, busnum, domain, bus); | 217 | get_current_resources(device, busnum, domain, bus); |
296 | |||
297 | pci_setup_gap(device->handle); | ||
298 | return bus; | 218 | return bus; |
299 | } | 219 | } |
300 | 220 | ||