Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 358444
b: refs/heads/master
c: 018ba0a
h: refs/heads/master
v: v3
  • Loading branch information
Bjorn Helgaas committed Feb 19, 2013
1 parent 76c1b4c commit 1c58e13
Show file tree
Hide file tree
Showing 34 changed files with 237 additions and 273 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 181380b702eee1a9aca51354d7b87c7b08541fcf
refs/heads/master: 018ba0a6efada61b9bc17500101d81c3d35807c2
21 changes: 21 additions & 0 deletions trunk/Documentation/kernel-parameters.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2227,6 +2227,21 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
This sorting is done to get a device
order compatible with older (<= 2.4) kernels.
nobfsort Don't sort PCI devices into breadth-first order.
pcie_bus_tune_off Disable PCIe MPS (Max Payload Size)
tuning and use the BIOS-configured MPS defaults.
pcie_bus_safe Set every device's MPS to the largest value
supported by all devices below the root complex.
pcie_bus_perf Set device MPS to the largest allowable MPS
based on its parent bus. Also set MRRS (Max
Read Request Size) to the largest supported
value (no larger than the MPS that the device
or bus can support) for best performance.
pcie_bus_peer2peer Set every device's MPS to 128B, which
every device is guaranteed to support. This
configuration allows peer-to-peer DMA between
any pair of devices, possibly at the cost of
reduced performance. This also guarantees
that hot-added devices will work.
cbiosize=nn[KMG] The fixed amount of bus space which is
reserved for the CardBus bridge's IO window.
The default value is 256 bytes.
Expand All @@ -2248,6 +2263,12 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
the default.
off: Turn ECRC off
on: Turn ECRC on.
hpiosize=nn[KMG] The fixed amount of bus space which is
reserved for hotplug bridge's IO window.
Default size is 256 bytes.
hpmemsize=nn[KMG] The fixed amount of bus space which is
reserved for hotplug bridge's memory window.
Default size is 2 megabytes.
realloc= Enable/disable reallocating PCI bridge resources
if allocations done by BIOS are too small to
accommodate resources required by all child
Expand Down
1 change: 0 additions & 1 deletion trunk/arch/frv/mb93090-mb00/pci-frv.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ void pcibios_resource_survey(void);
/* pci-vdk.c */

extern int __nongpreldata pcibios_last_bus;
extern struct pci_bus *__nongpreldata pci_root_bus;
extern struct pci_ops *__nongpreldata pci_root_ops;

/* pci-irq.c */
Expand Down
4 changes: 1 addition & 3 deletions trunk/arch/frv/mb93090-mb00/pci-vdk.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
unsigned int __nongpreldata pci_probe = 1;

int __nongpreldata pcibios_last_bus = -1;
struct pci_bus *__nongpreldata pci_root_bus;
struct pci_ops *__nongpreldata pci_root_ops;

/*
Expand Down Expand Up @@ -416,8 +415,7 @@ int __init pcibios_init(void)
printk("PCI: Probing PCI hardware\n");
pci_add_resource(&resources, &pci_ioport_resource);
pci_add_resource(&resources, &pci_iomem_resource);
pci_root_bus = pci_scan_root_bus(NULL, 0, pci_root_ops, NULL,
&resources);
pci_scan_root_bus(NULL, 0, pci_root_ops, NULL, &resources);

pcibios_irq_init();
pcibios_fixup_peer_bridges();
Expand Down
8 changes: 8 additions & 0 deletions trunk/arch/ia64/pci/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,14 @@ pci_acpi_scan_root(struct acpi_pci_root *root)
return NULL;
}

int pcibios_root_bridge_prepare(struct pci_host_bridge *bridge)
{
struct pci_controller *controller = bridge->bus->sysdata;

ACPI_HANDLE_SET(&bridge->dev, controller->acpi_handle);
return 0;
}

static int __devinit is_valid_resource(struct pci_dev *dev, int idx)
{
unsigned int i, type_mask = IORESOURCE_IO | IORESOURCE_MEM;
Expand Down
1 change: 0 additions & 1 deletion trunk/arch/mn10300/unit-asb2305/pci-asb2305.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ extern void pcibios_resource_survey(void);
/* pci.c */

extern int pcibios_last_bus;
extern struct pci_bus *pci_root_bus;
extern struct pci_ops *pci_root_ops;

extern struct irq_routing_table *pcibios_get_irq_routing_table(void);
Expand Down
4 changes: 1 addition & 3 deletions trunk/arch/mn10300/unit-asb2305/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
unsigned int pci_probe = 1;

int pcibios_last_bus = -1;
struct pci_bus *pci_root_bus;
struct pci_ops *pci_root_ops;

/*
Expand Down Expand Up @@ -377,8 +376,7 @@ static int __init pcibios_init(void)

pci_add_resource_offset(&resources, &pci_ioport_resource, io_offset);
pci_add_resource_offset(&resources, &pci_iomem_resource, mem_offset);
pci_root_bus = pci_scan_root_bus(NULL, 0, &pci_direct_ampci, NULL,
&resources);
pci_scan_root_bus(NULL, 0, &pci_direct_ampci, NULL, &resources);

pcibios_irq_init();
pcibios_fixup_irqs();
Expand Down
3 changes: 3 additions & 0 deletions trunk/arch/x86/include/asm/pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
struct pci_sysdata {
int domain; /* PCI domain */
int node; /* NUMA node */
#ifdef CONFIG_ACPI
void *acpi; /* ACPI-specific data */
#endif
#ifdef CONFIG_X86_64
void *iommu; /* IOMMU private data */
#endif
Expand Down
1 change: 0 additions & 1 deletion trunk/arch/x86/include/asm/pci_x86.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ void pcibios_set_cache_line_size(void);
/* pci-pc.c */

extern int pcibios_last_bus;
extern struct pci_bus *pci_root_bus;
extern struct pci_ops pci_root_ops;

void pcibios_scan_specific_bus(int busn);
Expand Down
9 changes: 9 additions & 0 deletions trunk/arch/x86/pci/acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,7 @@ struct pci_bus * __devinit pci_acpi_scan_root(struct acpi_pci_root *root)
sd = &info->sd;
sd->domain = domain;
sd->node = node;
sd->acpi = device->handle;
/*
* Maybe the desired pci bus has been already scanned. In such case
* it is unnecessary to scan the pci bus with the given domain,busnum.
Expand Down Expand Up @@ -593,6 +594,14 @@ struct pci_bus * __devinit pci_acpi_scan_root(struct acpi_pci_root *root)
return bus;
}

int pcibios_root_bridge_prepare(struct pci_host_bridge *bridge)
{
struct pci_sysdata *sd = bridge->bus->sysdata;

ACPI_HANDLE_SET(&bridge->dev, sd->acpi);
return 0;
}

int __init pci_acpi_init(void)
{
struct pci_dev *dev = NULL;
Expand Down
1 change: 0 additions & 1 deletion trunk/arch/x86/pci/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ int noioapicreroute = 1;
#endif
int pcibios_last_bus = -1;
unsigned long pirq_table_addr;
struct pci_bus *pci_root_bus;
const struct pci_raw_ops *__read_mostly raw_pci_ops;
const struct pci_raw_ops *__read_mostly raw_pci_ext_ops;

Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/x86/pci/legacy.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ int __init pci_legacy_init(void)
}

printk("PCI: Probing PCI hardware\n");
pci_root_bus = pcibios_scan_root(0);
pcibios_scan_root(0);
return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/x86/pci/numaq_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ int __init pci_numaq_init(void)

raw_pci_ops = &pci_direct_conf1_mq;

pci_root_bus = pcibios_scan_root(0);
pcibios_scan_root(0);
if (num_online_nodes() > 1)
for_each_online_node(quad) {
if (quad == 0)
Expand Down
5 changes: 1 addition & 4 deletions trunk/drivers/acpi/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ config ACPI_DEBUG_FUNC_TRACE
is about half of the penalty and is rarely useful.

config ACPI_PCI_SLOT
tristate "PCI slot detection driver"
bool "PCI slot detection driver"
depends on SYSFS
default n
help
Expand All @@ -317,9 +317,6 @@ config ACPI_PCI_SLOT
i.e., segment/bus/device/function tuples, with physical slots in
the system. If you are unsure, say N.

To compile this driver as a module, choose M here:
the module will be called pci_slot.

config X86_PM_TIMER
bool "Power Management Timer Support" if EXPERT
depends on X86
Expand Down
5 changes: 5 additions & 0 deletions trunk/drivers/acpi/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ struct acpi_ec {

extern struct acpi_ec *first_ec;

#ifdef CONFIG_ACPI_PCI_SLOT
void acpi_pci_slot_init(void);
#else
static inline void acpi_pci_slot_init(void) { }
#endif
int acpi_pci_root_init(void);
void acpi_pci_root_hp_init(void);
int acpi_ec_init(void);
Expand Down
18 changes: 0 additions & 18 deletions trunk/drivers/acpi/pci_root.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,24 +107,6 @@ void acpi_pci_unregister_driver(struct acpi_pci_driver *driver)
}
EXPORT_SYMBOL(acpi_pci_unregister_driver);

acpi_handle acpi_get_pci_rootbridge_handle(unsigned int seg, unsigned int bus)
{
struct acpi_pci_root *root;
acpi_handle handle = NULL;

mutex_lock(&acpi_pci_root_lock);
list_for_each_entry(root, &acpi_pci_roots, node)
if ((root->segment == (u16) seg) &&
(root->secondary.start == (u16) bus)) {
handle = root->device->handle;
break;
}
mutex_unlock(&acpi_pci_root_lock);
return handle;
}

EXPORT_SYMBOL_GPL(acpi_get_pci_rootbridge_handle);

/**
* acpi_is_root_bridge - determine whether an ACPI CA node is a PCI root bridge
* @handle - the ACPI CA node in question.
Expand Down
13 changes: 1 addition & 12 deletions trunk/drivers/acpi/pci_slot.c
Original file line number Diff line number Diff line change
Expand Up @@ -330,19 +330,8 @@ static struct dmi_system_id acpi_pci_slot_dmi_table[] __initdata = {
{}
};

static int __init
acpi_pci_slot_init(void)
void __init acpi_pci_slot_init(void)
{
dmi_check_system(acpi_pci_slot_dmi_table);
acpi_pci_register_driver(&acpi_pci_slot_driver);
return 0;
}

static void __exit
acpi_pci_slot_exit(void)
{
acpi_pci_unregister_driver(&acpi_pci_slot_driver);
}

module_init(acpi_pci_slot_init);
module_exit(acpi_pci_slot_exit);
1 change: 1 addition & 0 deletions trunk/drivers/acpi/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -1687,6 +1687,7 @@ int __init acpi_scan_init(void)

acpi_power_init();
acpi_pci_root_init();
acpi_pci_slot_init();

/*
* Enumerate devices in the ACPI namespace.
Expand Down
6 changes: 3 additions & 3 deletions trunk/drivers/pci/access.c
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ EXPORT_SYMBOL_GPL(pci_cfg_access_unlock);

static inline int pcie_cap_version(const struct pci_dev *dev)
{
return dev->pcie_flags_reg & PCI_EXP_FLAGS_VERS;
return pcie_caps_reg(dev) & PCI_EXP_FLAGS_VERS;
}

static inline bool pcie_cap_has_devctl(const struct pci_dev *dev)
Expand All @@ -497,7 +497,7 @@ static inline bool pcie_cap_has_sltctl(const struct pci_dev *dev)
return pcie_cap_version(dev) > 1 ||
type == PCI_EXP_TYPE_ROOT_PORT ||
(type == PCI_EXP_TYPE_DOWNSTREAM &&
dev->pcie_flags_reg & PCI_EXP_FLAGS_SLOT);
pcie_caps_reg(dev) & PCI_EXP_FLAGS_SLOT);
}

static inline bool pcie_cap_has_rtctl(const struct pci_dev *dev)
Expand All @@ -515,7 +515,7 @@ static bool pcie_capability_reg_implemented(struct pci_dev *dev, int pos)
return false;

switch (pos) {
case PCI_EXP_FLAGS_TYPE:
case PCI_EXP_FLAGS:
return true;
case PCI_EXP_DEVCAP:
case PCI_EXP_DEVCTL:
Expand Down
29 changes: 11 additions & 18 deletions trunk/drivers/pci/hotplug/cpci_hotplug_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,8 @@ int cpci_led_off(struct slot* slot)

int __ref cpci_configure_slot(struct slot *slot)
{
struct pci_dev *dev;
struct pci_bus *parent;
int fn;

dbg("%s - enter", __func__);

Expand Down Expand Up @@ -282,18 +282,13 @@ int __ref cpci_configure_slot(struct slot *slot)
}
parent = slot->dev->bus;

for (fn = 0; fn < 8; fn++) {
struct pci_dev *dev;

dev = pci_get_slot(parent,
PCI_DEVFN(PCI_SLOT(slot->devfn), fn));
if (!dev)
list_for_each_entry(dev, &parent->devices, bus_list)
if (PCI_SLOT(dev->devfn) != PCI_SLOT(slot->devfn))
continue;
if ((dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) ||
(dev->hdr_type == PCI_HEADER_TYPE_CARDBUS))
pci_hp_add_bridge(dev);
pci_dev_put(dev);
}


pci_assign_unassigned_bridge_resources(parent->self);

Expand All @@ -305,22 +300,20 @@ int __ref cpci_configure_slot(struct slot *slot)

int cpci_unconfigure_slot(struct slot* slot)
{
int i;
struct pci_dev *dev;
struct pci_dev *dev, *temp;

dbg("%s - enter", __func__);
if (!slot->dev) {
err("No device for slot %02x\n", slot->number);
return -ENODEV;
}

for (i = 0; i < 8; i++) {
dev = pci_get_slot(slot->bus,
PCI_DEVFN(PCI_SLOT(slot->devfn), i));
if (dev) {
pci_stop_and_remove_bus_device(dev);
pci_dev_put(dev);
}
list_for_each_entry_safe(dev, temp, &slot->bus->devices, bus_list) {
if (PCI_SLOT(dev->devfn) != PCI_SLOT(slot->devfn))
continue;
pci_dev_get(dev);
pci_stop_and_remove_bus_device(dev);
pci_dev_put(dev);
}
pci_dev_put(slot->dev);
slot->dev = NULL;
Expand Down
Loading

0 comments on commit 1c58e13

Please sign in to comment.