aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci
diff options
context:
space:
mode:
authorKenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>2008-04-25 17:39:12 -0400
committerJesse Barnes <jbarnes@virtuousgeek.org>2008-04-25 17:39:12 -0400
commitef0ff95f136f0f2d035667af5d18b824609de320 (patch)
tree3d1ba364e168c92c980ae54914f8498ed36deb4b /drivers/pci
parent4ea3e58b22b3719af99c567d08136bbe50cb4435 (diff)
shpchp: fix slot name
Current shpchp uses the combination of bus number and slot number as a slot name. But it is not a good idea because bus number is not a physical identifier but a logical identifier. This is against the shpc specification. So remove the bus number from the physical identifier. However, there are some platforms with the problem that it provides the same slot number. For those platforms, this patch also introduces new module option 'shpchp_slot_with_bus'. If it is specified, shpchp uses the combination of bus number and slot number as a slot name. Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com> Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/pci')
-rw-r--r--drivers/pci/hotplug/shpchp_core.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/pci/hotplug/shpchp_core.c b/drivers/pci/hotplug/shpchp_core.c
index 43816d4b3c43..1648076600fc 100644
--- a/drivers/pci/hotplug/shpchp_core.c
+++ b/drivers/pci/hotplug/shpchp_core.c
@@ -39,6 +39,7 @@
39int shpchp_debug; 39int shpchp_debug;
40int shpchp_poll_mode; 40int shpchp_poll_mode;
41int shpchp_poll_time; 41int shpchp_poll_time;
42int shpchp_slot_with_bus;
42struct workqueue_struct *shpchp_wq; 43struct workqueue_struct *shpchp_wq;
43 44
44#define DRIVER_VERSION "0.4" 45#define DRIVER_VERSION "0.4"
@@ -52,9 +53,11 @@ MODULE_LICENSE("GPL");
52module_param(shpchp_debug, bool, 0644); 53module_param(shpchp_debug, bool, 0644);
53module_param(shpchp_poll_mode, bool, 0644); 54module_param(shpchp_poll_mode, bool, 0644);
54module_param(shpchp_poll_time, int, 0644); 55module_param(shpchp_poll_time, int, 0644);
56module_param(shpchp_slot_with_bus, bool, 0644);
55MODULE_PARM_DESC(shpchp_debug, "Debugging mode enabled or not"); 57MODULE_PARM_DESC(shpchp_debug, "Debugging mode enabled or not");
56MODULE_PARM_DESC(shpchp_poll_mode, "Using polling mechanism for hot-plug events or not"); 58MODULE_PARM_DESC(shpchp_poll_mode, "Using polling mechanism for hot-plug events or not");
57MODULE_PARM_DESC(shpchp_poll_time, "Polling mechanism frequency, in seconds"); 59MODULE_PARM_DESC(shpchp_poll_time, "Polling mechanism frequency, in seconds");
60MODULE_PARM_DESC(shpchp_slot_with_bus, "Use bus number in the slot name");
58 61
59#define SHPC_MODULE_NAME "shpchp" 62#define SHPC_MODULE_NAME "shpchp"
60 63
@@ -100,8 +103,12 @@ static void release_slot(struct hotplug_slot *hotplug_slot)
100 103
101static void make_slot_name(struct slot *slot) 104static void make_slot_name(struct slot *slot)
102{ 105{
103 snprintf(slot->hotplug_slot->name, SLOT_NAME_SIZE, "%04d_%04d", 106 if (shpchp_slot_with_bus)
104 slot->bus, slot->number); 107 snprintf(slot->hotplug_slot->name, SLOT_NAME_SIZE, "%04d_%04d",
108 slot->bus, slot->number);
109 else
110 snprintf(slot->hotplug_slot->name, SLOT_NAME_SIZE, "%d",
111 slot->number);
105} 112}
106 113
107static int init_slots(struct controller *ctrl) 114static int init_slots(struct controller *ctrl)