Skip to content

Commit

Permalink
PCI: hotplug: acpiphp: fix slot poweroff problem on systems without _PS3
Browse files Browse the repository at this point in the history
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 <[email protected]>
Cc: <[email protected]>
Signed-off-by: Kristen Carlson Accardi <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
Gary Hade authored and gregkh committed Jul 11, 2007
1 parent 5b57a6c commit bfceafc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions drivers/pci/hotplug/acpiphp.h
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ typedef int (*acpiphp_callback)(struct acpiphp_slot *slot, void *data);

extern int acpiphp_enable_slot (struct acpiphp_slot *slot);
extern int acpiphp_disable_slot (struct acpiphp_slot *slot);
extern int acpiphp_eject_slot (struct acpiphp_slot *slot);
extern u8 acpiphp_get_power_status (struct acpiphp_slot *slot);
extern u8 acpiphp_get_attention_status (struct acpiphp_slot *slot);
extern u8 acpiphp_get_latch_status (struct acpiphp_slot *slot);
Expand Down
6 changes: 5 additions & 1 deletion drivers/pci/hotplug/acpiphp_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,15 @@ static int enable_slot(struct hotplug_slot *hotplug_slot)
static int disable_slot(struct hotplug_slot *hotplug_slot)
{
struct slot *slot = hotplug_slot->private;
int retval;

dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);

/* disable the specified slot */
return acpiphp_disable_slot(slot->acpi_slot);
retval = acpiphp_disable_slot(slot->acpi_slot);
if (!retval)
retval = acpiphp_eject_slot(slot->acpi_slot);
return retval;
}


Expand Down
2 changes: 1 addition & 1 deletion drivers/pci/hotplug/acpiphp_glue.c
Original file line number Diff line number Diff line change
Expand Up @@ -1282,7 +1282,7 @@ static unsigned int get_slot_status(struct acpiphp_slot *slot)
/**
* acpiphp_eject_slot - physically eject the slot
*/
static int acpiphp_eject_slot(struct acpiphp_slot *slot)
int acpiphp_eject_slot(struct acpiphp_slot *slot)
{
acpi_status status;
struct acpiphp_func *func;
Expand Down

0 comments on commit bfceafc

Please sign in to comment.