aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/sleep.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2012-12-04 07:46:08 -0500
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2012-12-04 07:46:08 -0500
commit6b728f1a906976ec658827adc9c2d27608aa8517 (patch)
treeb60bef25c8258b7b250f1d57ac0722cd742b3c96 /drivers/acpi/sleep.c
parentd9ba1025a46d368bc00a2981cb2b2a918e9209b7 (diff)
parenta6b5e88c0e42093b9057856f35770966c8c591e3 (diff)
Merge branch 'acpi-general'
* acpi-general: ACPI / PNP: Do not crash due to stale pointer use during system resume ACPI / video: Add "Asus UL30VT" to ACPI video detect blacklist ACPI: do acpisleep dmi check when CONFIG_ACPI_SLEEP is set
Diffstat (limited to 'drivers/acpi/sleep.c')
-rw-r--r--drivers/acpi/sleep.c348
1 files changed, 177 insertions, 171 deletions
diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c
index 1e25319164f1..2fcc67d34b11 100644
--- a/drivers/acpi/sleep.c
+++ b/drivers/acpi/sleep.c
@@ -129,6 +129,180 @@ void __init acpi_old_suspend_ordering(void)
129 old_suspend_ordering = true; 129 old_suspend_ordering = true;
130} 130}
131 131
132static int __init init_old_suspend_ordering(const struct dmi_system_id *d)
133{
134 acpi_old_suspend_ordering();
135 return 0;
136}
137
138static int __init init_nvs_nosave(const struct dmi_system_id *d)
139{
140 acpi_nvs_nosave();
141 return 0;
142}
143
144static struct dmi_system_id __initdata acpisleep_dmi_table[] = {
145 {
146 .callback = init_old_suspend_ordering,
147 .ident = "Abit KN9 (nForce4 variant)",
148 .matches = {
149 DMI_MATCH(DMI_BOARD_VENDOR, "http://www.abit.com.tw/"),
150 DMI_MATCH(DMI_BOARD_NAME, "KN9 Series(NF-CK804)"),
151 },
152 },
153 {
154 .callback = init_old_suspend_ordering,
155 .ident = "HP xw4600 Workstation",
156 .matches = {
157 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
158 DMI_MATCH(DMI_PRODUCT_NAME, "HP xw4600 Workstation"),
159 },
160 },
161 {
162 .callback = init_old_suspend_ordering,
163 .ident = "Asus Pundit P1-AH2 (M2N8L motherboard)",
164 .matches = {
165 DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTek Computer INC."),
166 DMI_MATCH(DMI_BOARD_NAME, "M2N8L"),
167 },
168 },
169 {
170 .callback = init_old_suspend_ordering,
171 .ident = "Panasonic CF51-2L",
172 .matches = {
173 DMI_MATCH(DMI_BOARD_VENDOR,
174 "Matsushita Electric Industrial Co.,Ltd."),
175 DMI_MATCH(DMI_BOARD_NAME, "CF51-2L"),
176 },
177 },
178 {
179 .callback = init_nvs_nosave,
180 .ident = "Sony Vaio VGN-FW21E",
181 .matches = {
182 DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
183 DMI_MATCH(DMI_PRODUCT_NAME, "VGN-FW21E"),
184 },
185 },
186 {
187 .callback = init_nvs_nosave,
188 .ident = "Sony Vaio VPCEB17FX",
189 .matches = {
190 DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
191 DMI_MATCH(DMI_PRODUCT_NAME, "VPCEB17FX"),
192 },
193 },
194 {
195 .callback = init_nvs_nosave,
196 .ident = "Sony Vaio VGN-SR11M",
197 .matches = {
198 DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
199 DMI_MATCH(DMI_PRODUCT_NAME, "VGN-SR11M"),
200 },
201 },
202 {
203 .callback = init_nvs_nosave,
204 .ident = "Everex StepNote Series",
205 .matches = {
206 DMI_MATCH(DMI_SYS_VENDOR, "Everex Systems, Inc."),
207 DMI_MATCH(DMI_PRODUCT_NAME, "Everex StepNote Series"),
208 },
209 },
210 {
211 .callback = init_nvs_nosave,
212 .ident = "Sony Vaio VPCEB1Z1E",
213 .matches = {
214 DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
215 DMI_MATCH(DMI_PRODUCT_NAME, "VPCEB1Z1E"),
216 },
217 },
218 {
219 .callback = init_nvs_nosave,
220 .ident = "Sony Vaio VGN-NW130D",
221 .matches = {
222 DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
223 DMI_MATCH(DMI_PRODUCT_NAME, "VGN-NW130D"),
224 },
225 },
226 {
227 .callback = init_nvs_nosave,
228 .ident = "Sony Vaio VPCCW29FX",
229 .matches = {
230 DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
231 DMI_MATCH(DMI_PRODUCT_NAME, "VPCCW29FX"),
232 },
233 },
234 {
235 .callback = init_nvs_nosave,
236 .ident = "Averatec AV1020-ED2",
237 .matches = {
238 DMI_MATCH(DMI_SYS_VENDOR, "AVERATEC"),
239 DMI_MATCH(DMI_PRODUCT_NAME, "1000 Series"),
240 },
241 },
242 {
243 .callback = init_old_suspend_ordering,
244 .ident = "Asus A8N-SLI DELUXE",
245 .matches = {
246 DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."),
247 DMI_MATCH(DMI_BOARD_NAME, "A8N-SLI DELUXE"),
248 },
249 },
250 {
251 .callback = init_old_suspend_ordering,
252 .ident = "Asus A8N-SLI Premium",
253 .matches = {
254 DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."),
255 DMI_MATCH(DMI_BOARD_NAME, "A8N-SLI Premium"),
256 },
257 },
258 {
259 .callback = init_nvs_nosave,
260 .ident = "Sony Vaio VGN-SR26GN_P",
261 .matches = {
262 DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
263 DMI_MATCH(DMI_PRODUCT_NAME, "VGN-SR26GN_P"),
264 },
265 },
266 {
267 .callback = init_nvs_nosave,
268 .ident = "Sony Vaio VPCEB1S1E",
269 .matches = {
270 DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
271 DMI_MATCH(DMI_PRODUCT_NAME, "VPCEB1S1E"),
272 },
273 },
274 {
275 .callback = init_nvs_nosave,
276 .ident = "Sony Vaio VGN-FW520F",
277 .matches = {
278 DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
279 DMI_MATCH(DMI_PRODUCT_NAME, "VGN-FW520F"),
280 },
281 },
282 {
283 .callback = init_nvs_nosave,
284 .ident = "Asus K54C",
285 .matches = {
286 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK Computer Inc."),
287 DMI_MATCH(DMI_PRODUCT_NAME, "K54C"),
288 },
289 },
290 {
291 .callback = init_nvs_nosave,
292 .ident = "Asus K54HR",
293 .matches = {
294 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK Computer Inc."),
295 DMI_MATCH(DMI_PRODUCT_NAME, "K54HR"),
296 },
297 },
298 {},
299};
300
301static void acpi_sleep_dmi_check(void)
302{
303 dmi_check_system(acpisleep_dmi_table);
304}
305
132/** 306/**
133 * acpi_pm_freeze - Disable the GPEs and suspend EC transactions. 307 * acpi_pm_freeze - Disable the GPEs and suspend EC transactions.
134 */ 308 */
@@ -244,6 +418,7 @@ static void acpi_pm_end(void)
244} 418}
245#else /* !CONFIG_ACPI_SLEEP */ 419#else /* !CONFIG_ACPI_SLEEP */
246#define acpi_target_sleep_state ACPI_STATE_S0 420#define acpi_target_sleep_state ACPI_STATE_S0
421static inline void acpi_sleep_dmi_check(void) {}
247#endif /* CONFIG_ACPI_SLEEP */ 422#endif /* CONFIG_ACPI_SLEEP */
248 423
249#ifdef CONFIG_SUSPEND 424#ifdef CONFIG_SUSPEND
@@ -402,175 +577,6 @@ static const struct platform_suspend_ops acpi_suspend_ops_old = {
402 .end = acpi_pm_end, 577 .end = acpi_pm_end,
403 .recover = acpi_pm_finish, 578 .recover = acpi_pm_finish,
404}; 579};
405
406static int __init init_old_suspend_ordering(const struct dmi_system_id *d)
407{
408 old_suspend_ordering = true;
409 return 0;
410}
411
412static int __init init_nvs_nosave(const struct dmi_system_id *d)
413{
414 acpi_nvs_nosave();
415 return 0;
416}
417
418static struct dmi_system_id __initdata acpisleep_dmi_table[] = {
419 {
420 .callback = init_old_suspend_ordering,
421 .ident = "Abit KN9 (nForce4 variant)",
422 .matches = {
423 DMI_MATCH(DMI_BOARD_VENDOR, "http://www.abit.com.tw/"),
424 DMI_MATCH(DMI_BOARD_NAME, "KN9 Series(NF-CK804)"),
425 },
426 },
427 {
428 .callback = init_old_suspend_ordering,
429 .ident = "HP xw4600 Workstation",
430 .matches = {
431 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
432 DMI_MATCH(DMI_PRODUCT_NAME, "HP xw4600 Workstation"),
433 },
434 },
435 {
436 .callback = init_old_suspend_ordering,
437 .ident = "Asus Pundit P1-AH2 (M2N8L motherboard)",
438 .matches = {
439 DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTek Computer INC."),
440 DMI_MATCH(DMI_BOARD_NAME, "M2N8L"),
441 },
442 },
443 {
444 .callback = init_old_suspend_ordering,
445 .ident = "Panasonic CF51-2L",
446 .matches = {
447 DMI_MATCH(DMI_BOARD_VENDOR,
448 "Matsushita Electric Industrial Co.,Ltd."),
449 DMI_MATCH(DMI_BOARD_NAME, "CF51-2L"),
450 },
451 },
452 {
453 .callback = init_nvs_nosave,
454 .ident = "Sony Vaio VGN-FW21E",
455 .matches = {
456 DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
457 DMI_MATCH(DMI_PRODUCT_NAME, "VGN-FW21E"),
458 },
459 },
460 {
461 .callback = init_nvs_nosave,
462 .ident = "Sony Vaio VPCEB17FX",
463 .matches = {
464 DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
465 DMI_MATCH(DMI_PRODUCT_NAME, "VPCEB17FX"),
466 },
467 },
468 {
469 .callback = init_nvs_nosave,
470 .ident = "Sony Vaio VGN-SR11M",
471 .matches = {
472 DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
473 DMI_MATCH(DMI_PRODUCT_NAME, "VGN-SR11M"),
474 },
475 },
476 {
477 .callback = init_nvs_nosave,
478 .ident = "Everex StepNote Series",
479 .matches = {
480 DMI_MATCH(DMI_SYS_VENDOR, "Everex Systems, Inc."),
481 DMI_MATCH(DMI_PRODUCT_NAME, "Everex StepNote Series"),
482 },
483 },
484 {
485 .callback = init_nvs_nosave,
486 .ident = "Sony Vaio VPCEB1Z1E",
487 .matches = {
488 DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
489 DMI_MATCH(DMI_PRODUCT_NAME, "VPCEB1Z1E"),
490 },
491 },
492 {
493 .callback = init_nvs_nosave,
494 .ident = "Sony Vaio VGN-NW130D",
495 .matches = {
496 DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
497 DMI_MATCH(DMI_PRODUCT_NAME, "VGN-NW130D"),
498 },
499 },
500 {
501 .callback = init_nvs_nosave,
502 .ident = "Sony Vaio VPCCW29FX",
503 .matches = {
504 DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
505 DMI_MATCH(DMI_PRODUCT_NAME, "VPCCW29FX"),
506 },
507 },
508 {
509 .callback = init_nvs_nosave,
510 .ident = "Averatec AV1020-ED2",
511 .matches = {
512 DMI_MATCH(DMI_SYS_VENDOR, "AVERATEC"),
513 DMI_MATCH(DMI_PRODUCT_NAME, "1000 Series"),
514 },
515 },
516 {
517 .callback = init_old_suspend_ordering,
518 .ident = "Asus A8N-SLI DELUXE",
519 .matches = {
520 DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."),
521 DMI_MATCH(DMI_BOARD_NAME, "A8N-SLI DELUXE"),
522 },
523 },
524 {
525 .callback = init_old_suspend_ordering,
526 .ident = "Asus A8N-SLI Premium",
527 .matches = {
528 DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."),
529 DMI_MATCH(DMI_BOARD_NAME, "A8N-SLI Premium"),
530 },
531 },
532 {
533 .callback = init_nvs_nosave,
534 .ident = "Sony Vaio VGN-SR26GN_P",
535 .matches = {
536 DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
537 DMI_MATCH(DMI_PRODUCT_NAME, "VGN-SR26GN_P"),
538 },
539 },
540 {
541 .callback = init_nvs_nosave,
542 .ident = "Sony Vaio VPCEB1S1E",
543 .matches = {
544 DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
545 DMI_MATCH(DMI_PRODUCT_NAME, "VPCEB1S1E"),
546 },
547 },
548 {
549 .callback = init_nvs_nosave,
550 .ident = "Sony Vaio VGN-FW520F",
551 .matches = {
552 DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
553 DMI_MATCH(DMI_PRODUCT_NAME, "VGN-FW520F"),
554 },
555 },
556 {
557 .callback = init_nvs_nosave,
558 .ident = "Asus K54C",
559 .matches = {
560 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK Computer Inc."),
561 DMI_MATCH(DMI_PRODUCT_NAME, "K54C"),
562 },
563 },
564 {
565 .callback = init_nvs_nosave,
566 .ident = "Asus K54HR",
567 .matches = {
568 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK Computer Inc."),
569 DMI_MATCH(DMI_PRODUCT_NAME, "K54HR"),
570 },
571 },
572 {},
573};
574#endif /* CONFIG_SUSPEND */ 580#endif /* CONFIG_SUSPEND */
575 581
576#ifdef CONFIG_HIBERNATION 582#ifdef CONFIG_HIBERNATION
@@ -730,13 +736,13 @@ int __init acpi_sleep_init(void)
730 u8 type_a, type_b; 736 u8 type_a, type_b;
731#ifdef CONFIG_SUSPEND 737#ifdef CONFIG_SUSPEND
732 int i = 0; 738 int i = 0;
733
734 dmi_check_system(acpisleep_dmi_table);
735#endif 739#endif
736 740
737 if (acpi_disabled) 741 if (acpi_disabled)
738 return 0; 742 return 0;
739 743
744 acpi_sleep_dmi_check();
745
740 sleep_states[ACPI_STATE_S0] = 1; 746 sleep_states[ACPI_STATE_S0] = 1;
741 printk(KERN_INFO PREFIX "(supports S0"); 747 printk(KERN_INFO PREFIX "(supports S0");
742 748