aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/hotplug
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pci/hotplug')
-rw-r--r--drivers/pci/hotplug/rpadlpar_core.c6
-rw-r--r--drivers/pci/hotplug/rpaphp.h2
-rw-r--r--drivers/pci/hotplug/rpaphp_core.c32
-rw-r--r--drivers/pci/hotplug/rpaphp_pci.c12
4 files changed, 23 insertions, 29 deletions
diff --git a/drivers/pci/hotplug/rpadlpar_core.c b/drivers/pci/hotplug/rpadlpar_core.c
index 6c148106518e..15e853e5e689 100644
--- a/drivers/pci/hotplug/rpadlpar_core.c
+++ b/drivers/pci/hotplug/rpadlpar_core.c
@@ -380,7 +380,11 @@ int dlpar_remove_pci_slot(char *drc_name, struct device_node *dn)
380 return -EIO; 380 return -EIO;
381 } 381 }
382 } else { 382 } else {
383 rpaphp_unconfig_pci_adapter(bus); 383 struct pci_dev *dev, *tmp;
384 list_for_each_entry_safe(dev, tmp, &bus->devices, bus_list) {
385 eeh_remove_bus_device(dev);
386 pci_remove_bus_device(dev);
387 }
384 } 388 }
385 389
386 if (unmap_bus_range(bus)) { 390 if (unmap_bus_range(bus)) {
diff --git a/drivers/pci/hotplug/rpaphp.h b/drivers/pci/hotplug/rpaphp.h
index 89d705c7c502..6e4f93ba6555 100644
--- a/drivers/pci/hotplug/rpaphp.h
+++ b/drivers/pci/hotplug/rpaphp.h
@@ -92,8 +92,6 @@ extern int rpaphp_enable_pci_slot(struct slot *slot);
92extern int register_pci_slot(struct slot *slot); 92extern int register_pci_slot(struct slot *slot);
93extern int rpaphp_get_pci_adapter_status(struct slot *slot, int is_init, u8 * value); 93extern int rpaphp_get_pci_adapter_status(struct slot *slot, int is_init, u8 * value);
94 94
95extern int rpaphp_unconfig_pci_adapter(struct pci_bus *bus);
96
97/* rpaphp_core.c */ 95/* rpaphp_core.c */
98extern int rpaphp_add_slot(struct device_node *dn); 96extern int rpaphp_add_slot(struct device_node *dn);
99extern int rpaphp_remove_slot(struct slot *slot); 97extern int rpaphp_remove_slot(struct slot *slot);
diff --git a/drivers/pci/hotplug/rpaphp_core.c b/drivers/pci/hotplug/rpaphp_core.c
index cf075c34b578..acf17645fd8a 100644
--- a/drivers/pci/hotplug/rpaphp_core.c
+++ b/drivers/pci/hotplug/rpaphp_core.c
@@ -412,27 +412,31 @@ exit:
412 return retval; 412 return retval;
413} 413}
414 414
415static int disable_slot(struct hotplug_slot *hotplug_slot) 415static int __disable_slot(struct slot *slot)
416{ 416{
417 int retval = -EINVAL; 417 struct pci_dev *dev, *tmp;
418 struct slot *slot = (struct slot *)hotplug_slot->private;
419 418
420 dbg("%s - Entry: slot[%s]\n", __FUNCTION__, slot->name); 419 if (slot->state == NOT_CONFIGURED)
420 return -EINVAL;
421 421
422 if (slot->state == NOT_CONFIGURED) { 422 list_for_each_entry_safe(dev, tmp, &slot->bus->devices, bus_list) {
423 dbg("%s: %s is already disabled\n", __FUNCTION__, slot->name); 423 eeh_remove_bus_device(dev);
424 goto exit; 424 pci_remove_bus_device(dev);
425 } 425 }
426 426
427 dbg("DISABLING SLOT %s\n", slot->name); 427 slot->state = NOT_CONFIGURED;
428 return 0;
429}
430
431static int disable_slot(struct hotplug_slot *hotplug_slot)
432{
433 struct slot *slot = (struct slot *)hotplug_slot->private;
434 int retval;
435
428 down(&rpaphp_sem); 436 down(&rpaphp_sem);
429 retval = rpaphp_unconfig_pci_adapter(slot->bus); 437 retval = __disable_slot (slot);
430 up(&rpaphp_sem); 438 up(&rpaphp_sem);
431 slot->state = NOT_CONFIGURED; 439
432 info("%s: devices in slot[%s] unconfigured.\n", __FUNCTION__,
433 slot->name);
434exit:
435 dbg("%s - Exit: rc[%d]\n", __FUNCTION__, retval);
436 return retval; 440 return retval;
437} 441}
438 442
diff --git a/drivers/pci/hotplug/rpaphp_pci.c b/drivers/pci/hotplug/rpaphp_pci.c
index 1f5e73be47c7..ce7ebec05933 100644
--- a/drivers/pci/hotplug/rpaphp_pci.c
+++ b/drivers/pci/hotplug/rpaphp_pci.c
@@ -116,18 +116,6 @@ static void print_slot_pci_funcs(struct pci_bus *bus)
116 return; 116 return;
117} 117}
118 118
119int rpaphp_unconfig_pci_adapter(struct pci_bus *bus)
120{
121 struct pci_dev *dev, *tmp;
122
123 list_for_each_entry_safe(dev, tmp, &bus->devices, bus_list) {
124 eeh_remove_bus_device(dev);
125 pci_remove_bus_device(dev);
126 }
127 return 0;
128}
129EXPORT_SYMBOL_GPL(rpaphp_unconfig_pci_adapter);
130
131static int setup_pci_hotplug_slot_info(struct slot *slot) 119static int setup_pci_hotplug_slot_info(struct slot *slot)
132{ 120{
133 struct hotplug_slot_info *hotplug_slot_info = slot->hotplug_slot->info; 121 struct hotplug_slot_info *hotplug_slot_info = slot->hotplug_slot->info;