summaryrefslogtreecommitdiff
path: root/kernel/power/console.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2025-07-22 17:49:34 +0200
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2025-07-22 17:49:34 +0200
commitc4930d6dba025a5d6035b18350120a540c68dc25 (patch)
tree970a18573592d6fac2431ce24585a79faf462aa8 /kernel/power/console.c
parent987c420c2e760aeb227811a1d3827e26a47da81e (diff)
parentf633c1a236df95ab927f1919b3be2619c8cc6733 (diff)
Merge branch 'pm-sleep'
Merge updates related to system sleep for 6.17-rc1: - Extend the asynchronous suspend and resume of devices to handle suppliers like parents and consumers like children (Rafael Wysocki) - Make pm_runtime_force_resume() work for drivers that set the DPM_FLAG_SMART_SUSPEND flag and allow PCI drivers and drivers that collaborate with the general ACPI PM domain to set it (Rafael Wysocki) - Add kernel parameter to disable asynchronous suspend/resume of devices (Tudor Ambarus) - Drop redundant might_sleep() calls from some functions in the device suspend/resume core code (Zhongqiu Han) - Fix the handling of monitors connected right before waking up the system from sleep (tuhaowen) - Clean up MAINTAINERS entries for suspend and hibernation (Rafael Wysocki) - Fix error code path in the KEXEC_JUMP flow and drop a redundant pm_restore_gfp_mask() call from it (Rafael Wysocki) - Rearrange suspend/resume error handling in the core device suspend and resume code (Rafael Wysocki) - Fix up white space that does not follow coding style in the hibernation core code (Darshan Rathod) * pm-sleep: PM: hibernate: Fix up white space that does not follow coding style PM: sleep: Rearrange suspend/resume error handling in the core kexec_core: Drop redundant pm_restore_gfp_mask() call kexec_core: Fix error code path in the KEXEC_JUMP flow PM: sleep: Clean up MAINTAINERS entries for suspend and hibernation PM: sleep: add kernel parameter to disable asynchronous suspend/resume PCI/PM: Set power.strict_midlayer in pci_pm_init() ACPI: PM: Set/clear power.strict_midlayer in prepare/complete PM: sleep: Add strict_midlayer flag to struct dev_pm_info PM: runtime: Introduce __rpm_get_driver_callback() PM: Check power.needs_force_resume in pm_runtime_force_suspend() PM: runtime: Clear power.needs_force_resume in pm_runtime_reinit() PM: Make pm_runtime_force_resume() work with DPM_FLAG_SMART_SUSPEND PM: Move two sleep-related functions under CONFIG_PM_SLEEP PM: Use true/false as power.needs_force_resume values PM: sleep: Make async suspend handle suppliers like parents PM: sleep: Make async resume handle consumers like children PM: sleep: Drop superfluous might_sleep() calls PM: sleep: console: Fix the black screen issue
Diffstat (limited to 'kernel/power/console.c')
-rw-r--r--kernel/power/console.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/kernel/power/console.c b/kernel/power/console.c
index fcdf0e14a47d..19c48aa5355d 100644
--- a/kernel/power/console.c
+++ b/kernel/power/console.c
@@ -16,6 +16,7 @@
#define SUSPEND_CONSOLE (MAX_NR_CONSOLES-1)
static int orig_fgconsole, orig_kmsg;
+static bool vt_switch_done;
static DEFINE_MUTEX(vt_switch_mutex);
@@ -136,17 +137,21 @@ void pm_prepare_console(void)
if (orig_fgconsole < 0)
return;
+ vt_switch_done = true;
+
orig_kmsg = vt_kmsg_redirect(SUSPEND_CONSOLE);
return;
}
void pm_restore_console(void)
{
- if (!pm_vt_switch())
+ if (!pm_vt_switch() && !vt_switch_done)
return;
if (orig_fgconsole >= 0) {
vt_move_to_console(orig_fgconsole, 0);
vt_kmsg_redirect(orig_kmsg);
}
+
+ vt_switch_done = false;
}