diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-01-11 21:50:26 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-01-11 21:50:26 -0500 |
commit | 7b67e751479d50b7f84d1a3cc5216eed5e534b66 (patch) | |
tree | a1a6746857cf65f04dde739fe271bf4143d55eaf /arch/sh | |
parent | 9f13a1fd452f11c18004ba2422a6384b424ec8a9 (diff) | |
parent | 76ccc297018d25d55b789bbd508861ef1e2cdb0c (diff) |
Merge branch 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci
* 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci: (80 commits)
x86/PCI: Expand the x86_msi_ops to have a restore MSIs.
PCI: Increase resource array mask bit size in pcim_iomap_regions()
PCI: DEVICE_COUNT_RESOURCE should be equal to PCI_NUM_RESOURCES
PCI: pci_ids: add device ids for STA2X11 device (aka ConneXT)
PNP: work around Dell 1536/1546 BIOS MMCONFIG bug that breaks USB
x86/PCI: amd: factor out MMCONFIG discovery
PCI: Enable ATS at the device state restore
PCI: msi: fix imbalanced refcount of msi irq sysfs objects
PCI: kconfig: English typo in pci/pcie/Kconfig
PCI/PM/Runtime: make PCI traces quieter
PCI: remove pci_create_bus()
xtensa/PCI: convert to pci_scan_root_bus() for correct root bus resources
x86/PCI: convert to pci_create_root_bus() and pci_scan_root_bus()
x86/PCI: use pci_scan_bus() instead of pci_scan_bus_parented()
x86/PCI: read Broadcom CNB20LE host bridge info before PCI scan
sparc32, leon/PCI: convert to pci_scan_root_bus() for correct root bus resources
sparc/PCI: convert to pci_create_root_bus()
sh/PCI: convert to pci_scan_root_bus() for correct root bus resources
powerpc/PCI: convert to pci_create_root_bus()
powerpc/PCI: split PHB part out of pcibios_map_io_space()
...
Fix up conflicts in drivers/pci/msi.c and include/linux/pci_regs.h due
to the same patches being applied in other branches.
Diffstat (limited to 'arch/sh')
-rw-r--r-- | arch/sh/drivers/pci/pci.c | 41 |
1 files changed, 10 insertions, 31 deletions
diff --git a/arch/sh/drivers/pci/pci.c b/arch/sh/drivers/pci/pci.c index 11aaf2fdec84..8f18dd090a66 100644 --- a/arch/sh/drivers/pci/pci.c +++ b/arch/sh/drivers/pci/pci.c | |||
@@ -36,9 +36,15 @@ static void __devinit pcibios_scanbus(struct pci_channel *hose) | |||
36 | { | 36 | { |
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); | ||
40 | int i; | ||
39 | struct pci_bus *bus; | 41 | struct pci_bus *bus; |
40 | 42 | ||
41 | bus = pci_scan_bus(next_busno, hose->pci_ops, hose); | 43 | for (i = 0; i < hose->nr_resources; i++) |
44 | pci_add_resource(&resources, hose->resources + i); | ||
45 | |||
46 | bus = pci_scan_root_bus(NULL, next_busno, hose->pci_ops, hose, | ||
47 | &resources); | ||
42 | hose->bus = bus; | 48 | hose->bus = bus; |
43 | 49 | ||
44 | need_domain_info = need_domain_info || hose->index; | 50 | need_domain_info = need_domain_info || hose->index; |
@@ -55,6 +61,8 @@ static void __devinit pcibios_scanbus(struct pci_channel *hose) | |||
55 | pci_bus_size_bridges(bus); | 61 | pci_bus_size_bridges(bus); |
56 | pci_bus_assign_resources(bus); | 62 | pci_bus_assign_resources(bus); |
57 | pci_enable_bridges(bus); | 63 | pci_enable_bridges(bus); |
64 | } else { | ||
65 | pci_free_resource_list(&resources); | ||
58 | } | 66 | } |
59 | } | 67 | } |
60 | 68 | ||
@@ -162,16 +170,8 @@ static void pcibios_fixup_device_resources(struct pci_dev *dev, | |||
162 | */ | 170 | */ |
163 | void __devinit pcibios_fixup_bus(struct pci_bus *bus) | 171 | void __devinit pcibios_fixup_bus(struct pci_bus *bus) |
164 | { | 172 | { |
165 | struct pci_dev *dev = bus->self; | 173 | struct pci_dev *dev; |
166 | struct list_head *ln; | 174 | struct list_head *ln; |
167 | struct pci_channel *hose = bus->sysdata; | ||
168 | |||
169 | if (!dev) { | ||
170 | int i; | ||
171 | |||
172 | for (i = 0; i < hose->nr_resources; i++) | ||
173 | bus->resource[i] = hose->resources + i; | ||
174 | } | ||
175 | 175 | ||
176 | for (ln = bus->devices.next; ln != &bus->devices; ln = ln->next) { | 176 | for (ln = bus->devices.next; ln != &bus->devices; ln = ln->next) { |
177 | dev = pci_dev_b(ln); | 177 | dev = pci_dev_b(ln); |
@@ -243,27 +243,6 @@ int pcibios_enable_device(struct pci_dev *dev, int mask) | |||
243 | return pci_enable_resources(dev, mask); | 243 | return pci_enable_resources(dev, mask); |
244 | } | 244 | } |
245 | 245 | ||
246 | /* | ||
247 | * If we set up a device for bus mastering, we need to check and set | ||
248 | * the latency timer as it may not be properly set. | ||
249 | */ | ||
250 | static unsigned int pcibios_max_latency = 255; | ||
251 | |||
252 | void pcibios_set_master(struct pci_dev *dev) | ||
253 | { | ||
254 | u8 lat; | ||
255 | pci_read_config_byte(dev, PCI_LATENCY_TIMER, &lat); | ||
256 | if (lat < 16) | ||
257 | lat = (64 <= pcibios_max_latency) ? 64 : pcibios_max_latency; | ||
258 | else if (lat > pcibios_max_latency) | ||
259 | lat = pcibios_max_latency; | ||
260 | else | ||
261 | return; | ||
262 | printk(KERN_INFO "PCI: Setting latency timer of device %s to %d\n", | ||
263 | pci_name(dev), lat); | ||
264 | pci_write_config_byte(dev, PCI_LATENCY_TIMER, lat); | ||
265 | } | ||
266 | |||
267 | void __init pcibios_update_irq(struct pci_dev *dev, int irq) | 246 | void __init pcibios_update_irq(struct pci_dev *dev, int irq) |
268 | { | 247 | { |
269 | pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq); | 248 | pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq); |