All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] PCI, acpiphp: Add module parameter "complete_add" used to determine whether to hot add all devices regardless of be assigned resources fail
@ 2012-08-16 12:12 Yijing Wang
  2012-08-16 12:12 ` [PATCH 2/3] PCI, acpiphp: Use list_for_each_entry_safe instead of list_for_each_entry Yijing Wang
  2012-08-16 12:12 ` [PATCH 3/3] PCI, acpiphp: Use res->flags to determine whether the resouce is valid Yijing Wang
  0 siblings, 2 replies; 6+ messages in thread
From: Yijing Wang @ 2012-08-16 12:12 UTC (permalink / raw)
  To: Bjorn Helgaas, linux-pci; +Cc: Hanjun Guo, Jiang Liu, Yinghai Lu, Yijing Wang

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(-)

diff --git a/drivers/pci/hotplug/acpiphp.h b/drivers/pci/hotplug/acpiphp.h
index a1afb5b..b228dad 100644
--- a/drivers/pci/hotplug/acpiphp.h
+++ b/drivers/pci/hotplug/acpiphp.h
@@ -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 */
diff --git a/drivers/pci/hotplug/acpiphp_core.c b/drivers/pci/hotplug/acpiphp_core.c
index 96316b7..6d31608 100644
--- a/drivers/pci/hotplug/acpiphp_core.c
+++ b/drivers/pci/hotplug/acpiphp_core.c
@@ -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);
diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c
index ad6fd66..a372ade 100644
--- a/drivers/pci/hotplug/acpiphp_glue.c
+++ b/drivers/pci/hotplug/acpiphp_glue.c
@@ -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;
-- 
1.7.1



^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-08-17  5:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-16 12:12 [PATCH 1/3] PCI, acpiphp: Add module parameter "complete_add" used to determine whether to hot add all devices regardless of be assigned resources fail Yijing Wang
2012-08-16 12:12 ` [PATCH 2/3] PCI, acpiphp: Use list_for_each_entry_safe instead of list_for_each_entry Yijing Wang
2012-08-16 12:12 ` [PATCH 3/3] PCI, acpiphp: Use res->flags to determine whether the resouce is valid Yijing Wang
2012-08-17  0:58   ` Yijing Wang
2012-08-17  2:34     ` Bjorn Helgaas
2012-08-17  4:59       ` Yijing Wang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.