Commit 8344b568 authored by Alex Chiang's avatar Alex Chiang Committed by Jesse Barnes

PCI: ACPI PCI slot detection driver

Detect all physical PCI slots as described by ACPI, and create entries in

Not all physical slots are hotpluggable, and the acpiphp module does not
detect them.  Now we know the physical PCI geography of our system, without
caring about hotplug.

[ export-kobject_rename-for-pci_hotplug_core]
Signed-off-by: default avatarKenji Kaneshige <>
Acked-by: default avatarGreg KH <>
[ build fix]
[ fix build with CONFIG_DMI=n]
Signed-off-by: default avatarAlex Chiang <>
Cc: Greg KH <>
Cc: Kristen Carlson Accardi <>
Cc: Len Brown <>
Acked-by: default avatarLen Brown <>
Acked-by: default avatarKenji Kaneshige <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarJesse Barnes <>
parent f46753c5
......@@ -338,6 +338,15 @@ config ACPI_EC
the battery and thermal drivers. If you are compiling for a
mobile system, say Y.
tristate "PCI slot detection driver"
default n
This driver will attempt to discover all PCI slots in your system,
and creates entries in /sys/bus/pci/slots/. This feature can
help you correlate PCI bus addresses with the physical geography
of your slots. If you are unsure, say N.
default y
......@@ -48,6 +48,7 @@ obj-$(CONFIG_ACPI_DOCK) += dock.o
obj-$(CONFIG_ACPI_BAY) += bay.o
obj-$(CONFIG_ACPI_VIDEO) += video.o
obj-y += pci_root.o pci_link.o pci_irq.o pci_bind.o
obj-$(CONFIG_ACPI_PCI_SLOT) += pci_slot.o
obj-$(CONFIG_ACPI_POWER) += power.o
obj-$(CONFIG_ACPI_PROCESSOR) += processor.o
obj-$(CONFIG_ACPI_CONTAINER) += container.o
This diff is collapsed.
......@@ -572,6 +572,11 @@ int pci_hp_register(struct hotplug_slot *slot, struct pci_bus *bus, int slot_nr)
if (tmp)
return -EEXIST;
* No problems if we call this interface from both ACPI_PCI_SLOT
* driver and call it here again. If we've already created the
* pci_slot, the interface will simply bump the refcount.
pci_slot = pci_create_slot(bus, slot_nr, slot->name);
if (IS_ERR(pci_slot))
return PTR_ERR(pci_slot);
......@@ -585,6 +590,17 @@ int pci_hp_register(struct hotplug_slot *slot, struct pci_bus *bus, int slot_nr)
slot->pci_slot = pci_slot;
pci_slot->hotplug = slot;
* Allow pcihp drivers to override the ACPI_PCI_SLOT name.
if (strcmp(kobject_name(&pci_slot->kobj), slot->name)) {
result = kobject_rename(&pci_slot->kobj, slot->name);
if (result) {
return result;
list_add(&slot->slot_list, &pci_hotplug_slot_list);
......@@ -668,7 +668,7 @@ static int sn_hotplug_slot_register(struct pci_bus *pci_bus)
dev_dbg(&pci_bus->self->dev, "bus failed to register with err = %d\n",
if (rc == -ENOMEM)
......@@ -439,6 +439,7 @@ int kobject_rename(struct kobject *kobj, const char *new_name)
return error;
* kobject_move - move object to another parent
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment