Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 358439
b: refs/heads/master
c: ab1a2e0
h: refs/heads/master
i:
  358437: 8c682a5
  358435: b214ec3
  358431: 2e1ae71
v: v3
  • Loading branch information
Jiang Liu authored and Bjorn Helgaas committed Feb 15, 2013
1 parent f55a25c commit 42c4b32
Show file tree
Hide file tree
Showing 44 changed files with 601 additions and 525 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: 20f24208f631141bafe57ce5bcc8f2e7f3c41aae
refs/heads/master: ab1a2e038ff2336502e95ec6492c0364a9fc70d0
21 changes: 0 additions & 21 deletions trunk/Documentation/kernel-parameters.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2227,21 +2227,6 @@ 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 @@ -2263,12 +2248,6 @@ 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: 1 addition & 0 deletions trunk/arch/frv/mb93090-mb00/pci-frv.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ 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: 3 additions & 1 deletion trunk/arch/frv/mb93090-mb00/pci-vdk.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
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 @@ -415,7 +416,8 @@ 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_scan_root_bus(NULL, 0, pci_root_ops, NULL, &resources);
pci_root_bus = pci_scan_root_bus(NULL, 0, pci_root_ops, NULL,
&resources);

pcibios_irq_init();
pcibios_fixup_peer_bridges();
Expand Down
8 changes: 0 additions & 8 deletions trunk/arch/ia64/pci/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -396,14 +396,6 @@ 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: 1 addition & 0 deletions trunk/arch/mn10300/unit-asb2305/pci-asb2305.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ 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: 3 additions & 1 deletion trunk/arch/mn10300/unit-asb2305/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
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 @@ -376,7 +377,8 @@ 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_scan_root_bus(NULL, 0, &pci_direct_ampci, NULL, &resources);
pci_root_bus = pci_scan_root_bus(NULL, 0, &pci_direct_ampci, NULL,
&resources);

pcibios_irq_init();
pcibios_fixup_irqs();
Expand Down
3 changes: 0 additions & 3 deletions trunk/arch/x86/include/asm/pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
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: 1 addition & 0 deletions trunk/arch/x86/include/asm/pci_x86.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ 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: 0 additions & 9 deletions trunk/arch/x86/pci/acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,6 @@ 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 @@ -594,14 +593,6 @@ 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: 1 addition & 0 deletions trunk/arch/x86/pci/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ 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");
pcibios_scan_root(0);
pci_root_bus = 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;

pcibios_scan_root(0);
pci_root_bus = 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
6 changes: 5 additions & 1 deletion trunk/drivers/acpi/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,12 @@ 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);
int acpi_ec_ecdt_probe(void);
int acpi_boot_ec_enable(void);
Expand Down
24 changes: 2 additions & 22 deletions trunk/drivers/acpi/osl.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ static acpi_osd_handler acpi_irq_handler;
static void *acpi_irq_context;
static struct workqueue_struct *kacpid_wq;
static struct workqueue_struct *kacpi_notify_wq;
static struct workqueue_struct *kacpi_hotplug_wq;
struct workqueue_struct *kacpi_hotplug_wq;
EXPORT_SYMBOL(kacpi_hotplug_wq);

/*
* This list of permanent mappings is for memory that may be accessed from
Expand Down Expand Up @@ -1777,24 +1778,3 @@ void acpi_os_set_prepare_sleep(int (*func)(u8 sleep_state,
{
__acpi_os_prepare_sleep = func;
}

void alloc_acpi_hp_work(acpi_handle handle, u32 type, void *context,
void (*func)(struct work_struct *work))
{
struct acpi_hp_work *hp_work;
int ret;

hp_work = kmalloc(sizeof(*hp_work), GFP_KERNEL);
if (!hp_work)
return;

hp_work->handle = handle;
hp_work->type = type;
hp_work->context = context;

INIT_WORK(&hp_work->work, func);
ret = queue_work(kacpi_hotplug_wq, &hp_work->work);
if (!ret)
kfree(hp_work);
}
EXPORT_SYMBOL_GPL(alloc_acpi_hp_work);
148 changes: 18 additions & 130 deletions trunk/drivers/acpi/pci_root.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,24 @@ 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 Expand Up @@ -655,133 +673,3 @@ int __init acpi_pci_root_init(void)

return 0;
}
/* Support root bridge hotplug */

static void handle_root_bridge_insertion(acpi_handle handle)
{
struct acpi_device *device;

if (!acpi_bus_get_device(handle, &device)) {
printk(KERN_DEBUG "acpi device exists...\n");
return;
}

if (acpi_bus_scan(handle))
printk(KERN_ERR "cannot add bridge to acpi list\n");
}

static void handle_root_bridge_removal(struct acpi_device *device)
{
struct acpi_eject_event *ej_event;

ej_event = kmalloc(sizeof(*ej_event), GFP_KERNEL);
if (!ej_event) {
/* Inform firmware the hot-remove operation has error */
(void) acpi_evaluate_hotplug_ost(device->handle,
ACPI_NOTIFY_EJECT_REQUEST,
ACPI_OST_SC_NON_SPECIFIC_FAILURE,
NULL);
return;
}

ej_event->device = device;
ej_event->event = ACPI_NOTIFY_EJECT_REQUEST;

acpi_bus_hot_remove_device(ej_event);
}

static void _handle_hotplug_event_root(struct work_struct *work)
{
struct acpi_pci_root *root;
struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER };
struct acpi_hp_work *hp_work;
acpi_handle handle;
u32 type;

hp_work = container_of(work, struct acpi_hp_work, work);
handle = hp_work->handle;
type = hp_work->type;

root = acpi_pci_find_root(handle);

acpi_get_name(handle, ACPI_FULL_PATHNAME, &buffer);

switch (type) {
case ACPI_NOTIFY_BUS_CHECK:
/* bus enumerate */
printk(KERN_DEBUG "%s: Bus check notify on %s\n", __func__,
(char *)buffer.pointer);
if (!root)
handle_root_bridge_insertion(handle);

break;

case ACPI_NOTIFY_DEVICE_CHECK:
/* device check */
printk(KERN_DEBUG "%s: Device check notify on %s\n", __func__,
(char *)buffer.pointer);
if (!root)
handle_root_bridge_insertion(handle);
break;

case ACPI_NOTIFY_EJECT_REQUEST:
/* request device eject */
printk(KERN_DEBUG "%s: Device eject notify on %s\n", __func__,
(char *)buffer.pointer);
if (root)
handle_root_bridge_removal(root->device);
break;
default:
printk(KERN_WARNING "notify_handler: unknown event type 0x%x for %s\n",
type, (char *)buffer.pointer);
break;
}

kfree(hp_work); /* allocated in handle_hotplug_event_bridge */
kfree(buffer.pointer);
}

static void handle_hotplug_event_root(acpi_handle handle, u32 type,
void *context)
{
alloc_acpi_hp_work(handle, type, context,
_handle_hotplug_event_root);
}

static acpi_status __init
find_root_bridges(acpi_handle handle, u32 lvl, void *context, void **rv)
{
acpi_status status;
char objname[64];
struct acpi_buffer buffer = { .length = sizeof(objname),
.pointer = objname };
int *count = (int *)context;

if (!acpi_is_root_bridge(handle))
return AE_OK;

(*count)++;

acpi_get_name(handle, ACPI_FULL_PATHNAME, &buffer);

status = acpi_install_notify_handler(handle, ACPI_SYSTEM_NOTIFY,
handle_hotplug_event_root, NULL);
if (ACPI_FAILURE(status))
printk(KERN_DEBUG "acpi root: %s notify handler is not installed, exit status: %u\n",
objname, (unsigned int)status);
else
printk(KERN_DEBUG "acpi root: %s notify handler is installed\n",
objname);

return AE_OK;
}

void __init acpi_pci_root_hp_init(void)
{
int num = 0;

acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
ACPI_UINT32_MAX, find_root_bridges, NULL, &num, NULL);

printk(KERN_DEBUG "Found %d acpi root devices\n", num);
}
Loading

0 comments on commit 42c4b32

Please sign in to comment.