Skip to content

Commit 7b67e75

Browse files
committed
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.
2 parents 9f13a1f + 76ccc29 commit 7b67e75

91 files changed

Lines changed: 1125 additions & 806 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Documentation/feature-removal-schedule.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -544,3 +544,15 @@ When: 3.5
544544
Why: The iwlagn module has been renamed iwlwifi. The alias will be around
545545
for backward compatibility for several cycles and then dropped.
546546
Who: Don Fry <donald.h.fry@intel.com>
547+
548+
----------------------------
549+
550+
What: pci_scan_bus_parented()
551+
When: 3.5
552+
Why: The pci_scan_bus_parented() interface creates a new root bus. The
553+
bus is created with default resources (ioport_resource and
554+
iomem_resource) that are always wrong, so we rely on arch code to
555+
correct them later. Callers of pci_scan_bus_parented() should
556+
convert to using pci_scan_root_bus() so they can supply a list of
557+
bus resources when the bus is created.
558+
Who: Bjorn Helgaas <bhelgaas@google.com>

arch/alpha/kernel/pci.c

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -281,27 +281,9 @@ pcibios_fixup_device_resources(struct pci_dev *dev, struct pci_bus *bus)
281281
void __devinit
282282
pcibios_fixup_bus(struct pci_bus *bus)
283283
{
284-
/* Propagate hose info into the subordinate devices. */
285-
286-
struct pci_controller *hose = bus->sysdata;
287284
struct pci_dev *dev = bus->self;
288285

289-
if (!dev) {
290-
/* Root bus. */
291-
u32 pci_mem_end;
292-
u32 sg_base = hose->sg_pci ? hose->sg_pci->dma_base : ~0;
293-
unsigned long end;
294-
295-
bus->resource[0] = hose->io_space;
296-
bus->resource[1] = hose->mem_space;
297-
298-
/* Adjust hose mem_space limit to prevent PCI allocations
299-
in the iommu windows. */
300-
pci_mem_end = min((u32)__direct_map_base, sg_base) - 1;
301-
end = hose->mem_space->start + pci_mem_end;
302-
if (hose->mem_space->end > end)
303-
hose->mem_space->end = end;
304-
} else if (pci_probe_only &&
286+
if (pci_probe_only && dev &&
305287
(dev->class >> 8) == PCI_CLASS_BRIDGE_PCI) {
306288
pci_read_bridge_bases(bus);
307289
pcibios_fixup_device_resources(dev, bus);
@@ -414,13 +396,31 @@ void __init
414396
common_init_pci(void)
415397
{
416398
struct pci_controller *hose;
399+
struct list_head resources;
417400
struct pci_bus *bus;
418401
int next_busno;
419402
int need_domain_info = 0;
403+
u32 pci_mem_end;
404+
u32 sg_base;
405+
unsigned long end;
420406

421407
/* Scan all of the recorded PCI controllers. */
422408
for (next_busno = 0, hose = hose_head; hose; hose = hose->next) {
423-
bus = pci_scan_bus(next_busno, alpha_mv.pci_ops, hose);
409+
sg_base = hose->sg_pci ? hose->sg_pci->dma_base : ~0;
410+
411+
/* Adjust hose mem_space limit to prevent PCI allocations
412+
in the iommu windows. */
413+
pci_mem_end = min((u32)__direct_map_base, sg_base) - 1;
414+
end = hose->mem_space->start + pci_mem_end;
415+
if (hose->mem_space->end > end)
416+
hose->mem_space->end = end;
417+
418+
INIT_LIST_HEAD(&resources);
419+
pci_add_resource(&resources, hose->io_space);
420+
pci_add_resource(&resources, hose->mem_space);
421+
422+
bus = pci_scan_root_bus(NULL, next_busno, alpha_mv.pci_ops,
423+
hose, &resources);
424424
hose->bus = bus;
425425
hose->need_domain_info = need_domain_info;
426426
next_busno = bus->subordinate + 1;

arch/arm/common/it8152.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -299,8 +299,8 @@ int __init it8152_pci_setup(int nr, struct pci_sys_data *sys)
299299
goto err1;
300300
}
301301

302-
sys->resource[0] = &it8152_io;
303-
sys->resource[1] = &it8152_mem;
302+
pci_add_resource(&sys->resources, &it8152_io);
303+
pci_add_resource(&sys->resources, &it8152_mem);
304304

305305
if (platform_notify || platform_notify_remove) {
306306
printk(KERN_ERR "PCI: Can't use platform_notify\n");
@@ -327,6 +327,9 @@ int __init it8152_pci_setup(int nr, struct pci_sys_data *sys)
327327
*/
328328
unsigned int pcibios_max_latency = 255;
329329

330+
/* ITE bridge requires setting latency timer to avoid early bus access
331+
termination by PCI bus master devices
332+
*/
330333
void pcibios_set_master(struct pci_dev *dev)
331334
{
332335
u8 lat;
@@ -352,7 +355,7 @@ void pcibios_set_master(struct pci_dev *dev)
352355

353356
struct pci_bus * __init it8152_pci_scan_bus(int nr, struct pci_sys_data *sys)
354357
{
355-
return pci_scan_bus(nr, &it8152_ops, sys);
358+
return pci_scan_root_bus(NULL, nr, &it8152_ops, sys, &sys->resources);
356359
}
357360

358361
EXPORT_SYMBOL(dma_set_coherent_mask);

arch/arm/common/via82c505.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ int __init via82c505_setup(int nr, struct pci_sys_data *sys)
8686
struct pci_bus * __init via82c505_scan_bus(int nr, struct pci_sys_data *sysdata)
8787
{
8888
if (nr == 0)
89-
return pci_scan_bus(0, &via82c505_ops, sysdata);
89+
return pci_scan_root_bus(NULL, 0, &via82c505_ops, sysdata,
90+
&sysdata->resources);
9091

9192
return NULL;
9293
}

arch/arm/include/asm/mach/pci.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ struct pci_sys_data {
4040
u64 mem_offset; /* bus->cpu memory mapping offset */
4141
unsigned long io_offset; /* bus->cpu IO mapping offset */
4242
struct pci_bus *bus; /* PCI bus */
43-
struct resource *resource[3]; /* Primary PCI bus resources */
43+
struct list_head resources; /* root bus resources (apertures) */
4444
/* Bridge swizzling */
4545
u8 (*swizzle)(struct pci_dev *, u8 *);
4646
/* IRQ mapping */

arch/arm/include/asm/pci.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,6 @@ static inline int pci_proc_domain(struct pci_bus *bus)
3131
}
3232
#endif /* CONFIG_PCI_DOMAINS */
3333

34-
#ifdef CONFIG_PCI_HOST_ITE8152
35-
/* ITE bridge requires setting latency timer to avoid early bus access
36-
termination by PIC bus mater devices
37-
*/
38-
extern void pcibios_set_master(struct pci_dev *dev);
39-
#else
40-
static inline void pcibios_set_master(struct pci_dev *dev)
41-
{
42-
/* No special bus mastering setup handling */
43-
}
44-
#endif
45-
4634
static inline void pcibios_penalize_isa_irq(int irq, int active)
4735
{
4836
/* We don't do dynamic PCI IRQ allocation */

arch/arm/kernel/bios32.c

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -316,21 +316,6 @@ pdev_fixup_device_resources(struct pci_sys_data *root, struct pci_dev *dev)
316316
}
317317
}
318318

319-
static void __devinit
320-
pbus_assign_bus_resources(struct pci_bus *bus, struct pci_sys_data *root)
321-
{
322-
struct pci_dev *dev = bus->self;
323-
int i;
324-
325-
if (!dev) {
326-
/*
327-
* Assign root bus resources.
328-
*/
329-
for (i = 0; i < 3; i++)
330-
bus->resource[i] = root->resource[i];
331-
}
332-
}
333-
334319
/*
335320
* pcibios_fixup_bus - Called after each bus is probed,
336321
* but before its children are examined.
@@ -341,8 +326,6 @@ void pcibios_fixup_bus(struct pci_bus *bus)
341326
struct pci_dev *dev;
342327
u16 features = PCI_COMMAND_SERR | PCI_COMMAND_PARITY | PCI_COMMAND_FAST_BACK;
343328

344-
pbus_assign_bus_resources(bus, root);
345-
346329
/*
347330
* Walk the devices on this bus, working out what we can
348331
* and can't support.
@@ -508,12 +491,18 @@ static void __init pcibios_init_hw(struct hw_pci *hw)
508491
sys->busnr = busnr;
509492
sys->swizzle = hw->swizzle;
510493
sys->map_irq = hw->map_irq;
511-
sys->resource[0] = &ioport_resource;
512-
sys->resource[1] = &iomem_resource;
494+
INIT_LIST_HEAD(&sys->resources);
513495

514496
ret = hw->setup(nr, sys);
515497

516498
if (ret > 0) {
499+
if (list_empty(&sys->resources)) {
500+
pci_add_resource(&sys->resources,
501+
&ioport_resource);
502+
pci_add_resource(&sys->resources,
503+
&iomem_resource);
504+
}
505+
517506
sys->bus = hw->scan(nr, sys);
518507

519508
if (!sys->bus)
@@ -571,6 +560,13 @@ void __init pci_common_init(struct hw_pci *hw)
571560
}
572561
}
573562

563+
#ifndef CONFIG_PCI_HOST_ITE8152
564+
void pcibios_set_master(struct pci_dev *dev)
565+
{
566+
/* No special bus mastering setup handling */
567+
}
568+
#endif
569+
574570
char * __init pcibios_setup(char *str)
575571
{
576572
if (!strcmp(str, "debug")) {

arch/arm/mach-cns3xxx/pcie.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,13 +151,12 @@ static int cns3xxx_pci_setup(int nr, struct pci_sys_data *sys)
151151
struct cns3xxx_pcie *cnspci = sysdata_to_cnspci(sys);
152152
struct resource *res_io = &cnspci->res_io;
153153
struct resource *res_mem = &cnspci->res_mem;
154-
struct resource **sysres = sys->resource;
155154

156155
BUG_ON(request_resource(&iomem_resource, res_io) ||
157156
request_resource(&iomem_resource, res_mem));
158157

159-
sysres[0] = res_io;
160-
sysres[1] = res_mem;
158+
pci_add_resource(&sys->resources, res_io);
159+
pci_add_resource(&sys->resources, res_mem);
161160

162161
return 1;
163162
}
@@ -169,7 +168,8 @@ static struct pci_ops cns3xxx_pcie_ops = {
169168

170169
static struct pci_bus *cns3xxx_pci_scan_bus(int nr, struct pci_sys_data *sys)
171170
{
172-
return pci_scan_bus(sys->busnr, &cns3xxx_pcie_ops, sys);
171+
return pci_scan_root_bus(NULL, sys->busnr, &cns3xxx_pcie_ops, sys,
172+
&sys->resources);
173173
}
174174

175175
static int cns3xxx_pcie_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)

arch/arm/mach-dove/pcie.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ static int __init dove_pcie_setup(int nr, struct pci_sys_data *sys)
6969
pp->res[0].flags = IORESOURCE_IO;
7070
if (request_resource(&ioport_resource, &pp->res[0]))
7171
panic("Request PCIe IO resource failed\n");
72-
sys->resource[0] = &pp->res[0];
72+
pci_add_resource(&sys->resources, &pp->res[0]);
7373

7474
/*
7575
* IORESOURCE_MEM
@@ -88,9 +88,7 @@ static int __init dove_pcie_setup(int nr, struct pci_sys_data *sys)
8888
pp->res[1].flags = IORESOURCE_MEM;
8989
if (request_resource(&iomem_resource, &pp->res[1]))
9090
panic("Request PCIe Memory resource failed\n");
91-
sys->resource[1] = &pp->res[1];
92-
93-
sys->resource[2] = NULL;
91+
pci_add_resource(&sys->resources, &pp->res[1]);
9492

9593
return 1;
9694
}
@@ -184,7 +182,8 @@ dove_pcie_scan_bus(int nr, struct pci_sys_data *sys)
184182
struct pci_bus *bus;
185183

186184
if (nr < num_pcie_ports) {
187-
bus = pci_scan_bus(sys->busnr, &pcie_ops, sys);
185+
bus = pci_scan_root_bus(NULL, sys->busnr, &pcie_ops, sys,
186+
&sys->resources);
188187
} else {
189188
bus = NULL;
190189
BUG();

arch/arm/mach-footbridge/dc21285.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -275,17 +275,17 @@ int __init dc21285_setup(int nr, struct pci_sys_data *sys)
275275
allocate_resource(&iomem_resource, &res[0], 0x40000000,
276276
0x80000000, 0xffffffff, 0x40000000, NULL, NULL);
277277

278-
sys->resource[0] = &ioport_resource;
279-
sys->resource[1] = &res[0];
280-
sys->resource[2] = &res[1];
278+
pci_add_resource(&sys->resources, &ioport_resource);
279+
pci_add_resource(&sys->resources, &res[0]);
280+
pci_add_resource(&sys->resources, &res[1]);
281281
sys->mem_offset = DC21285_PCI_MEM;
282282

283283
return 1;
284284
}
285285

286286
struct pci_bus * __init dc21285_scan_bus(int nr, struct pci_sys_data *sys)
287287
{
288-
return pci_scan_bus(0, &dc21285_ops, sys);
288+
return pci_scan_root_bus(NULL, 0, &dc21285_ops, sys, &sys->resources);
289289
}
290290

291291
#define dc21285_request_irq(_a, _b, _c, _d, _e) \

0 commit comments

Comments
 (0)