aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/hotplug/fakephp.c
diff options
context:
space:
mode:
authorAlex Chiang <achiang@hp.com>2008-10-20 19:42:03 -0400
committerJesse Barnes <jbarnes@virtuousgeek.org>2008-10-22 19:42:44 -0400
commit0b8b0dca9aad94878adaf4520f3f12bf9813f329 (patch)
treeada02f10013c1cb60cba5d4e7266c38d8ac249de /drivers/pci/hotplug/fakephp.c
parent58319b802a614f10f1b5238fbde7a4b2e9a60069 (diff)
PCI Hotplug: fakephp: add duplicate slot name debugging
The PCI core now manages slot names on behalf of slot detection and slot hotplug drivers, including the handling of duplicate slot names. We can use the fakephp driver to help test the new functionality. Add a 'dup_slots' module param to force fakephp to create multiple slots with the same name. We can then verify that the PCI core correctly renamed the slots. sapphire:/sys/bus/pci/slots # modprobe fakephp dup_slots sapphire:/sys/bus/pci/slots # ls fake fake-10 fake-3 fake-5 fake-7 fake-9 fake-1 fake-2 fake-4 fake-6 fake-8 Cc: kristen.c.accardi@intel.com Cc: matthew@wil.cx Acked-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com> Signed-off-by: Alex Chiang <achiang@hp.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/pci/hotplug/fakephp.c')
-rw-r--r--drivers/pci/hotplug/fakephp.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/pci/hotplug/fakephp.c b/drivers/pci/hotplug/fakephp.c
index 24dcbf13e98b..3a2637a00934 100644
--- a/drivers/pci/hotplug/fakephp.c
+++ b/drivers/pci/hotplug/fakephp.c
@@ -69,6 +69,7 @@ struct dummy_slot {
69}; 69};
70 70
71static int debug; 71static int debug;
72static int dup_slots;
72static LIST_HEAD(slot_list); 73static LIST_HEAD(slot_list);
73static struct workqueue_struct *dummyphp_wq; 74static struct workqueue_struct *dummyphp_wq;
74 75
@@ -121,7 +122,11 @@ static int add_slot(struct pci_dev *dev)
121 if (!dslot) 122 if (!dslot)
122 goto error_info; 123 goto error_info;
123 124
124 snprintf(name, SLOT_NAME_SIZE, "fake%d", count++); 125 if (dup_slots)
126 snprintf(name, SLOT_NAME_SIZE, "fake");
127 else
128 snprintf(name, SLOT_NAME_SIZE, "fake%d", count++);
129 dbg("slot->name = %s\n", name);
125 slot->ops = &dummy_hotplug_slot_ops; 130 slot->ops = &dummy_hotplug_slot_ops;
126 slot->release = &dummy_release; 131 slot->release = &dummy_release;
127 slot->private = dslot; 132 slot->private = dslot;
@@ -375,4 +380,5 @@ MODULE_DESCRIPTION(DRIVER_DESC);
375MODULE_LICENSE("GPL"); 380MODULE_LICENSE("GPL");
376module_param(debug, bool, S_IRUGO | S_IWUSR); 381module_param(debug, bool, S_IRUGO | S_IWUSR);
377MODULE_PARM_DESC(debug, "Debugging mode enabled or not"); 382MODULE_PARM_DESC(debug, "Debugging mode enabled or not");
378 383module_param(dup_slots, bool, S_IRUGO | S_IWUSR);
384MODULE_PARM_DESC(dup_slots, "Force duplicate slot names for debugging");