Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 119347
b: refs/heads/master
c: 65df784
h: refs/heads/master
i:
  119345: a901f47
  119343: f0851ba
v: v3
  • Loading branch information
Rafael J. Wysocki authored and Len Brown committed Nov 26, 2008
1 parent b90f7e5 commit c57fc7d
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 40599072dca3ec7d4c9ff8271978be169f974638
refs/heads/master: 65df78473ffbf3bff5e2034df1638acc4f3ddd50
40 changes: 39 additions & 1 deletion trunk/drivers/acpi/sleep/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,18 @@ void __init acpi_old_suspend_ordering(void)
old_suspend_ordering = true;
}

/*
* According to the ACPI specification the BIOS should make sure that ACPI is
* enabled and SCI_EN bit is set on wake-up from S1 - S3 sleep states. Still,
* some BIOSes don't do that and therefore we use acpi_enable() to enable ACPI
* on such systems during resume. Unfortunately that doesn't help in
* particularly pathological cases in which SCI_EN has to be set directly on
* resume, although the specification states very clearly that this flag is
* owned by the hardware. The set_sci_en_on_resume variable will be set in such
* cases.
*/
static bool set_sci_en_on_resume;

/**
* acpi_pm_disable_gpes - Disable the GPEs.
*/
Expand Down Expand Up @@ -235,7 +247,11 @@ static int acpi_suspend_enter(suspend_state_t pm_state)
}

/* If ACPI is not enabled by the BIOS, we need to enable it here. */
acpi_enable();
if (set_sci_en_on_resume)
acpi_set_register(ACPI_BITREG_SCI_ENABLE, 1);
else
acpi_enable();

/* Reprogram control registers and execute _BFS */
acpi_leave_sleep_state_prep(acpi_state);

Expand Down Expand Up @@ -323,6 +339,12 @@ static int __init init_old_suspend_ordering(const struct dmi_system_id *d)
return 0;
}

static int __init init_set_sci_en_on_resume(const struct dmi_system_id *d)
{
set_sci_en_on_resume = true;
return 0;
}

static struct dmi_system_id __initdata acpisleep_dmi_table[] = {
{
.callback = init_old_suspend_ordering,
Expand All @@ -340,6 +362,22 @@ static struct dmi_system_id __initdata acpisleep_dmi_table[] = {
DMI_MATCH(DMI_PRODUCT_NAME, "HP xw4600 Workstation"),
},
},
{
.callback = init_set_sci_en_on_resume,
.ident = "Apple MacBook 1,1",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "Apple Computer, Inc."),
DMI_MATCH(DMI_PRODUCT_NAME, "MacBook1,1"),
},
},
{
.callback = init_set_sci_en_on_resume,
.ident = "Apple MacMini 1,1",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "Apple Computer, Inc."),
DMI_MATCH(DMI_PRODUCT_NAME, "Macmini1,1"),
},
},
{},
};
#endif /* CONFIG_SUSPEND */
Expand Down

0 comments on commit c57fc7d

Please sign in to comment.