diff options
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/kexec.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/kernel/kexec.c b/kernel/kexec.c index cf3797b76786..bfbbd120623c 100644 --- a/kernel/kexec.c +++ b/kernel/kexec.c | |||
@@ -1426,11 +1426,9 @@ static int __init crash_save_vmcoreinfo_init(void) | |||
1426 | 1426 | ||
1427 | module_init(crash_save_vmcoreinfo_init) | 1427 | module_init(crash_save_vmcoreinfo_init) |
1428 | 1428 | ||
1429 | /** | 1429 | /* |
1430 | * kernel_kexec - reboot the system | 1430 | * Move into place and start executing a preloaded standalone |
1431 | * | 1431 | * executable. If nothing was preloaded return an error. |
1432 | * Move into place and start executing a preloaded standalone | ||
1433 | * executable. If nothing was preloaded return an error. | ||
1434 | */ | 1432 | */ |
1435 | int kernel_kexec(void) | 1433 | int kernel_kexec(void) |
1436 | { | 1434 | { |
@@ -1443,8 +1441,8 @@ int kernel_kexec(void) | |||
1443 | goto Unlock; | 1441 | goto Unlock; |
1444 | } | 1442 | } |
1445 | 1443 | ||
1446 | if (kexec_image->preserve_context) { | ||
1447 | #ifdef CONFIG_KEXEC_JUMP | 1444 | #ifdef CONFIG_KEXEC_JUMP |
1445 | if (kexec_image->preserve_context) { | ||
1448 | mutex_lock(&pm_mutex); | 1446 | mutex_lock(&pm_mutex); |
1449 | pm_prepare_console(); | 1447 | pm_prepare_console(); |
1450 | error = freeze_processes(); | 1448 | error = freeze_processes(); |
@@ -1471,8 +1469,9 @@ int kernel_kexec(void) | |||
1471 | if (error) | 1469 | if (error) |
1472 | goto Enable_irqs; | 1470 | goto Enable_irqs; |
1473 | save_processor_state(); | 1471 | save_processor_state(); |
1472 | } else | ||
1474 | #endif | 1473 | #endif |
1475 | } else { | 1474 | { |
1476 | blocking_notifier_call_chain(&reboot_notifier_list, | 1475 | blocking_notifier_call_chain(&reboot_notifier_list, |
1477 | SYS_RESTART, NULL); | 1476 | SYS_RESTART, NULL); |
1478 | system_state = SYSTEM_RESTART; | 1477 | system_state = SYSTEM_RESTART; |
@@ -1484,8 +1483,8 @@ int kernel_kexec(void) | |||
1484 | 1483 | ||
1485 | machine_kexec(kexec_image); | 1484 | machine_kexec(kexec_image); |
1486 | 1485 | ||
1487 | if (kexec_image->preserve_context) { | ||
1488 | #ifdef CONFIG_KEXEC_JUMP | 1486 | #ifdef CONFIG_KEXEC_JUMP |
1487 | if (kexec_image->preserve_context) { | ||
1489 | restore_processor_state(); | 1488 | restore_processor_state(); |
1490 | device_power_up(PMSG_RESTORE); | 1489 | device_power_up(PMSG_RESTORE); |
1491 | Enable_irqs: | 1490 | Enable_irqs: |
@@ -1499,8 +1498,8 @@ int kernel_kexec(void) | |||
1499 | Restore_console: | 1498 | Restore_console: |
1500 | pm_restore_console(); | 1499 | pm_restore_console(); |
1501 | mutex_unlock(&pm_mutex); | 1500 | mutex_unlock(&pm_mutex); |
1502 | #endif | ||
1503 | } | 1501 | } |
1502 | #endif | ||
1504 | 1503 | ||
1505 | Unlock: | 1504 | Unlock: |
1506 | if (!xchg(&kexec_lock, 0)) | 1505 | if (!xchg(&kexec_lock, 0)) |