diff options
author | Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com> | 2008-04-25 17:39:06 -0400 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2008-04-25 17:39:06 -0400 |
commit | ae416e6b2936fdb70aeee6eb9066115d4521daa6 (patch) | |
tree | 697673ed483f1d39e654b54081eb5306df41e91a /drivers/pci/hotplug/pciehp_core.c | |
parent | c27fb883dffe11aa4cb35ecea1fa1832ba45d4da (diff) |
pciehp: Fix wrong slot capability check
Current pciehp saves only 8bits of Slot Capability registers in
ctrl->ctrlcap. But it refers more than 8bit for checking EMI capability.
It is clearly a bug and EMI would never work. To fix this problem,
this patch saves full Slot Capability contens in ctrl->slot_cap. It also
reduce the redundant reads of Slot Capability register. And this pach
also cleans up the macros to check the slot capabilitys (e.g. MRL_SENS(),
and so on).
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/hotplug/pciehp_core.c')
-rw-r--r-- | drivers/pci/hotplug/pciehp_core.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/pci/hotplug/pciehp_core.c b/drivers/pci/hotplug/pciehp_core.c index cf36f2355173..43d8ddb2d679 100644 --- a/drivers/pci/hotplug/pciehp_core.c +++ b/drivers/pci/hotplug/pciehp_core.c | |||
@@ -258,7 +258,7 @@ static int init_slots(struct controller *ctrl) | |||
258 | goto error_info; | 258 | goto error_info; |
259 | } | 259 | } |
260 | /* create additional sysfs entries */ | 260 | /* create additional sysfs entries */ |
261 | if (EMI(ctrl->ctrlcap)) { | 261 | if (EMI(ctrl)) { |
262 | retval = sysfs_create_file(&hotplug_slot->kobj, | 262 | retval = sysfs_create_file(&hotplug_slot->kobj, |
263 | &hotplug_slot_attr_lock.attr); | 263 | &hotplug_slot_attr_lock.attr); |
264 | if (retval) { | 264 | if (retval) { |
@@ -291,7 +291,7 @@ static void cleanup_slots(struct controller *ctrl) | |||
291 | list_for_each_safe(tmp, next, &ctrl->slot_list) { | 291 | list_for_each_safe(tmp, next, &ctrl->slot_list) { |
292 | slot = list_entry(tmp, struct slot, slot_list); | 292 | slot = list_entry(tmp, struct slot, slot_list); |
293 | list_del(&slot->slot_list); | 293 | list_del(&slot->slot_list); |
294 | if (EMI(ctrl->ctrlcap)) | 294 | if (EMI(ctrl)) |
295 | sysfs_remove_file(&slot->hotplug_slot->kobj, | 295 | sysfs_remove_file(&slot->hotplug_slot->kobj, |
296 | &hotplug_slot_attr_lock.attr); | 296 | &hotplug_slot_attr_lock.attr); |
297 | cancel_delayed_work(&slot->work); | 297 | cancel_delayed_work(&slot->work); |
@@ -312,7 +312,7 @@ static int set_attention_status(struct hotplug_slot *hotplug_slot, u8 status) | |||
312 | 312 | ||
313 | hotplug_slot->info->attention_status = status; | 313 | hotplug_slot->info->attention_status = status; |
314 | 314 | ||
315 | if (ATTN_LED(slot->ctrl->ctrlcap)) | 315 | if (ATTN_LED(slot->ctrl)) |
316 | slot->hpc_ops->set_attention_status(slot, status); | 316 | slot->hpc_ops->set_attention_status(slot, status); |
317 | 317 | ||
318 | return 0; | 318 | return 0; |
@@ -479,7 +479,7 @@ static int pciehp_probe(struct pcie_device *dev, const struct pcie_port_service_ | |||
479 | if (rc) /* -ENODEV: shouldn't happen, but deal with it */ | 479 | if (rc) /* -ENODEV: shouldn't happen, but deal with it */ |
480 | value = 0; | 480 | value = 0; |
481 | } | 481 | } |
482 | if ((POWER_CTRL(ctrl->ctrlcap)) && !value) { | 482 | if ((POWER_CTRL(ctrl)) && !value) { |
483 | rc = t_slot->hpc_ops->power_off_slot(t_slot); /* Power off slot if not occupied*/ | 483 | rc = t_slot->hpc_ops->power_off_slot(t_slot); /* Power off slot if not occupied*/ |
484 | if (rc) | 484 | if (rc) |
485 | goto err_out_free_ctrl_slot; | 485 | goto err_out_free_ctrl_slot; |