Skip to content

Commit d0941ea

Browse files
committed
PM / Hibernate: Make some boot messages look less scary
The hibernate resume code checks if there is an image to resume from on every boot and, if the kernel is built with CONFIG_PM_DEBUG set and the image is not present, it prints some scary messages suggesting there was a boot error of some sort. Apparently, some users are confused by them, so make them look less scary and adjust the other hibernate resume debug messages to match them. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
1 parent 15bcb91 commit d0941ea

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

‎kernel/power/hibernate.c‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -708,7 +708,7 @@ static int software_resume(void)
708708
goto Unlock;
709709
}
710710

711-
pr_debug("PM: Checking image partition %s\n", resume_file);
711+
pr_debug("PM: Checking hibernation image partition %s\n", resume_file);
712712

713713
/* Check if the device is there */
714714
swsusp_resume_device = name_to_dev_t(resume_file);
@@ -733,10 +733,10 @@ static int software_resume(void)
733733
}
734734

735735
Check_image:
736-
pr_debug("PM: Resume from partition %d:%d\n",
736+
pr_debug("PM: Hibernation image partition %d:%d present\n",
737737
MAJOR(swsusp_resume_device), MINOR(swsusp_resume_device));
738738

739-
pr_debug("PM: Checking hibernation image.\n");
739+
pr_debug("PM: Looking for hibernation image.\n");
740740
error = swsusp_check();
741741
if (error)
742742
goto Unlock;
@@ -768,14 +768,14 @@ static int software_resume(void)
768768
goto Done;
769769
}
770770

771-
pr_debug("PM: Reading hibernation image.\n");
771+
pr_debug("PM: Loading hibernation image.\n");
772772

773773
error = swsusp_read(&flags);
774774
swsusp_close(FMODE_READ);
775775
if (!error)
776776
hibernation_restore(flags & SF_PLATFORM_MODE);
777777

778-
printk(KERN_ERR "PM: Restore failed, recovering.\n");
778+
printk(KERN_ERR "PM: Failed to load hibernation image, recovering.\n");
779779
swsusp_free();
780780
thaw_processes();
781781
Done:
@@ -788,7 +788,7 @@ static int software_resume(void)
788788
/* For success case, the suspend path will release the lock */
789789
Unlock:
790790
mutex_unlock(&pm_mutex);
791-
pr_debug("PM: Resume from disk failed.\n");
791+
pr_debug("PM: Hibernation image not present or could not be loaded.\n");
792792
return error;
793793
close_finish:
794794
swsusp_close(FMODE_READ);

‎kernel/power/swap.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -929,13 +929,13 @@ int swsusp_check(void)
929929
if (error)
930930
blkdev_put(hib_resume_bdev, FMODE_READ);
931931
else
932-
pr_debug("PM: Signature found, resuming\n");
932+
pr_debug("PM: Image signature found, resuming\n");
933933
} else {
934934
error = PTR_ERR(hib_resume_bdev);
935935
}
936936

937937
if (error)
938-
pr_debug("PM: Error %d checking image file\n", error);
938+
pr_debug("PM: Image not found (code %d)\n", error);
939939

940940
return error;
941941
}

0 commit comments

Comments
 (0)