diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-28 17:42:18 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-28 17:42:18 -0400 |
commit | 9a90e09854a3c7cc603ab8fc9163f77bb1f66cfa (patch) | |
tree | c8c5f767dd2351c9db440f003cc14401583bafd3 /drivers/acpi/acpica | |
parent | d372e7fe4698bde3a00b718f7901a0025dda47ef (diff) | |
parent | d3b383338f105f50724c10a7d81b04a3930e886b (diff) |
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6
* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6: (27 commits)
ACPI: Don't let acpi_pad needlessly mark TSC unstable
drivers/acpi/sleep.h: Checkpatch cleanup
ACPI: Minor cleanup eliminating redundant PMTIMER_TICKS to NS conversion
ACPI: delete unused c-state promotion/demotion data strucutures
ACPI: video: fix acpi_backlight=video
ACPI: EC: Use kmemdup
drivers/acpi: use kasprintf
ACPI, APEI, EINJ injection parameters support
Add x64 support to debugfs
ACPI, APEI, Use ERST for persistent storage of MCE
ACPI, APEI, Error Record Serialization Table (ERST) support
ACPI, APEI, Generic Hardware Error Source memory error support
ACPI, APEI, UEFI Common Platform Error Record (CPER) header
Unified UUID/GUID definition
ACPI Hardware Error Device (PNP0C33) support
ACPI, APEI, PCIE AER, use general HEST table parsing in AER firmware_first setup
ACPI, APEI, Document for APEI
ACPI, APEI, EINJ support
ACPI, APEI, HEST table parsing
ACPI, APEI, APEI supporting infrastructure
...
Diffstat (limited to 'drivers/acpi/acpica')
-rw-r--r-- | drivers/acpi/acpica/evxfevnt.c | 33 | ||||
-rw-r--r-- | drivers/acpi/acpica/hwacpi.c | 20 |
2 files changed, 22 insertions, 31 deletions
diff --git a/drivers/acpi/acpica/evxfevnt.c b/drivers/acpi/acpica/evxfevnt.c index 7c7bbb4d402c..d5a5efc043bf 100644 --- a/drivers/acpi/acpica/evxfevnt.c +++ b/drivers/acpi/acpica/evxfevnt.c | |||
@@ -69,7 +69,7 @@ acpi_ev_get_gpe_device(struct acpi_gpe_xrupt_info *gpe_xrupt_info, | |||
69 | 69 | ||
70 | acpi_status acpi_enable(void) | 70 | acpi_status acpi_enable(void) |
71 | { | 71 | { |
72 | acpi_status status = AE_OK; | 72 | acpi_status status; |
73 | 73 | ||
74 | ACPI_FUNCTION_TRACE(acpi_enable); | 74 | ACPI_FUNCTION_TRACE(acpi_enable); |
75 | 75 | ||
@@ -84,21 +84,30 @@ acpi_status acpi_enable(void) | |||
84 | if (acpi_hw_get_mode() == ACPI_SYS_MODE_ACPI) { | 84 | if (acpi_hw_get_mode() == ACPI_SYS_MODE_ACPI) { |
85 | ACPI_DEBUG_PRINT((ACPI_DB_INIT, | 85 | ACPI_DEBUG_PRINT((ACPI_DB_INIT, |
86 | "System is already in ACPI mode\n")); | 86 | "System is already in ACPI mode\n")); |
87 | } else { | 87 | return_ACPI_STATUS(AE_OK); |
88 | /* Transition to ACPI mode */ | 88 | } |
89 | 89 | ||
90 | status = acpi_hw_set_mode(ACPI_SYS_MODE_ACPI); | 90 | /* Transition to ACPI mode */ |
91 | if (ACPI_FAILURE(status)) { | ||
92 | ACPI_ERROR((AE_INFO, | ||
93 | "Could not transition to ACPI mode")); | ||
94 | return_ACPI_STATUS(status); | ||
95 | } | ||
96 | 91 | ||
97 | ACPI_DEBUG_PRINT((ACPI_DB_INIT, | 92 | status = acpi_hw_set_mode(ACPI_SYS_MODE_ACPI); |
98 | "Transition to ACPI mode successful\n")); | 93 | if (ACPI_FAILURE(status)) { |
94 | ACPI_ERROR((AE_INFO, | ||
95 | "Could not transition to ACPI mode")); | ||
96 | return_ACPI_STATUS(status); | ||
99 | } | 97 | } |
100 | 98 | ||
101 | return_ACPI_STATUS(status); | 99 | /* Sanity check that transition succeeded */ |
100 | |||
101 | if (acpi_hw_get_mode() != ACPI_SYS_MODE_ACPI) { | ||
102 | ACPI_ERROR((AE_INFO, | ||
103 | "Hardware did not enter ACPI mode")); | ||
104 | return_ACPI_STATUS(AE_NO_HARDWARE_RESPONSE); | ||
105 | } | ||
106 | |||
107 | ACPI_DEBUG_PRINT((ACPI_DB_INIT, | ||
108 | "Transition to ACPI mode successful\n")); | ||
109 | |||
110 | return_ACPI_STATUS(AE_OK); | ||
102 | } | 111 | } |
103 | 112 | ||
104 | ACPI_EXPORT_SYMBOL(acpi_enable) | 113 | ACPI_EXPORT_SYMBOL(acpi_enable) |
diff --git a/drivers/acpi/acpica/hwacpi.c b/drivers/acpi/acpica/hwacpi.c index 679a112a7d26..b44274a0b62c 100644 --- a/drivers/acpi/acpica/hwacpi.c +++ b/drivers/acpi/acpica/hwacpi.c | |||
@@ -63,7 +63,6 @@ acpi_status acpi_hw_set_mode(u32 mode) | |||
63 | { | 63 | { |
64 | 64 | ||
65 | acpi_status status; | 65 | acpi_status status; |
66 | u32 retry; | ||
67 | 66 | ||
68 | ACPI_FUNCTION_TRACE(hw_set_mode); | 67 | ACPI_FUNCTION_TRACE(hw_set_mode); |
69 | 68 | ||
@@ -125,24 +124,7 @@ acpi_status acpi_hw_set_mode(u32 mode) | |||
125 | return_ACPI_STATUS(status); | 124 | return_ACPI_STATUS(status); |
126 | } | 125 | } |
127 | 126 | ||
128 | /* | 127 | return_ACPI_STATUS(AE_OK); |
129 | * Some hardware takes a LONG time to switch modes. Give them 3 sec to | ||
130 | * do so, but allow faster systems to proceed more quickly. | ||
131 | */ | ||
132 | retry = 3000; | ||
133 | while (retry) { | ||
134 | if (acpi_hw_get_mode() == mode) { | ||
135 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, | ||
136 | "Mode %X successfully enabled\n", | ||
137 | mode)); | ||
138 | return_ACPI_STATUS(AE_OK); | ||
139 | } | ||
140 | acpi_os_stall(1000); | ||
141 | retry--; | ||
142 | } | ||
143 | |||
144 | ACPI_ERROR((AE_INFO, "Hardware did not change modes")); | ||
145 | return_ACPI_STATUS(AE_NO_HARDWARE_RESPONSE); | ||
146 | } | 128 | } |
147 | 129 | ||
148 | /******************************************************************************* | 130 | /******************************************************************************* |