Skip to content

Commit

Permalink
Merge branch 'linux-next' of git://git.kernel.org/pub/scm/linux/kerne…
Browse files Browse the repository at this point in the history
…l/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.
  • Loading branch information
torvalds committed Jan 12, 2012
2 parents 9f13a1f + 76ccc29 commit 7b67e75
Show file tree
Hide file tree
Showing 91 changed files with 1,125 additions and 806 deletions.
12 changes: 12 additions & 0 deletions Documentation/feature-removal-schedule.txt
Original file line number Diff line number Diff line change
Expand Up @@ -544,3 +544,15 @@ When: 3.5
Why: The iwlagn module has been renamed iwlwifi. The alias will be around
for backward compatibility for several cycles and then dropped.
Who: Don Fry <[email protected]>

----------------------------

What: pci_scan_bus_parented()
When: 3.5
Why: The pci_scan_bus_parented() interface creates a new root bus. The
bus is created with default resources (ioport_resource and
iomem_resource) that are always wrong, so we rely on arch code to
correct them later. Callers of pci_scan_bus_parented() should
convert to using pci_scan_root_bus() so they can supply a list of
bus resources when the bus is created.
Who: Bjorn Helgaas <[email protected]>
40 changes: 20 additions & 20 deletions arch/alpha/kernel/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -281,27 +281,9 @@ pcibios_fixup_device_resources(struct pci_dev *dev, struct pci_bus *bus)
void __devinit
pcibios_fixup_bus(struct pci_bus *bus)
{
/* Propagate hose info into the subordinate devices. */

struct pci_controller *hose = bus->sysdata;
struct pci_dev *dev = bus->self;

if (!dev) {
/* Root bus. */
u32 pci_mem_end;
u32 sg_base = hose->sg_pci ? hose->sg_pci->dma_base : ~0;
unsigned long end;

bus->resource[0] = hose->io_space;
bus->resource[1] = hose->mem_space;

/* Adjust hose mem_space limit to prevent PCI allocations
in the iommu windows. */
pci_mem_end = min((u32)__direct_map_base, sg_base) - 1;
end = hose->mem_space->start + pci_mem_end;
if (hose->mem_space->end > end)
hose->mem_space->end = end;
} else if (pci_probe_only &&
if (pci_probe_only && dev &&
(dev->class >> 8) == PCI_CLASS_BRIDGE_PCI) {
pci_read_bridge_bases(bus);
pcibios_fixup_device_resources(dev, bus);
Expand Down Expand Up @@ -414,13 +396,31 @@ void __init
common_init_pci(void)
{
struct pci_controller *hose;
struct list_head resources;
struct pci_bus *bus;
int next_busno;
int need_domain_info = 0;
u32 pci_mem_end;
u32 sg_base;
unsigned long end;

/* Scan all of the recorded PCI controllers. */
for (next_busno = 0, hose = hose_head; hose; hose = hose->next) {
bus = pci_scan_bus(next_busno, alpha_mv.pci_ops, hose);
sg_base = hose->sg_pci ? hose->sg_pci->dma_base : ~0;

/* Adjust hose mem_space limit to prevent PCI allocations
in the iommu windows. */
pci_mem_end = min((u32)__direct_map_base, sg_base) - 1;
end = hose->mem_space->start + pci_mem_end;
if (hose->mem_space->end > end)
hose->mem_space->end = end;

INIT_LIST_HEAD(&resources);
pci_add_resource(&resources, hose->io_space);
pci_add_resource(&resources, hose->mem_space);

bus = pci_scan_root_bus(NULL, next_busno, alpha_mv.pci_ops,
hose, &resources);
hose->bus = bus;
hose->need_domain_info = need_domain_info;
next_busno = bus->subordinate + 1;
Expand Down
9 changes: 6 additions & 3 deletions arch/arm/common/it8152.c
Original file line number Diff line number Diff line change
Expand Up @@ -299,8 +299,8 @@ int __init it8152_pci_setup(int nr, struct pci_sys_data *sys)
goto err1;
}

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

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

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

struct pci_bus * __init it8152_pci_scan_bus(int nr, struct pci_sys_data *sys)
{
return pci_scan_bus(nr, &it8152_ops, sys);
return pci_scan_root_bus(NULL, nr, &it8152_ops, sys, &sys->resources);
}

EXPORT_SYMBOL(dma_set_coherent_mask);
3 changes: 2 additions & 1 deletion arch/arm/common/via82c505.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ int __init via82c505_setup(int nr, struct pci_sys_data *sys)
struct pci_bus * __init via82c505_scan_bus(int nr, struct pci_sys_data *sysdata)
{
if (nr == 0)
return pci_scan_bus(0, &via82c505_ops, sysdata);
return pci_scan_root_bus(NULL, 0, &via82c505_ops, sysdata,
&sysdata->resources);

return NULL;
}
2 changes: 1 addition & 1 deletion arch/arm/include/asm/mach/pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ struct pci_sys_data {
u64 mem_offset; /* bus->cpu memory mapping offset */
unsigned long io_offset; /* bus->cpu IO mapping offset */
struct pci_bus *bus; /* PCI bus */
struct resource *resource[3]; /* Primary PCI bus resources */
struct list_head resources; /* root bus resources (apertures) */
/* Bridge swizzling */
u8 (*swizzle)(struct pci_dev *, u8 *);
/* IRQ mapping */
Expand Down
12 changes: 0 additions & 12 deletions arch/arm/include/asm/pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,6 @@ static inline int pci_proc_domain(struct pci_bus *bus)
}
#endif /* CONFIG_PCI_DOMAINS */

#ifdef CONFIG_PCI_HOST_ITE8152
/* ITE bridge requires setting latency timer to avoid early bus access
termination by PIC bus mater devices
*/
extern void pcibios_set_master(struct pci_dev *dev);
#else
static inline void pcibios_set_master(struct pci_dev *dev)
{
/* No special bus mastering setup handling */
}
#endif

static inline void pcibios_penalize_isa_irq(int irq, int active)
{
/* We don't do dynamic PCI IRQ allocation */
Expand Down
34 changes: 15 additions & 19 deletions arch/arm/kernel/bios32.c
Original file line number Diff line number Diff line change
Expand Up @@ -316,21 +316,6 @@ pdev_fixup_device_resources(struct pci_sys_data *root, struct pci_dev *dev)
}
}

static void __devinit
pbus_assign_bus_resources(struct pci_bus *bus, struct pci_sys_data *root)
{
struct pci_dev *dev = bus->self;
int i;

if (!dev) {
/*
* Assign root bus resources.
*/
for (i = 0; i < 3; i++)
bus->resource[i] = root->resource[i];
}
}

/*
* pcibios_fixup_bus - Called after each bus is probed,
* but before its children are examined.
Expand All @@ -341,8 +326,6 @@ void pcibios_fixup_bus(struct pci_bus *bus)
struct pci_dev *dev;
u16 features = PCI_COMMAND_SERR | PCI_COMMAND_PARITY | PCI_COMMAND_FAST_BACK;

pbus_assign_bus_resources(bus, root);

/*
* Walk the devices on this bus, working out what we can
* and can't support.
Expand Down Expand Up @@ -508,12 +491,18 @@ static void __init pcibios_init_hw(struct hw_pci *hw)
sys->busnr = busnr;
sys->swizzle = hw->swizzle;
sys->map_irq = hw->map_irq;
sys->resource[0] = &ioport_resource;
sys->resource[1] = &iomem_resource;
INIT_LIST_HEAD(&sys->resources);

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

if (ret > 0) {
if (list_empty(&sys->resources)) {
pci_add_resource(&sys->resources,
&ioport_resource);
pci_add_resource(&sys->resources,
&iomem_resource);
}

sys->bus = hw->scan(nr, sys);

if (!sys->bus)
Expand Down Expand Up @@ -571,6 +560,13 @@ void __init pci_common_init(struct hw_pci *hw)
}
}

#ifndef CONFIG_PCI_HOST_ITE8152
void pcibios_set_master(struct pci_dev *dev)
{
/* No special bus mastering setup handling */
}
#endif

char * __init pcibios_setup(char *str)
{
if (!strcmp(str, "debug")) {
Expand Down
8 changes: 4 additions & 4 deletions arch/arm/mach-cns3xxx/pcie.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,13 +151,12 @@ static int cns3xxx_pci_setup(int nr, struct pci_sys_data *sys)
struct cns3xxx_pcie *cnspci = sysdata_to_cnspci(sys);
struct resource *res_io = &cnspci->res_io;
struct resource *res_mem = &cnspci->res_mem;
struct resource **sysres = sys->resource;

BUG_ON(request_resource(&iomem_resource, res_io) ||
request_resource(&iomem_resource, res_mem));

sysres[0] = res_io;
sysres[1] = res_mem;
pci_add_resource(&sys->resources, res_io);
pci_add_resource(&sys->resources, res_mem);

return 1;
}
Expand All @@ -169,7 +168,8 @@ static struct pci_ops cns3xxx_pcie_ops = {

static struct pci_bus *cns3xxx_pci_scan_bus(int nr, struct pci_sys_data *sys)
{
return pci_scan_bus(sys->busnr, &cns3xxx_pcie_ops, sys);
return pci_scan_root_bus(NULL, sys->busnr, &cns3xxx_pcie_ops, sys,
&sys->resources);
}

static int cns3xxx_pcie_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
Expand Down
9 changes: 4 additions & 5 deletions arch/arm/mach-dove/pcie.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ static int __init dove_pcie_setup(int nr, struct pci_sys_data *sys)
pp->res[0].flags = IORESOURCE_IO;
if (request_resource(&ioport_resource, &pp->res[0]))
panic("Request PCIe IO resource failed\n");
sys->resource[0] = &pp->res[0];
pci_add_resource(&sys->resources, &pp->res[0]);

/*
* IORESOURCE_MEM
Expand All @@ -88,9 +88,7 @@ static int __init dove_pcie_setup(int nr, struct pci_sys_data *sys)
pp->res[1].flags = IORESOURCE_MEM;
if (request_resource(&iomem_resource, &pp->res[1]))
panic("Request PCIe Memory resource failed\n");
sys->resource[1] = &pp->res[1];

sys->resource[2] = NULL;
pci_add_resource(&sys->resources, &pp->res[1]);

return 1;
}
Expand Down Expand Up @@ -184,7 +182,8 @@ dove_pcie_scan_bus(int nr, struct pci_sys_data *sys)
struct pci_bus *bus;

if (nr < num_pcie_ports) {
bus = pci_scan_bus(sys->busnr, &pcie_ops, sys);
bus = pci_scan_root_bus(NULL, sys->busnr, &pcie_ops, sys,
&sys->resources);
} else {
bus = NULL;
BUG();
Expand Down
8 changes: 4 additions & 4 deletions arch/arm/mach-footbridge/dc21285.c
Original file line number Diff line number Diff line change
Expand Up @@ -275,17 +275,17 @@ int __init dc21285_setup(int nr, struct pci_sys_data *sys)
allocate_resource(&iomem_resource, &res[0], 0x40000000,
0x80000000, 0xffffffff, 0x40000000, NULL, NULL);

sys->resource[0] = &ioport_resource;
sys->resource[1] = &res[0];
sys->resource[2] = &res[1];
pci_add_resource(&sys->resources, &ioport_resource);
pci_add_resource(&sys->resources, &res[0]);
pci_add_resource(&sys->resources, &res[1]);
sys->mem_offset = DC21285_PCI_MEM;

return 1;
}

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

#define dc21285_request_irq(_a, _b, _c, _d, _e) \
Expand Down
19 changes: 10 additions & 9 deletions arch/arm/mach-integrator/pci_v3.c
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ static struct resource pre_mem = {
.flags = IORESOURCE_MEM | IORESOURCE_PREFETCH,
};

static int __init pci_v3_setup_resources(struct resource **resource)
static int __init pci_v3_setup_resources(struct pci_sys_data *sys)
{
if (request_resource(&iomem_resource, &non_mem)) {
printk(KERN_ERR "PCI: unable to allocate non-prefetchable "
Expand All @@ -374,13 +374,13 @@ static int __init pci_v3_setup_resources(struct resource **resource)
}

/*
* bus->resource[0] is the IO resource for this bus
* bus->resource[1] is the mem resource for this bus
* bus->resource[2] is the prefetch mem resource for this bus
* the IO resource for this bus
* the mem resource for this bus
* the prefetch mem resource for this bus
*/
resource[0] = &ioport_resource;
resource[1] = &non_mem;
resource[2] = &pre_mem;
pci_add_resource(&sys->resources, &ioport_resource);
pci_add_resource(&sys->resources, &non_mem);
pci_add_resource(&sys->resources, &pre_mem);

return 1;
}
Expand Down Expand Up @@ -481,15 +481,16 @@ int __init pci_v3_setup(int nr, struct pci_sys_data *sys)

if (nr == 0) {
sys->mem_offset = PHYS_PCI_MEM_BASE;
ret = pci_v3_setup_resources(sys->resource);
ret = pci_v3_setup_resources(sys);
}

return ret;
}

struct pci_bus * __init pci_v3_scan_bus(int nr, struct pci_sys_data *sys)
{
return pci_scan_bus(sys->busnr, &pci_v3_ops, sys);
return pci_scan_root_bus(NULL, sys->busnr, &pci_v3_ops, sys,
&sys->resources);
}

/*
Expand Down
17 changes: 8 additions & 9 deletions arch/arm/mach-iop13xx/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -537,14 +537,14 @@ struct pci_bus *iop13xx_scan_bus(int nr, struct pci_sys_data *sys)
while(time_before(jiffies, atux_trhfa_timeout))
udelay(100);

bus = pci_bus_atux = pci_scan_bus(sys->busnr,
&iop13xx_atux_ops,
sys);
bus = pci_bus_atux = pci_scan_root_bus(NULL, sys->busnr,
&iop13xx_atux_ops,
sys, &sys->resources);
break;
case IOP13XX_INIT_ATU_ATUE:
bus = pci_bus_atue = pci_scan_bus(sys->busnr,
&iop13xx_atue_ops,
sys);
bus = pci_bus_atue = pci_scan_root_bus(NULL, sys->busnr,
&iop13xx_atue_ops,
sys, &sys->resources);
break;
}

Expand Down Expand Up @@ -1084,9 +1084,8 @@ int iop13xx_pci_setup(int nr, struct pci_sys_data *sys)
request_resource(&ioport_resource, &res[0]);
request_resource(&iomem_resource, &res[1]);

sys->resource[0] = &res[0];
sys->resource[1] = &res[1];
sys->resource[2] = NULL;
pci_add_resource(&sys->resources, &res[0]);
pci_add_resource(&sys->resources, &res[1]);

return 1;
}
Expand Down
3 changes: 2 additions & 1 deletion arch/arm/mach-ixp2000/enp2611.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@ static struct pci_ops enp2611_pci_ops = {
static struct pci_bus * __init enp2611_pci_scan_bus(int nr,
struct pci_sys_data *sys)
{
return pci_scan_bus(sys->busnr, &enp2611_pci_ops, sys);
return pci_scan_root_bus(NULL, sys->busnr, &enp2611_pci_ops, sys,
&sys->resources);
}

static int __init enp2611_pci_map_irq(const struct pci_dev *dev, u8 slot,
Expand Down
Loading

0 comments on commit 7b67e75

Please sign in to comment.