Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

PCI: hotplug: acpiphp: fix slot poweroff problem on systems without _PS3

On systems where the optional _PS3 ACPI object is not implemented
acpiphp fails to power off the slot. This is happening because the
current code does not attempt to remove power using the _EJ0 ACPI
object. This patch restores the _EJ0 evaluation attempt which was
apparently inadvertently removed from the power-off sequence when the
_EJ0 evaluation code was relocated from power_off_slot() to
acpiphp_eject_slot().

Signed-off-by: Gary Hade <garyhade@us.ibm.com>
Cc: <lcm@us.ibm.com>
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by

Gary Hade and committed by
Greg Kroah-Hartman
bfceafc5 5b57a6ce

+7 -2
+1
drivers/pci/hotplug/acpiphp.h
··· 211 211 212 212 extern int acpiphp_enable_slot (struct acpiphp_slot *slot); 213 213 extern int acpiphp_disable_slot (struct acpiphp_slot *slot); 214 + extern int acpiphp_eject_slot (struct acpiphp_slot *slot); 214 215 extern u8 acpiphp_get_power_status (struct acpiphp_slot *slot); 215 216 extern u8 acpiphp_get_attention_status (struct acpiphp_slot *slot); 216 217 extern u8 acpiphp_get_latch_status (struct acpiphp_slot *slot);
+5 -1
drivers/pci/hotplug/acpiphp_core.c
··· 156 156 static int disable_slot(struct hotplug_slot *hotplug_slot) 157 157 { 158 158 struct slot *slot = hotplug_slot->private; 159 + int retval; 159 160 160 161 dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name); 161 162 162 163 /* disable the specified slot */ 163 - return acpiphp_disable_slot(slot->acpi_slot); 164 + retval = acpiphp_disable_slot(slot->acpi_slot); 165 + if (!retval) 166 + retval = acpiphp_eject_slot(slot->acpi_slot); 167 + return retval; 164 168 } 165 169 166 170
+1 -1
drivers/pci/hotplug/acpiphp_glue.c
··· 1282 1282 /** 1283 1283 * acpiphp_eject_slot - physically eject the slot 1284 1284 */ 1285 - static int acpiphp_eject_slot(struct acpiphp_slot *slot) 1285 + int acpiphp_eject_slot(struct acpiphp_slot *slot) 1286 1286 { 1287 1287 acpi_status status; 1288 1288 struct acpiphp_func *func;