summaryrefslogtreecommitdiffstats
path: root/drivers/pci/hotplug/acpiphp_glue.c
diff options
context:
space:
mode:
authorMUNEDA Takahiro2006-03-22 06:49:33 +0100
committerGreg Kroah-Hartman2006-06-19 23:13:22 +0200
commitcde0e5d722c77d1194f40de54a99c90afe365480 (patch)
tree4c569d32f7ff40010e97a1a133bfbabed69e2b7d /drivers/pci/hotplug/acpiphp_glue.c
parent[PATCH] acpiphp: host and p2p hotplug (diff)
downloadkernel-qcow2-linux-cde0e5d722c77d1194f40de54a99c90afe365480.tar.gz
kernel-qcow2-linux-cde0e5d722c77d1194f40de54a99c90afe365480.tar.xz
kernel-qcow2-linux-cde0e5d722c77d1194f40de54a99c90afe365480.zip
[PATCH] acpiphp: turn off slot power at error case
When acpiphp_enable_slot() is failed, acpiphp does not change the slot->flags. Therefore, when user tries to read power status, acpiphp_get_power_status() returns the enable status whether the slot is not really enabled. This patch fixes this BUG. Signed-off-by: MUNEDA Takahiro <muneda.takahiro@jp.fujitsu.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/pci/hotplug/acpiphp_glue.c')
-rw-r--r--drivers/pci/hotplug/acpiphp_glue.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c
index bbe27c16bc3d..610a530232ff 100644
--- a/drivers/pci/hotplug/acpiphp_glue.c
+++ b/drivers/pci/hotplug/acpiphp_glue.c
@@ -1592,9 +1592,15 @@ int acpiphp_enable_slot(struct acpiphp_slot *slot)
if (retval)
goto err_exit;
- if (get_slot_status(slot) == ACPI_STA_ALL)
+ if (get_slot_status(slot) == ACPI_STA_ALL) {
/* configure all functions */
retval = enable_device(slot);
+ if (retval)
+ power_off_slot(slot);
+ } else {
+ dbg("%s: Slot status is not ACPI_STA_ALL\n", __FUNCTION__);
+ power_off_slot(slot);
+ }
err_exit:
mutex_unlock(&slot->crit_sect);