diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-23 17:02:12 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-23 17:02:12 -0400 |
commit | 475c77edf826333aa61625f49d6a2bec26ecb5a6 (patch) | |
tree | 8e1c6c319e347cd3c649fdb0b3ab45971c6b19e7 /arch/sh | |
parent | 934e18b5cb4531cc6e81865bf54115cfd21d1ac6 (diff) | |
parent | 1488d5158dcd612fcdaf6b642451b026ee8bbcbb (diff) |
Merge branch 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci
Pull PCI changes (including maintainer change) from Jesse Barnes:
"This pull has some good cleanups from Bjorn and Yinghai, as well as
some more code from Yinghai to better handle resource re-allocation
when enabled.
There's also a new initcall_debug feature from Arjan which will print
out quirk timing information to help identify slow quirks for fixing
or refinement (Yinghai sent in a few patches to do just that once the
new debug code landed).
Beyond that, I'm handing off PCI maintainership to Bjorn Helgaas.
He's been a core PCI and Linux contributor for some time now, and has
kindly volunteered to take over. I just don't feel I have the time
for PCI review and work that it deserves lately (I've taken on some
other projects), and haven't been as responsive lately as I'd like, so
I approached Bjorn asking if he'd like to manage things. He's going
to give it a try, and I'm confident he'll do at least as well as I
have in keeping the tree managed, patches flowing, and keeping things
stable."
Fix up some fairly trivial conflicts due to other cleanups (mips device
resource fixup cleanups clashing with list handling cleanup, ppc iseries
removal clashing with pci_probe_only cleanup etc)
* 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci: (112 commits)
PCI: Bjorn gets PCI hotplug too
PCI: hand PCI maintenance over to Bjorn Helgaas
unicore32/PCI: move <asm-generic/pci-bridge.h> include to asm/pci.h
sparc/PCI: convert devtree and arch-probed bus addresses to resource
powerpc/PCI: allow reallocation on PA Semi
powerpc/PCI: convert devtree bus addresses to resource
powerpc/PCI: compute I/O space bus-to-resource offset consistently
arm/PCI: don't export pci_flags
PCI: fix bridge I/O window bus-to-resource conversion
x86/PCI: add spinlock held check to 'pcibios_fwaddrmap_lookup()'
PCI / PCIe: Introduce command line option to disable ARI
PCI: make acpihp use __pci_remove_bus_device instead
PCI: export __pci_remove_bus_device
PCI: Rename pci_remove_behind_bridge to pci_stop_and_remove_behind_bridge
PCI: Rename pci_remove_bus_device to pci_stop_and_remove_bus_device
PCI: print out PCI device info along with duration
PCI: Move "pci reassigndev resource alignment" out of quirks.c
PCI: Use class for quirk for usb host controller fixup
PCI: Use class for quirk for ti816x class fixup
PCI: Use class for quirk for intel e100 interrupt fixup
...
Diffstat (limited to 'arch/sh')
-rw-r--r-- | arch/sh/drivers/pci/pci.c | 75 | ||||
-rw-r--r-- | arch/sh/include/asm/pci.h | 6 |
2 files changed, 11 insertions, 70 deletions
diff --git a/arch/sh/drivers/pci/pci.c b/arch/sh/drivers/pci/pci.c index 1e7b0e2e764d..9d10a3cb8797 100644 --- a/arch/sh/drivers/pci/pci.c +++ b/arch/sh/drivers/pci/pci.c | |||
@@ -37,11 +37,20 @@ static void __devinit pcibios_scanbus(struct pci_channel *hose) | |||
37 | static int next_busno; | 37 | static int next_busno; |
38 | static int need_domain_info; | 38 | static int need_domain_info; |
39 | LIST_HEAD(resources); | 39 | LIST_HEAD(resources); |
40 | struct resource *res; | ||
41 | resource_size_t offset; | ||
40 | int i; | 42 | int i; |
41 | struct pci_bus *bus; | 43 | struct pci_bus *bus; |
42 | 44 | ||
43 | for (i = 0; i < hose->nr_resources; i++) | 45 | for (i = 0; i < hose->nr_resources; i++) { |
44 | pci_add_resource(&resources, hose->resources + i); | 46 | res = hose->resources + i; |
47 | offset = 0; | ||
48 | if (res->flags & IORESOURCE_IO) | ||
49 | offset = hose->io_offset; | ||
50 | else if (res->flags & IORESOURCE_MEM) | ||
51 | offset = hose->mem_offset; | ||
52 | pci_add_resource_offset(&resources, res, offset); | ||
53 | } | ||
45 | 54 | ||
46 | bus = pci_scan_root_bus(NULL, next_busno, hose->pci_ops, hose, | 55 | bus = pci_scan_root_bus(NULL, next_busno, hose->pci_ops, hose, |
47 | &resources); | 56 | &resources); |
@@ -143,42 +152,12 @@ static int __init pcibios_init(void) | |||
143 | } | 152 | } |
144 | subsys_initcall(pcibios_init); | 153 | subsys_initcall(pcibios_init); |
145 | 154 | ||
146 | static void pcibios_fixup_device_resources(struct pci_dev *dev, | ||
147 | struct pci_bus *bus) | ||
148 | { | ||
149 | /* Update device resources. */ | ||
150 | struct pci_channel *hose = bus->sysdata; | ||
151 | unsigned long offset = 0; | ||
152 | int i; | ||
153 | |||
154 | for (i = 0; i < PCI_NUM_RESOURCES; i++) { | ||
155 | if (!dev->resource[i].start) | ||
156 | continue; | ||
157 | if (dev->resource[i].flags & IORESOURCE_IO) | ||
158 | offset = hose->io_offset; | ||
159 | else if (dev->resource[i].flags & IORESOURCE_MEM) | ||
160 | offset = hose->mem_offset; | ||
161 | |||
162 | dev->resource[i].start += offset; | ||
163 | dev->resource[i].end += offset; | ||
164 | } | ||
165 | } | ||
166 | |||
167 | /* | 155 | /* |
168 | * Called after each bus is probed, but before its children | 156 | * Called after each bus is probed, but before its children |
169 | * are examined. | 157 | * are examined. |
170 | */ | 158 | */ |
171 | void __devinit pcibios_fixup_bus(struct pci_bus *bus) | 159 | void __devinit pcibios_fixup_bus(struct pci_bus *bus) |
172 | { | 160 | { |
173 | struct pci_dev *dev; | ||
174 | struct list_head *ln; | ||
175 | |||
176 | for (ln = bus->devices.next; ln != &bus->devices; ln = ln->next) { | ||
177 | dev = pci_dev_b(ln); | ||
178 | |||
179 | if ((dev->class >> 8) != PCI_CLASS_BRIDGE_PCI) | ||
180 | pcibios_fixup_device_resources(dev, bus); | ||
181 | } | ||
182 | } | 161 | } |
183 | 162 | ||
184 | /* | 163 | /* |
@@ -208,36 +187,6 @@ resource_size_t pcibios_align_resource(void *data, const struct resource *res, | |||
208 | return start; | 187 | return start; |
209 | } | 188 | } |
210 | 189 | ||
211 | void pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, | ||
212 | struct resource *res) | ||
213 | { | ||
214 | struct pci_channel *hose = dev->sysdata; | ||
215 | unsigned long offset = 0; | ||
216 | |||
217 | if (res->flags & IORESOURCE_IO) | ||
218 | offset = hose->io_offset; | ||
219 | else if (res->flags & IORESOURCE_MEM) | ||
220 | offset = hose->mem_offset; | ||
221 | |||
222 | region->start = res->start - offset; | ||
223 | region->end = res->end - offset; | ||
224 | } | ||
225 | |||
226 | void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, | ||
227 | struct pci_bus_region *region) | ||
228 | { | ||
229 | struct pci_channel *hose = dev->sysdata; | ||
230 | unsigned long offset = 0; | ||
231 | |||
232 | if (res->flags & IORESOURCE_IO) | ||
233 | offset = hose->io_offset; | ||
234 | else if (res->flags & IORESOURCE_MEM) | ||
235 | offset = hose->mem_offset; | ||
236 | |||
237 | res->start = region->start + offset; | ||
238 | res->end = region->end + offset; | ||
239 | } | ||
240 | |||
241 | int pcibios_enable_device(struct pci_dev *dev, int mask) | 190 | int pcibios_enable_device(struct pci_dev *dev, int mask) |
242 | { | 191 | { |
243 | return pci_enable_resources(dev, mask); | 192 | return pci_enable_resources(dev, mask); |
@@ -381,8 +330,6 @@ EXPORT_SYMBOL(pci_iounmap); | |||
381 | #endif /* CONFIG_GENERIC_IOMAP */ | 330 | #endif /* CONFIG_GENERIC_IOMAP */ |
382 | 331 | ||
383 | #ifdef CONFIG_HOTPLUG | 332 | #ifdef CONFIG_HOTPLUG |
384 | EXPORT_SYMBOL(pcibios_resource_to_bus); | ||
385 | EXPORT_SYMBOL(pcibios_bus_to_resource); | ||
386 | EXPORT_SYMBOL(PCIBIOS_MIN_IO); | 333 | EXPORT_SYMBOL(PCIBIOS_MIN_IO); |
387 | EXPORT_SYMBOL(PCIBIOS_MIN_MEM); | 334 | EXPORT_SYMBOL(PCIBIOS_MIN_MEM); |
388 | #endif | 335 | #endif |
diff --git a/arch/sh/include/asm/pci.h b/arch/sh/include/asm/pci.h index cb21e2399dc1..bff96c2e7d25 100644 --- a/arch/sh/include/asm/pci.h +++ b/arch/sh/include/asm/pci.h | |||
@@ -114,12 +114,6 @@ static inline void pci_dma_burst_advice(struct pci_dev *pdev, | |||
114 | /* Board-specific fixup routines. */ | 114 | /* Board-specific fixup routines. */ |
115 | int pcibios_map_platform_irq(const struct pci_dev *dev, u8 slot, u8 pin); | 115 | int pcibios_map_platform_irq(const struct pci_dev *dev, u8 slot, u8 pin); |
116 | 116 | ||
117 | extern void pcibios_resource_to_bus(struct pci_dev *dev, | ||
118 | struct pci_bus_region *region, struct resource *res); | ||
119 | |||
120 | extern void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, | ||
121 | struct pci_bus_region *region); | ||
122 | |||
123 | #define pci_domain_nr(bus) ((struct pci_channel *)(bus)->sysdata)->index | 117 | #define pci_domain_nr(bus) ((struct pci_channel *)(bus)->sysdata)->index |
124 | 118 | ||
125 | static inline int pci_proc_domain(struct pci_bus *bus) | 119 | static inline int pci_proc_domain(struct pci_bus *bus) |