diff options
author | Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com> | 2008-04-25 17:38:38 -0400 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2008-04-25 17:38:38 -0400 |
commit | 3800345f723fd130d50434d4717b99d4a9f383c8 (patch) | |
tree | a71c37e6e2a4ef0ce5665bbf2efc88efc0583265 /drivers/pci | |
parent | 460895c4b234754804300c074dfba104fa069afa (diff) |
pciehp: fix slot name
Current pciehp 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 PCIE
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 'pciehp_slot_with_bus'. If it is specified, pciehp
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/pciehp_core.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/pci/hotplug/pciehp_core.c b/drivers/pci/hotplug/pciehp_core.c index aee19f013d84..cf36f2355173 100644 --- a/drivers/pci/hotplug/pciehp_core.c +++ b/drivers/pci/hotplug/pciehp_core.c | |||
@@ -41,6 +41,7 @@ int pciehp_debug; | |||
41 | int pciehp_poll_mode; | 41 | int pciehp_poll_mode; |
42 | int pciehp_poll_time; | 42 | int pciehp_poll_time; |
43 | int pciehp_force; | 43 | int pciehp_force; |
44 | int pciehp_slot_with_bus; | ||
44 | struct workqueue_struct *pciehp_wq; | 45 | struct workqueue_struct *pciehp_wq; |
45 | 46 | ||
46 | #define DRIVER_VERSION "0.4" | 47 | #define DRIVER_VERSION "0.4" |
@@ -55,10 +56,12 @@ module_param(pciehp_debug, bool, 0644); | |||
55 | module_param(pciehp_poll_mode, bool, 0644); | 56 | module_param(pciehp_poll_mode, bool, 0644); |
56 | module_param(pciehp_poll_time, int, 0644); | 57 | module_param(pciehp_poll_time, int, 0644); |
57 | module_param(pciehp_force, bool, 0644); | 58 | module_param(pciehp_force, bool, 0644); |
59 | module_param(pciehp_slot_with_bus, bool, 0644); | ||
58 | MODULE_PARM_DESC(pciehp_debug, "Debugging mode enabled or not"); | 60 | MODULE_PARM_DESC(pciehp_debug, "Debugging mode enabled or not"); |
59 | MODULE_PARM_DESC(pciehp_poll_mode, "Using polling mechanism for hot-plug events or not"); | 61 | MODULE_PARM_DESC(pciehp_poll_mode, "Using polling mechanism for hot-plug events or not"); |
60 | MODULE_PARM_DESC(pciehp_poll_time, "Polling mechanism frequency, in seconds"); | 62 | MODULE_PARM_DESC(pciehp_poll_time, "Polling mechanism frequency, in seconds"); |
61 | MODULE_PARM_DESC(pciehp_force, "Force pciehp, even if _OSC and OSHP are missing"); | 63 | MODULE_PARM_DESC(pciehp_force, "Force pciehp, even if _OSC and OSHP are missing"); |
64 | MODULE_PARM_DESC(pciehp_slot_with_bus, "Use bus number in the slot name"); | ||
62 | 65 | ||
63 | #define PCIE_MODULE_NAME "pciehp" | 66 | #define PCIE_MODULE_NAME "pciehp" |
64 | 67 | ||
@@ -193,8 +196,12 @@ static void release_slot(struct hotplug_slot *hotplug_slot) | |||
193 | 196 | ||
194 | static void make_slot_name(struct slot *slot) | 197 | static void make_slot_name(struct slot *slot) |
195 | { | 198 | { |
196 | snprintf(slot->hotplug_slot->name, SLOT_NAME_SIZE, "%04d_%04d", | 199 | if (pciehp_slot_with_bus) |
197 | slot->bus, slot->number); | 200 | snprintf(slot->hotplug_slot->name, SLOT_NAME_SIZE, "%04d_%04d", |
201 | slot->bus, slot->number); | ||
202 | else | ||
203 | snprintf(slot->hotplug_slot->name, SLOT_NAME_SIZE, "%d", | ||
204 | slot->number); | ||
198 | } | 205 | } |
199 | 206 | ||
200 | static int init_slots(struct controller *ctrl) | 207 | static int init_slots(struct controller *ctrl) |