diff options
author | Zhang Rui <rui.zhang@intel.com> | 2012-11-30 06:57:03 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2012-11-30 06:57:03 -0500 |
commit | 0ac1b1d7b7424cd6f129b5454b504b3cae746f0e (patch) | |
tree | 4c7fa40838086b221ebf51c6d55df814ce32fa31 /drivers/acpi | |
parent | 261cba2deb7d3bebd180c35d5dbf8961f6e9afc4 (diff) |
ACPI: do acpisleep dmi check when CONFIG_ACPI_SLEEP is set
The current acpisleep DMI checks only run when CONFIG_SUSPEND is set.
And this may break hibernation on some platforms when CONFIG_SUSPEND
is cleared.
Move acpisleep DMI check into #ifdef CONFIG_ACPI_SLEEP instead.
[rjw: Added acpi_sleep_dmi_check() and rebased on top of earlier
patches adding entries to acpisleep_dmi_table[].]
References: https://bugzilla.kernel.org/show_bug.cgi?id=45921
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r-- | drivers/acpi/sleep.c | 348 |
1 files changed, 177 insertions, 171 deletions
diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c index 1463c56092c4..6efef87b405c 100644 --- a/drivers/acpi/sleep.c +++ b/drivers/acpi/sleep.c | |||
@@ -124,6 +124,180 @@ void __init acpi_old_suspend_ordering(void) | |||
124 | old_suspend_ordering = true; | 124 | old_suspend_ordering = true; |
125 | } | 125 | } |
126 | 126 | ||
127 | static int __init init_old_suspend_ordering(const struct dmi_system_id *d) | ||
128 | { | ||
129 | acpi_old_suspend_ordering(); | ||
130 | return 0; | ||
131 | } | ||
132 | |||
133 | static int __init init_nvs_nosave(const struct dmi_system_id *d) | ||
134 | { | ||
135 | acpi_nvs_nosave(); | ||
136 | return 0; | ||
137 | } | ||
138 | |||
139 | static struct dmi_system_id __initdata acpisleep_dmi_table[] = { | ||
140 | { | ||
141 | .callback = init_old_suspend_ordering, | ||
142 | .ident = "Abit KN9 (nForce4 variant)", | ||
143 | .matches = { | ||
144 | DMI_MATCH(DMI_BOARD_VENDOR, "http://www.abit.com.tw/"), | ||
145 | DMI_MATCH(DMI_BOARD_NAME, "KN9 Series(NF-CK804)"), | ||
146 | }, | ||
147 | }, | ||
148 | { | ||
149 | .callback = init_old_suspend_ordering, | ||
150 | .ident = "HP xw4600 Workstation", | ||
151 | .matches = { | ||
152 | DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), | ||
153 | DMI_MATCH(DMI_PRODUCT_NAME, "HP xw4600 Workstation"), | ||
154 | }, | ||
155 | }, | ||
156 | { | ||
157 | .callback = init_old_suspend_ordering, | ||
158 | .ident = "Asus Pundit P1-AH2 (M2N8L motherboard)", | ||
159 | .matches = { | ||
160 | DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTek Computer INC."), | ||
161 | DMI_MATCH(DMI_BOARD_NAME, "M2N8L"), | ||
162 | }, | ||
163 | }, | ||
164 | { | ||
165 | .callback = init_old_suspend_ordering, | ||
166 | .ident = "Panasonic CF51-2L", | ||
167 | .matches = { | ||
168 | DMI_MATCH(DMI_BOARD_VENDOR, | ||
169 | "Matsushita Electric Industrial Co.,Ltd."), | ||
170 | DMI_MATCH(DMI_BOARD_NAME, "CF51-2L"), | ||
171 | }, | ||
172 | }, | ||
173 | { | ||
174 | .callback = init_nvs_nosave, | ||
175 | .ident = "Sony Vaio VGN-FW21E", | ||
176 | .matches = { | ||
177 | DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"), | ||
178 | DMI_MATCH(DMI_PRODUCT_NAME, "VGN-FW21E"), | ||
179 | }, | ||
180 | }, | ||
181 | { | ||
182 | .callback = init_nvs_nosave, | ||
183 | .ident = "Sony Vaio VPCEB17FX", | ||
184 | .matches = { | ||
185 | DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"), | ||
186 | DMI_MATCH(DMI_PRODUCT_NAME, "VPCEB17FX"), | ||
187 | }, | ||
188 | }, | ||
189 | { | ||
190 | .callback = init_nvs_nosave, | ||
191 | .ident = "Sony Vaio VGN-SR11M", | ||
192 | .matches = { | ||
193 | DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"), | ||
194 | DMI_MATCH(DMI_PRODUCT_NAME, "VGN-SR11M"), | ||
195 | }, | ||
196 | }, | ||
197 | { | ||
198 | .callback = init_nvs_nosave, | ||
199 | .ident = "Everex StepNote Series", | ||
200 | .matches = { | ||
201 | DMI_MATCH(DMI_SYS_VENDOR, "Everex Systems, Inc."), | ||
202 | DMI_MATCH(DMI_PRODUCT_NAME, "Everex StepNote Series"), | ||
203 | }, | ||
204 | }, | ||
205 | { | ||
206 | .callback = init_nvs_nosave, | ||
207 | .ident = "Sony Vaio VPCEB1Z1E", | ||
208 | .matches = { | ||
209 | DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"), | ||
210 | DMI_MATCH(DMI_PRODUCT_NAME, "VPCEB1Z1E"), | ||
211 | }, | ||
212 | }, | ||
213 | { | ||
214 | .callback = init_nvs_nosave, | ||
215 | .ident = "Sony Vaio VGN-NW130D", | ||
216 | .matches = { | ||
217 | DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"), | ||
218 | DMI_MATCH(DMI_PRODUCT_NAME, "VGN-NW130D"), | ||
219 | }, | ||
220 | }, | ||
221 | { | ||
222 | .callback = init_nvs_nosave, | ||
223 | .ident = "Sony Vaio VPCCW29FX", | ||
224 | .matches = { | ||
225 | DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"), | ||
226 | DMI_MATCH(DMI_PRODUCT_NAME, "VPCCW29FX"), | ||
227 | }, | ||
228 | }, | ||
229 | { | ||
230 | .callback = init_nvs_nosave, | ||
231 | .ident = "Averatec AV1020-ED2", | ||
232 | .matches = { | ||
233 | DMI_MATCH(DMI_SYS_VENDOR, "AVERATEC"), | ||
234 | DMI_MATCH(DMI_PRODUCT_NAME, "1000 Series"), | ||
235 | }, | ||
236 | }, | ||
237 | { | ||
238 | .callback = init_old_suspend_ordering, | ||
239 | .ident = "Asus A8N-SLI DELUXE", | ||
240 | .matches = { | ||
241 | DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."), | ||
242 | DMI_MATCH(DMI_BOARD_NAME, "A8N-SLI DELUXE"), | ||
243 | }, | ||
244 | }, | ||
245 | { | ||
246 | .callback = init_old_suspend_ordering, | ||
247 | .ident = "Asus A8N-SLI Premium", | ||
248 | .matches = { | ||
249 | DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."), | ||
250 | DMI_MATCH(DMI_BOARD_NAME, "A8N-SLI Premium"), | ||
251 | }, | ||
252 | }, | ||
253 | { | ||
254 | .callback = init_nvs_nosave, | ||
255 | .ident = "Sony Vaio VGN-SR26GN_P", | ||
256 | .matches = { | ||
257 | DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"), | ||
258 | DMI_MATCH(DMI_PRODUCT_NAME, "VGN-SR26GN_P"), | ||
259 | }, | ||
260 | }, | ||
261 | { | ||
262 | .callback = init_nvs_nosave, | ||
263 | .ident = "Sony Vaio VPCEB1S1E", | ||
264 | .matches = { | ||
265 | DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"), | ||
266 | DMI_MATCH(DMI_PRODUCT_NAME, "VPCEB1S1E"), | ||
267 | }, | ||
268 | }, | ||
269 | { | ||
270 | .callback = init_nvs_nosave, | ||
271 | .ident = "Sony Vaio VGN-FW520F", | ||
272 | .matches = { | ||
273 | DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"), | ||
274 | DMI_MATCH(DMI_PRODUCT_NAME, "VGN-FW520F"), | ||
275 | }, | ||
276 | }, | ||
277 | { | ||
278 | .callback = init_nvs_nosave, | ||
279 | .ident = "Asus K54C", | ||
280 | .matches = { | ||
281 | DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK Computer Inc."), | ||
282 | DMI_MATCH(DMI_PRODUCT_NAME, "K54C"), | ||
283 | }, | ||
284 | }, | ||
285 | { | ||
286 | .callback = init_nvs_nosave, | ||
287 | .ident = "Asus K54HR", | ||
288 | .matches = { | ||
289 | DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK Computer Inc."), | ||
290 | DMI_MATCH(DMI_PRODUCT_NAME, "K54HR"), | ||
291 | }, | ||
292 | }, | ||
293 | {}, | ||
294 | }; | ||
295 | |||
296 | static void acpi_sleep_dmi_check(void) | ||
297 | { | ||
298 | dmi_check_system(acpisleep_dmi_table); | ||
299 | } | ||
300 | |||
127 | /** | 301 | /** |
128 | * acpi_pm_freeze - Disable the GPEs and suspend EC transactions. | 302 | * acpi_pm_freeze - Disable the GPEs and suspend EC transactions. |
129 | */ | 303 | */ |
@@ -239,6 +413,7 @@ static void acpi_pm_end(void) | |||
239 | } | 413 | } |
240 | #else /* !CONFIG_ACPI_SLEEP */ | 414 | #else /* !CONFIG_ACPI_SLEEP */ |
241 | #define acpi_target_sleep_state ACPI_STATE_S0 | 415 | #define acpi_target_sleep_state ACPI_STATE_S0 |
416 | static inline void acpi_sleep_dmi_check(void) {} | ||
242 | #endif /* CONFIG_ACPI_SLEEP */ | 417 | #endif /* CONFIG_ACPI_SLEEP */ |
243 | 418 | ||
244 | #ifdef CONFIG_SUSPEND | 419 | #ifdef CONFIG_SUSPEND |
@@ -397,175 +572,6 @@ static const struct platform_suspend_ops acpi_suspend_ops_old = { | |||
397 | .end = acpi_pm_end, | 572 | .end = acpi_pm_end, |
398 | .recover = acpi_pm_finish, | 573 | .recover = acpi_pm_finish, |
399 | }; | 574 | }; |
400 | |||
401 | static int __init init_old_suspend_ordering(const struct dmi_system_id *d) | ||
402 | { | ||
403 | old_suspend_ordering = true; | ||
404 | return 0; | ||
405 | } | ||
406 | |||
407 | static int __init init_nvs_nosave(const struct dmi_system_id *d) | ||
408 | { | ||
409 | acpi_nvs_nosave(); | ||
410 | return 0; | ||
411 | } | ||
412 | |||
413 | static struct dmi_system_id __initdata acpisleep_dmi_table[] = { | ||
414 | { | ||
415 | .callback = init_old_suspend_ordering, | ||
416 | .ident = "Abit KN9 (nForce4 variant)", | ||
417 | .matches = { | ||
418 | DMI_MATCH(DMI_BOARD_VENDOR, "http://www.abit.com.tw/"), | ||
419 | DMI_MATCH(DMI_BOARD_NAME, "KN9 Series(NF-CK804)"), | ||
420 | }, | ||
421 | }, | ||
422 | { | ||
423 | .callback = init_old_suspend_ordering, | ||
424 | .ident = "HP xw4600 Workstation", | ||
425 | .matches = { | ||
426 | DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), | ||
427 | DMI_MATCH(DMI_PRODUCT_NAME, "HP xw4600 Workstation"), | ||
428 | }, | ||
429 | }, | ||
430 | { | ||
431 | .callback = init_old_suspend_ordering, | ||
432 | .ident = "Asus Pundit P1-AH2 (M2N8L motherboard)", | ||
433 | .matches = { | ||
434 | DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTek Computer INC."), | ||
435 | DMI_MATCH(DMI_BOARD_NAME, "M2N8L"), | ||
436 | }, | ||
437 | }, | ||
438 | { | ||
439 | .callback = init_old_suspend_ordering, | ||
440 | .ident = "Panasonic CF51-2L", | ||
441 | .matches = { | ||
442 | DMI_MATCH(DMI_BOARD_VENDOR, | ||
443 | "Matsushita Electric Industrial Co.,Ltd."), | ||
444 | DMI_MATCH(DMI_BOARD_NAME, "CF51-2L"), | ||
445 | }, | ||
446 | }, | ||
447 | { | ||
448 | .callback = init_nvs_nosave, | ||
449 | .ident = "Sony Vaio VGN-FW21E", | ||
450 | .matches = { | ||
451 | DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"), | ||
452 | DMI_MATCH(DMI_PRODUCT_NAME, "VGN-FW21E"), | ||
453 | }, | ||
454 | }, | ||
455 | { | ||
456 | .callback = init_nvs_nosave, | ||
457 | .ident = "Sony Vaio VPCEB17FX", | ||
458 | .matches = { | ||
459 | DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"), | ||
460 | DMI_MATCH(DMI_PRODUCT_NAME, "VPCEB17FX"), | ||
461 | }, | ||
462 | }, | ||
463 | { | ||
464 | .callback = init_nvs_nosave, | ||
465 | .ident = "Sony Vaio VGN-SR11M", | ||
466 | .matches = { | ||
467 | DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"), | ||
468 | DMI_MATCH(DMI_PRODUCT_NAME, "VGN-SR11M"), | ||
469 | }, | ||
470 | }, | ||
471 | { | ||
472 | .callback = init_nvs_nosave, | ||
473 | .ident = "Everex StepNote Series", | ||
474 | .matches = { | ||
475 | DMI_MATCH(DMI_SYS_VENDOR, "Everex Systems, Inc."), | ||
476 | DMI_MATCH(DMI_PRODUCT_NAME, "Everex StepNote Series"), | ||
477 | }, | ||
478 | }, | ||
479 | { | ||
480 | .callback = init_nvs_nosave, | ||
481 | .ident = "Sony Vaio VPCEB1Z1E", | ||
482 | .matches = { | ||
483 | DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"), | ||
484 | DMI_MATCH(DMI_PRODUCT_NAME, "VPCEB1Z1E"), | ||
485 | }, | ||
486 | }, | ||
487 | { | ||
488 | .callback = init_nvs_nosave, | ||
489 | .ident = "Sony Vaio VGN-NW130D", | ||
490 | .matches = { | ||
491 | DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"), | ||
492 | DMI_MATCH(DMI_PRODUCT_NAME, "VGN-NW130D"), | ||
493 | }, | ||
494 | }, | ||
495 | { | ||
496 | .callback = init_nvs_nosave, | ||
497 | .ident = "Sony Vaio VPCCW29FX", | ||
498 | .matches = { | ||
499 | DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"), | ||
500 | DMI_MATCH(DMI_PRODUCT_NAME, "VPCCW29FX"), | ||
501 | }, | ||
502 | }, | ||
503 | { | ||
504 | .callback = init_nvs_nosave, | ||
505 | .ident = "Averatec AV1020-ED2", | ||
506 | .matches = { | ||
507 | DMI_MATCH(DMI_SYS_VENDOR, "AVERATEC"), | ||
508 | DMI_MATCH(DMI_PRODUCT_NAME, "1000 Series"), | ||
509 | }, | ||
510 | }, | ||
511 | { | ||
512 | .callback = init_old_suspend_ordering, | ||
513 | .ident = "Asus A8N-SLI DELUXE", | ||
514 | .matches = { | ||
515 | DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."), | ||
516 | DMI_MATCH(DMI_BOARD_NAME, "A8N-SLI DELUXE"), | ||
517 | }, | ||
518 | }, | ||
519 | { | ||
520 | .callback = init_old_suspend_ordering, | ||
521 | .ident = "Asus A8N-SLI Premium", | ||
522 | .matches = { | ||
523 | DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."), | ||
524 | DMI_MATCH(DMI_BOARD_NAME, "A8N-SLI Premium"), | ||
525 | }, | ||
526 | }, | ||
527 | { | ||
528 | .callback = init_nvs_nosave, | ||
529 | .ident = "Sony Vaio VGN-SR26GN_P", | ||
530 | .matches = { | ||
531 | DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"), | ||
532 | DMI_MATCH(DMI_PRODUCT_NAME, "VGN-SR26GN_P"), | ||
533 | }, | ||
534 | }, | ||
535 | { | ||
536 | .callback = init_nvs_nosave, | ||
537 | .ident = "Sony Vaio VPCEB1S1E", | ||
538 | .matches = { | ||
539 | DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"), | ||
540 | DMI_MATCH(DMI_PRODUCT_NAME, "VPCEB1S1E"), | ||
541 | }, | ||
542 | }, | ||
543 | { | ||
544 | .callback = init_nvs_nosave, | ||
545 | .ident = "Sony Vaio VGN-FW520F", | ||
546 | .matches = { | ||
547 | DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"), | ||
548 | DMI_MATCH(DMI_PRODUCT_NAME, "VGN-FW520F"), | ||
549 | }, | ||
550 | }, | ||
551 | { | ||
552 | .callback = init_nvs_nosave, | ||
553 | .ident = "Asus K54C", | ||
554 | .matches = { | ||
555 | DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK Computer Inc."), | ||
556 | DMI_MATCH(DMI_PRODUCT_NAME, "K54C"), | ||
557 | }, | ||
558 | }, | ||
559 | { | ||
560 | .callback = init_nvs_nosave, | ||
561 | .ident = "Asus K54HR", | ||
562 | .matches = { | ||
563 | DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK Computer Inc."), | ||
564 | DMI_MATCH(DMI_PRODUCT_NAME, "K54HR"), | ||
565 | }, | ||
566 | }, | ||
567 | {}, | ||
568 | }; | ||
569 | #endif /* CONFIG_SUSPEND */ | 575 | #endif /* CONFIG_SUSPEND */ |
570 | 576 | ||
571 | #ifdef CONFIG_HIBERNATION | 577 | #ifdef CONFIG_HIBERNATION |
@@ -896,13 +902,13 @@ int __init acpi_sleep_init(void) | |||
896 | u8 type_a, type_b; | 902 | u8 type_a, type_b; |
897 | #ifdef CONFIG_SUSPEND | 903 | #ifdef CONFIG_SUSPEND |
898 | int i = 0; | 904 | int i = 0; |
899 | |||
900 | dmi_check_system(acpisleep_dmi_table); | ||
901 | #endif | 905 | #endif |
902 | 906 | ||
903 | if (acpi_disabled) | 907 | if (acpi_disabled) |
904 | return 0; | 908 | return 0; |
905 | 909 | ||
910 | acpi_sleep_dmi_check(); | ||
911 | |||
906 | sleep_states[ACPI_STATE_S0] = 1; | 912 | sleep_states[ACPI_STATE_S0] = 1; |
907 | printk(KERN_INFO PREFIX "(supports S0"); | 913 | printk(KERN_INFO PREFIX "(supports S0"); |
908 | 914 | ||