diff options
author | Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com> | 2008-04-25 17:39:12 -0400 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2008-04-25 17:39:12 -0400 |
commit | ef0ff95f136f0f2d035667af5d18b824609de320 (patch) | |
tree | 3d1ba364e168c92c980ae54914f8498ed36deb4b | |
parent | 4ea3e58b22b3719af99c567d08136bbe50cb4435 (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>
-rw-r--r-- | drivers/pci/hotplug/shpchp_core.c | 11 |
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 @@ | |||
39 | int shpchp_debug; | 39 | int shpchp_debug; |
40 | int shpchp_poll_mode; | 40 | int shpchp_poll_mode; |
41 | int shpchp_poll_time; | 41 | int shpchp_poll_time; |
42 | int shpchp_slot_with_bus; | ||
42 | struct workqueue_struct *shpchp_wq; | 43 | struct 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"); | |||
52 | module_param(shpchp_debug, bool, 0644); | 53 | module_param(shpchp_debug, bool, 0644); |
53 | module_param(shpchp_poll_mode, bool, 0644); | 54 | module_param(shpchp_poll_mode, bool, 0644); |
54 | module_param(shpchp_poll_time, int, 0644); | 55 | module_param(shpchp_poll_time, int, 0644); |
56 | module_param(shpchp_slot_with_bus, bool, 0644); | ||
55 | MODULE_PARM_DESC(shpchp_debug, "Debugging mode enabled or not"); | 57 | MODULE_PARM_DESC(shpchp_debug, "Debugging mode enabled or not"); |
56 | MODULE_PARM_DESC(shpchp_poll_mode, "Using polling mechanism for hot-plug events or not"); | 58 | MODULE_PARM_DESC(shpchp_poll_mode, "Using polling mechanism for hot-plug events or not"); |
57 | MODULE_PARM_DESC(shpchp_poll_time, "Polling mechanism frequency, in seconds"); | 59 | MODULE_PARM_DESC(shpchp_poll_time, "Polling mechanism frequency, in seconds"); |
60 | MODULE_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 | ||
101 | static void make_slot_name(struct slot *slot) | 104 | static 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 | ||
107 | static int init_slots(struct controller *ctrl) | 114 | static int init_slots(struct controller *ctrl) |