@@ -206,5 +206,5 @@ extern u8 acpiphp_get_adapter_status (struct acpiphp_slot *slot);
/* variables */
extern bool acpiphp_debug;
-
+extern bool acpiphp_complete_add;
#endif /* _ACPIPHP_H */
@@ -48,7 +48,7 @@
#define SLOT_NAME_SIZE 21 /* {_SUN} */
bool acpiphp_debug;
-
+bool acpiphp_complete_add;
/* local variables */
static int num_slots;
static struct acpiphp_attention_info *attention_info;
@@ -61,7 +61,9 @@ MODULE_AUTHOR(DRIVER_AUTHOR);
MODULE_DESCRIPTION(DRIVER_DESC);
MODULE_LICENSE("GPL");
MODULE_PARM_DESC(debug, "Debugging mode enabled or not");
+MODULE_PARM_DESC(complete_add, "Hot add all pci devices regardless of be assign resources fail");
module_param_named(debug, acpiphp_debug, bool, 0644);
+module_param_named(complete_add, acpiphp_complete_add, bool, 0644);
/* export the attention callback registration methods */
EXPORT_SYMBOL_GPL(acpiphp_register_attention);
@@ -827,7 +827,8 @@ static int __ref enable_device(struct acpiphp_slot *slot)
acpiphp_bus_add(func);
pci_bus_assign_resources(bus);
- acpiphp_sanitize_bus(bus);
+ if (!acpiphp_complete_add)
+ acpiphp_sanitize_bus(bus);
acpiphp_set_hpp_values(bus);
acpiphp_set_acpi_region(slot);
pci_enable_bridges(bus);
@@ -1115,7 +1116,8 @@ static int acpiphp_configure_bridge (acpi_handle handle)
pci_bus_size_bridges(bus);
pci_bus_assign_resources(bus);
- acpiphp_sanitize_bus(bus);
+ if (!acpiphp_complete_add)
+ acpiphp_sanitize_bus(bus);
acpiphp_set_hpp_values(bus);
pci_enable_bridges(bus);
return 0;
Default, when we hot add pci devices, if system allocate resources fail, this devices will be removed again. Module parameter complete_add = 1 will forces to hot add all pci devices regardless of be assigned resources fail. Signed-off-by: Yijing Wang <wangyijing@huawei.com> --- drivers/pci/hotplug/acpiphp.h | 2 +- drivers/pci/hotplug/acpiphp_core.c | 4 +++- drivers/pci/hotplug/acpiphp_glue.c | 6 ++++-- 3 files changed, 8 insertions(+), 4 deletions(-)