diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2008-02-14 17:56:56 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-04-21 00:47:00 -0400 |
commit | 6355f3d1c6994812e4384027b785989323dd7c75 (patch) | |
tree | cf66912047bda3a8fbe2740d930c474cdd47a3a2 /arch | |
parent | 8a1bc9013a03d41a0e36ee413bb6f97281b30bd1 (diff) |
PCI: remove pcibios_fixup_ghosts()
This function was obviously never being used since early 2.5 days as any
device that it would try to remove would never really be removed from
the system due to the PCI device list being held in the driver core, not
the general list of PCI devices.
As we have not had a single report of a problem here in 4 years, I think
it's safe to remove now.
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/frv/mb93090-mb00/pci-vdk.c | 53 | ||||
-rw-r--r-- | arch/x86/pci/common.c | 54 |
2 files changed, 0 insertions, 107 deletions
diff --git a/arch/frv/mb93090-mb00/pci-vdk.c b/arch/frv/mb93090-mb00/pci-vdk.c index 6d51f133fb23..f003cfa68b7a 100644 --- a/arch/frv/mb93090-mb00/pci-vdk.c +++ b/arch/frv/mb93090-mb00/pci-vdk.c | |||
@@ -199,58 +199,6 @@ static struct pci_ops * __init pci_check_direct(void) | |||
199 | } | 199 | } |
200 | 200 | ||
201 | /* | 201 | /* |
202 | * Several buggy motherboards address only 16 devices and mirror | ||
203 | * them to next 16 IDs. We try to detect this `feature' on all | ||
204 | * primary buses (those containing host bridges as they are | ||
205 | * expected to be unique) and remove the ghost devices. | ||
206 | */ | ||
207 | |||
208 | static void __init pcibios_fixup_ghosts(struct pci_bus *b) | ||
209 | { | ||
210 | struct list_head *ln, *mn; | ||
211 | struct pci_dev *d, *e; | ||
212 | int mirror = PCI_DEVFN(16,0); | ||
213 | int seen_host_bridge = 0; | ||
214 | int i; | ||
215 | |||
216 | for (ln=b->devices.next; ln != &b->devices; ln=ln->next) { | ||
217 | d = pci_dev_b(ln); | ||
218 | if ((d->class >> 8) == PCI_CLASS_BRIDGE_HOST) | ||
219 | seen_host_bridge++; | ||
220 | for (mn=ln->next; mn != &b->devices; mn=mn->next) { | ||
221 | e = pci_dev_b(mn); | ||
222 | if (e->devfn != d->devfn + mirror || | ||
223 | e->vendor != d->vendor || | ||
224 | e->device != d->device || | ||
225 | e->class != d->class) | ||
226 | continue; | ||
227 | for(i=0; i<PCI_NUM_RESOURCES; i++) | ||
228 | if (e->resource[i].start != d->resource[i].start || | ||
229 | e->resource[i].end != d->resource[i].end || | ||
230 | e->resource[i].flags != d->resource[i].flags) | ||
231 | continue; | ||
232 | break; | ||
233 | } | ||
234 | if (mn == &b->devices) | ||
235 | return; | ||
236 | } | ||
237 | if (!seen_host_bridge) | ||
238 | return; | ||
239 | printk("PCI: Ignoring ghost devices on bus %02x\n", b->number); | ||
240 | |||
241 | ln = &b->devices; | ||
242 | while (ln->next != &b->devices) { | ||
243 | d = pci_dev_b(ln->next); | ||
244 | if (d->devfn >= mirror) { | ||
245 | list_del(&d->global_list); | ||
246 | list_del(&d->bus_list); | ||
247 | kfree(d); | ||
248 | } else | ||
249 | ln = ln->next; | ||
250 | } | ||
251 | } | ||
252 | |||
253 | /* | ||
254 | * Discover remaining PCI buses in case there are peer host bridges. | 202 | * Discover remaining PCI buses in case there are peer host bridges. |
255 | * We use the number of last PCI bus provided by the PCI BIOS. | 203 | * We use the number of last PCI bus provided by the PCI BIOS. |
256 | */ | 204 | */ |
@@ -356,7 +304,6 @@ void __init pcibios_fixup_bus(struct pci_bus *bus) | |||
356 | #if 0 | 304 | #if 0 |
357 | printk("### PCIBIOS_FIXUP_BUS(%d)\n",bus->number); | 305 | printk("### PCIBIOS_FIXUP_BUS(%d)\n",bus->number); |
358 | #endif | 306 | #endif |
359 | pcibios_fixup_ghosts(bus); | ||
360 | pci_read_bridge_bases(bus); | 307 | pci_read_bridge_bases(bus); |
361 | 308 | ||
362 | if (bus->number == 0) { | 309 | if (bus->number == 0) { |
diff --git a/arch/x86/pci/common.c b/arch/x86/pci/common.c index c9ff4ff66739..900e1a78c3e4 100644 --- a/arch/x86/pci/common.c +++ b/arch/x86/pci/common.c | |||
@@ -77,59 +77,6 @@ int pcibios_scanned; | |||
77 | */ | 77 | */ |
78 | DEFINE_SPINLOCK(pci_config_lock); | 78 | DEFINE_SPINLOCK(pci_config_lock); |
79 | 79 | ||
80 | /* | ||
81 | * Several buggy motherboards address only 16 devices and mirror | ||
82 | * them to next 16 IDs. We try to detect this `feature' on all | ||
83 | * primary buses (those containing host bridges as they are | ||
84 | * expected to be unique) and remove the ghost devices. | ||
85 | */ | ||
86 | |||
87 | static void __devinit pcibios_fixup_ghosts(struct pci_bus *b) | ||
88 | { | ||
89 | struct list_head *ln, *mn; | ||
90 | struct pci_dev *d, *e; | ||
91 | int mirror = PCI_DEVFN(16,0); | ||
92 | int seen_host_bridge = 0; | ||
93 | int i; | ||
94 | |||
95 | DBG("PCI: Scanning for ghost devices on bus %d\n", b->number); | ||
96 | list_for_each(ln, &b->devices) { | ||
97 | d = pci_dev_b(ln); | ||
98 | if ((d->class >> 8) == PCI_CLASS_BRIDGE_HOST) | ||
99 | seen_host_bridge++; | ||
100 | for (mn=ln->next; mn != &b->devices; mn=mn->next) { | ||
101 | e = pci_dev_b(mn); | ||
102 | if (e->devfn != d->devfn + mirror || | ||
103 | e->vendor != d->vendor || | ||
104 | e->device != d->device || | ||
105 | e->class != d->class) | ||
106 | continue; | ||
107 | for(i=0; i<PCI_NUM_RESOURCES; i++) | ||
108 | if (e->resource[i].start != d->resource[i].start || | ||
109 | e->resource[i].end != d->resource[i].end || | ||
110 | e->resource[i].flags != d->resource[i].flags) | ||
111 | continue; | ||
112 | break; | ||
113 | } | ||
114 | if (mn == &b->devices) | ||
115 | return; | ||
116 | } | ||
117 | if (!seen_host_bridge) | ||
118 | return; | ||
119 | printk(KERN_WARNING "PCI: Ignoring ghost devices on bus %02x\n", b->number); | ||
120 | |||
121 | ln = &b->devices; | ||
122 | while (ln->next != &b->devices) { | ||
123 | d = pci_dev_b(ln->next); | ||
124 | if (d->devfn >= mirror) { | ||
125 | list_del(&d->global_list); | ||
126 | list_del(&d->bus_list); | ||
127 | kfree(d); | ||
128 | } else | ||
129 | ln = ln->next; | ||
130 | } | ||
131 | } | ||
132 | |||
133 | static void __devinit pcibios_fixup_device_resources(struct pci_dev *dev) | 80 | static void __devinit pcibios_fixup_device_resources(struct pci_dev *dev) |
134 | { | 81 | { |
135 | struct resource *rom_r = &dev->resource[PCI_ROM_RESOURCE]; | 82 | struct resource *rom_r = &dev->resource[PCI_ROM_RESOURCE]; |
@@ -152,7 +99,6 @@ void __devinit pcibios_fixup_bus(struct pci_bus *b) | |||
152 | { | 99 | { |
153 | struct pci_dev *dev; | 100 | struct pci_dev *dev; |
154 | 101 | ||
155 | pcibios_fixup_ghosts(b); | ||
156 | pci_read_bridge_bases(b); | 102 | pci_read_bridge_bases(b); |
157 | list_for_each_entry(dev, &b->devices, bus_list) | 103 | list_for_each_entry(dev, &b->devices, bus_list) |
158 | pcibios_fixup_device_resources(dev); | 104 | pcibios_fixup_device_resources(dev); |