Commit 23976728 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki Committed by Len Brown

Hibernation: Update messages

Make hibernation messages start with one common prefix "PM: " and use
the word "hibernation" in the messages as a synonym of "suspend to
disk".

Turn some KERN_INFO messages into debug ones.
Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
Acked-by: default avatarPavel Machek <pavel@ucw.cz>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent 465d2b47
...@@ -191,8 +191,8 @@ int create_image(int platform_mode) ...@@ -191,8 +191,8 @@ int create_image(int platform_mode)
*/ */
error = device_power_down(PMSG_FREEZE); error = device_power_down(PMSG_FREEZE);
if (error) { if (error) {
printk(KERN_ERR "Some devices failed to power down, " printk(KERN_ERR "PM: Some devices failed to power down, "
KERN_ERR "aborting suspend\n"); "aborting hibernation\n");
goto Enable_irqs; goto Enable_irqs;
} }
...@@ -203,7 +203,8 @@ int create_image(int platform_mode) ...@@ -203,7 +203,8 @@ int create_image(int platform_mode)
save_processor_state(); save_processor_state();
error = swsusp_arch_suspend(); error = swsusp_arch_suspend();
if (error) if (error)
printk(KERN_ERR "Error %d while creating the image\n", error); printk(KERN_ERR "PM: Error %d creating hibernation image\n",
error);
/* Restore control flow magically appears here */ /* Restore control flow magically appears here */
restore_processor_state(); restore_processor_state();
if (!in_suspend) if (!in_suspend)
...@@ -289,7 +290,7 @@ static int resume_target_kernel(void) ...@@ -289,7 +290,7 @@ static int resume_target_kernel(void)
local_irq_disable(); local_irq_disable();
error = device_power_down(PMSG_PRETHAW); error = device_power_down(PMSG_PRETHAW);
if (error) { if (error) {
printk(KERN_ERR "Some devices failed to power down, " printk(KERN_ERR "PM: Some devices failed to power down, "
"aborting resume\n"); "aborting resume\n");
goto Enable_irqs; goto Enable_irqs;
} }
...@@ -438,7 +439,7 @@ static void power_down(void) ...@@ -438,7 +439,7 @@ static void power_down(void)
* Valid image is on the disk, if we continue we risk serious data * Valid image is on the disk, if we continue we risk serious data
* corruption after resume. * corruption after resume.
*/ */
printk(KERN_CRIT "Please power me down manually\n"); printk(KERN_CRIT "PM: Please power down manually\n");
while(1); while(1);
} }
...@@ -484,7 +485,7 @@ int hibernate(void) ...@@ -484,7 +485,7 @@ int hibernate(void)
if (error) if (error)
goto Exit; goto Exit;
printk("Syncing filesystems ... "); printk(KERN_INFO "PM: Syncing filesystems ... ");
sys_sync(); sys_sync();
printk("done.\n"); printk("done.\n");
...@@ -560,10 +561,11 @@ static int software_resume(void) ...@@ -560,10 +561,11 @@ static int software_resume(void)
return -ENOENT; return -ENOENT;
} }
swsusp_resume_device = name_to_dev_t(resume_file); swsusp_resume_device = name_to_dev_t(resume_file);
pr_debug("swsusp: Resume From Partition %s\n", resume_file); pr_debug("PM: Resume from partition %s\n", resume_file);
} else { } else {
pr_debug("swsusp: Resume From Partition %d:%d\n", pr_debug("PM: Resume from partition %d:%d\n",
MAJOR(swsusp_resume_device), MINOR(swsusp_resume_device)); MAJOR(swsusp_resume_device),
MINOR(swsusp_resume_device));
} }
if (noresume) { if (noresume) {
...@@ -575,7 +577,7 @@ static int software_resume(void) ...@@ -575,7 +577,7 @@ static int software_resume(void)
return 0; return 0;
} }
pr_debug("PM: Checking swsusp image.\n"); pr_debug("PM: Checking hibernation image.\n");
error = swsusp_check(); error = swsusp_check();
if (error) if (error)
goto Unlock; goto Unlock;
...@@ -601,7 +603,7 @@ static int software_resume(void) ...@@ -601,7 +603,7 @@ static int software_resume(void)
goto Done; goto Done;
} }
pr_debug("PM: Reading swsusp image.\n"); pr_debug("PM: Reading hibernation image.\n");
error = swsusp_read(&flags); error = swsusp_read(&flags);
if (!error) if (!error)
...@@ -728,7 +730,7 @@ static ssize_t disk_store(struct kobject *kobj, struct kobj_attribute *attr, ...@@ -728,7 +730,7 @@ static ssize_t disk_store(struct kobject *kobj, struct kobj_attribute *attr,
error = -EINVAL; error = -EINVAL;
if (!error) if (!error)
pr_debug("PM: suspend-to-disk mode set to '%s'\n", pr_debug("PM: Hibernation mode set to '%s'\n",
hibernation_modes[mode]); hibernation_modes[mode]);
mutex_unlock(&pm_mutex); mutex_unlock(&pm_mutex);
return error ? error : n; return error ? error : n;
...@@ -760,7 +762,7 @@ static ssize_t resume_store(struct kobject *kobj, struct kobj_attribute *attr, ...@@ -760,7 +762,7 @@ static ssize_t resume_store(struct kobject *kobj, struct kobj_attribute *attr,
mutex_lock(&pm_mutex); mutex_lock(&pm_mutex);
swsusp_resume_device = res; swsusp_resume_device = res;
mutex_unlock(&pm_mutex); mutex_unlock(&pm_mutex);
printk("Attempting manual resume\n"); printk(KERN_INFO "PM: Starting manual resume from disk\n");
noresume = 0; noresume = 0;
software_resume(); software_resume();
ret = n; ret = n;
......
...@@ -635,7 +635,7 @@ __register_nosave_region(unsigned long start_pfn, unsigned long end_pfn, ...@@ -635,7 +635,7 @@ __register_nosave_region(unsigned long start_pfn, unsigned long end_pfn,
region->end_pfn = end_pfn; region->end_pfn = end_pfn;
list_add_tail(&region->list, &nosave_regions); list_add_tail(&region->list, &nosave_regions);
Report: Report:
printk("swsusp: Registered nosave memory region: %016lx - %016lx\n", printk(KERN_INFO "PM: Registered nosave memory: %016lx - %016lx\n",
start_pfn << PAGE_SHIFT, end_pfn << PAGE_SHIFT); start_pfn << PAGE_SHIFT, end_pfn << PAGE_SHIFT);
} }
...@@ -704,7 +704,7 @@ static void mark_nosave_pages(struct memory_bitmap *bm) ...@@ -704,7 +704,7 @@ static void mark_nosave_pages(struct memory_bitmap *bm)
list_for_each_entry(region, &nosave_regions, list) { list_for_each_entry(region, &nosave_regions, list) {
unsigned long pfn; unsigned long pfn;
printk("swsusp: Marking nosave pages: %016lx - %016lx\n", pr_debug("PM: Marking nosave pages: %016lx - %016lx\n",
region->start_pfn << PAGE_SHIFT, region->start_pfn << PAGE_SHIFT,
region->end_pfn << PAGE_SHIFT); region->end_pfn << PAGE_SHIFT);
...@@ -749,7 +749,7 @@ int create_basic_memory_bitmaps(void) ...@@ -749,7 +749,7 @@ int create_basic_memory_bitmaps(void)
free_pages_map = bm2; free_pages_map = bm2;
mark_nosave_pages(forbidden_pages_map); mark_nosave_pages(forbidden_pages_map);
printk("swsusp: Basic memory bitmaps created\n"); pr_debug("PM: Basic memory bitmaps created\n");
return 0; return 0;
...@@ -784,7 +784,7 @@ void free_basic_memory_bitmaps(void) ...@@ -784,7 +784,7 @@ void free_basic_memory_bitmaps(void)
memory_bm_free(bm2, PG_UNSAFE_CLEAR); memory_bm_free(bm2, PG_UNSAFE_CLEAR);
kfree(bm2); kfree(bm2);
printk("swsusp: Basic memory bitmaps freed\n"); pr_debug("PM: Basic memory bitmaps freed\n");
} }
/** /**
...@@ -1088,7 +1088,7 @@ static int enough_free_mem(unsigned int nr_pages, unsigned int nr_highmem) ...@@ -1088,7 +1088,7 @@ static int enough_free_mem(unsigned int nr_pages, unsigned int nr_highmem)
} }
nr_pages += count_pages_for_highmem(nr_highmem); nr_pages += count_pages_for_highmem(nr_highmem);
pr_debug("swsusp: Normal pages needed: %u + %u + %u, available pages: %u\n", pr_debug("PM: Normal pages needed: %u + %u + %u, available pages: %u\n",
nr_pages, PAGES_FOR_IO, meta, free); nr_pages, PAGES_FOR_IO, meta, free);
return free > nr_pages + PAGES_FOR_IO + meta; return free > nr_pages + PAGES_FOR_IO + meta;
...@@ -1201,20 +1201,20 @@ asmlinkage int swsusp_save(void) ...@@ -1201,20 +1201,20 @@ asmlinkage int swsusp_save(void)
{ {
unsigned int nr_pages, nr_highmem; unsigned int nr_pages, nr_highmem;
printk("swsusp: critical section: \n"); printk(KERN_INFO "PM: Creating hibernation image: \n");
drain_local_pages(); drain_local_pages();
nr_pages = count_data_pages(); nr_pages = count_data_pages();
nr_highmem = count_highmem_pages(); nr_highmem = count_highmem_pages();
printk("swsusp: Need to copy %u pages\n", nr_pages + nr_highmem); printk(KERN_INFO "PM: Need to copy %u pages\n", nr_pages + nr_highmem);
if (!enough_free_mem(nr_pages, nr_highmem)) { if (!enough_free_mem(nr_pages, nr_highmem)) {
printk(KERN_ERR "swsusp: Not enough free memory\n"); printk(KERN_ERR "PM: Not enough free memory\n");
return -ENOMEM; return -ENOMEM;
} }
if (swsusp_alloc(&orig_bm, &copy_bm, nr_pages, nr_highmem)) { if (swsusp_alloc(&orig_bm, &copy_bm, nr_pages, nr_highmem)) {
printk(KERN_ERR "swsusp: Memory allocation failed\n"); printk(KERN_ERR "PM: Memory allocation failed\n");
return -ENOMEM; return -ENOMEM;
} }
...@@ -1234,7 +1234,8 @@ asmlinkage int swsusp_save(void) ...@@ -1234,7 +1234,8 @@ asmlinkage int swsusp_save(void)
nr_copy_pages = nr_pages; nr_copy_pages = nr_pages;
nr_meta_pages = DIV_ROUND_UP(nr_pages * sizeof(long), PAGE_SIZE); nr_meta_pages = DIV_ROUND_UP(nr_pages * sizeof(long), PAGE_SIZE);
printk("swsusp: critical section: done (%d pages copied)\n", nr_pages); printk(KERN_INFO "PM: Hibernation image created (%d pages copied)\n",
nr_pages);
return 0; return 0;
} }
...@@ -1433,7 +1434,7 @@ static int check_header(struct swsusp_info *info) ...@@ -1433,7 +1434,7 @@ static int check_header(struct swsusp_info *info)
if (!reason && info->num_physpages != num_physpages) if (!reason && info->num_physpages != num_physpages)
reason = "memory size"; reason = "memory size";
if (reason) { if (reason) {
printk(KERN_ERR "swsusp: Resume mismatch: %s\n", reason); printk(KERN_ERR "PM: Image mismatch: %s\n", reason);
return -EPERM; return -EPERM;
} }
return 0; return 0;
......
...@@ -71,7 +71,8 @@ static int submit(int rw, pgoff_t page_off, struct page *page, ...@@ -71,7 +71,8 @@ static int submit(int rw, pgoff_t page_off, struct page *page,
bio->bi_end_io = end_swap_bio_read; bio->bi_end_io = end_swap_bio_read;
if (bio_add_page(bio, page, PAGE_SIZE, 0) < PAGE_SIZE) { if (bio_add_page(bio, page, PAGE_SIZE, 0) < PAGE_SIZE) {
printk("swsusp: ERROR: adding page to bio at %ld\n", page_off); printk(KERN_ERR "PM: Adding page to bio failed at %ld\n",
page_off);
bio_put(bio); bio_put(bio);
return -EFAULT; return -EFAULT;
} }
...@@ -151,7 +152,7 @@ static int mark_swapfiles(sector_t start, unsigned int flags) ...@@ -151,7 +152,7 @@ static int mark_swapfiles(sector_t start, unsigned int flags)
error = bio_write_page(swsusp_resume_block, error = bio_write_page(swsusp_resume_block,
swsusp_header, NULL); swsusp_header, NULL);
} else { } else {
printk(KERN_ERR "swsusp: Swap header not found!\n"); printk(KERN_ERR "PM: Swap header not found!\n");
error = -ENODEV; error = -ENODEV;
} }
return error; return error;
...@@ -323,7 +324,8 @@ static int save_image(struct swap_map_handle *handle, ...@@ -323,7 +324,8 @@ static int save_image(struct swap_map_handle *handle,
struct timeval start; struct timeval start;
struct timeval stop; struct timeval stop;
printk("Saving image data pages (%u pages) ... ", nr_to_write); printk(KERN_INFO "PM: Saving image data pages (%u pages) ... ",
nr_to_write);
m = nr_to_write / 100; m = nr_to_write / 100;
if (!m) if (!m)
m = 1; m = 1;
...@@ -363,7 +365,7 @@ static int enough_swap(unsigned int nr_pages) ...@@ -363,7 +365,7 @@ static int enough_swap(unsigned int nr_pages)
{ {
unsigned int free_swap = count_swap_pages(root_swap, 1); unsigned int free_swap = count_swap_pages(root_swap, 1);
pr_debug("swsusp: free swap pages: %u\n", free_swap); pr_debug("PM: Free swap pages: %u\n", free_swap);
return free_swap > nr_pages + PAGES_FOR_IO; return free_swap > nr_pages + PAGES_FOR_IO;
} }
...@@ -386,7 +388,7 @@ int swsusp_write(unsigned int flags) ...@@ -386,7 +388,7 @@ int swsusp_write(unsigned int flags)
error = swsusp_swap_check(); error = swsusp_swap_check();
if (error) { if (error) {
printk(KERN_ERR "swsusp: Cannot find swap device, try " printk(KERN_ERR "PM: Cannot find swap device, try "
"swapon -a.\n"); "swapon -a.\n");
return error; return error;
} }
...@@ -400,7 +402,7 @@ int swsusp_write(unsigned int flags) ...@@ -400,7 +402,7 @@ int swsusp_write(unsigned int flags)
} }
header = (struct swsusp_info *)data_of(snapshot); header = (struct swsusp_info *)data_of(snapshot);
if (!enough_swap(header->pages)) { if (!enough_swap(header->pages)) {
printk(KERN_ERR "swsusp: Not enough free swap\n"); printk(KERN_ERR "PM: Not enough free swap\n");
error = -ENOSPC; error = -ENOSPC;
goto out; goto out;
} }
...@@ -415,7 +417,7 @@ int swsusp_write(unsigned int flags) ...@@ -415,7 +417,7 @@ int swsusp_write(unsigned int flags)
if (!error) { if (!error) {
flush_swap_writer(&handle); flush_swap_writer(&handle);
printk("S"); printk(KERN_INFO "PM: S");
error = mark_swapfiles(start, flags); error = mark_swapfiles(start, flags);
printk("|\n"); printk("|\n");
} }
...@@ -505,7 +507,8 @@ static int load_image(struct swap_map_handle *handle, ...@@ -505,7 +507,8 @@ static int load_image(struct swap_map_handle *handle,
int err2; int err2;
unsigned nr_pages; unsigned nr_pages;
printk("Loading image data pages (%u pages) ... ", nr_to_read); printk(KERN_INFO "PM: Loading image data pages (%u pages) ... ",
nr_to_read);
m = nr_to_read / 100; m = nr_to_read / 100;
if (!m) if (!m)
m = 1; m = 1;
...@@ -556,7 +559,7 @@ int swsusp_read(unsigned int *flags_p) ...@@ -556,7 +559,7 @@ int swsusp_read(unsigned int *flags_p)
*flags_p = swsusp_header->flags; *flags_p = swsusp_header->flags;
if (IS_ERR(resume_bdev)) { if (IS_ERR(resume_bdev)) {
pr_debug("swsusp: block device not initialised\n"); pr_debug("PM: Image device not initialised\n");
return PTR_ERR(resume_bdev); return PTR_ERR(resume_bdev);
} }
...@@ -575,9 +578,9 @@ int swsusp_read(unsigned int *flags_p) ...@@ -575,9 +578,9 @@ int swsusp_read(unsigned int *flags_p)
blkdev_put(resume_bdev); blkdev_put(resume_bdev);
if (!error) if (!error)
pr_debug("swsusp: Reading resume file was successful\n"); pr_debug("PM: Image successfully loaded\n");
else else
pr_debug("swsusp: Error %d resuming\n", error); pr_debug("PM: Error %d resuming\n", error);
return error; return error;
} }
...@@ -609,13 +612,13 @@ int swsusp_check(void) ...@@ -609,13 +612,13 @@ int swsusp_check(void)
if (error) if (error)
blkdev_put(resume_bdev); blkdev_put(resume_bdev);
else else
pr_debug("swsusp: Signature found, resuming\n"); pr_debug("PM: Signature found, resuming\n");
} else { } else {
error = PTR_ERR(resume_bdev); error = PTR_ERR(resume_bdev);
} }
if (error) if (error)
pr_debug("swsusp: Error %d check for resume file\n", error); pr_debug("PM: Error %d checking image file\n", error);
return error; return error;
} }
...@@ -627,7 +630,7 @@ int swsusp_check(void) ...@@ -627,7 +630,7 @@ int swsusp_check(void)
void swsusp_close(void) void swsusp_close(void)
{ {
if (IS_ERR(resume_bdev)) { if (IS_ERR(resume_bdev)) {
pr_debug("swsusp: block device not initialised\n"); pr_debug("PM: Image device not initialised\n");
return; return;
} }
......
...@@ -188,7 +188,8 @@ void swsusp_show_speed(struct timeval *start, struct timeval *stop, ...@@ -188,7 +188,8 @@ void swsusp_show_speed(struct timeval *start, struct timeval *stop,
centisecs = 1; /* avoid div-by-zero */ centisecs = 1; /* avoid div-by-zero */
k = nr_pages * (PAGE_SIZE / 1024); k = nr_pages * (PAGE_SIZE / 1024);
kps = (k * 100) / centisecs; kps = (k * 100) / centisecs;
printk("%s %d kbytes in %d.%02d seconds (%d.%02d MB/s)\n", msg, k, printk(KERN_INFO "PM: %s %d kbytes in %d.%02d seconds (%d.%02d MB/s)\n",
msg, k,
centisecs / 100, centisecs % 100, centisecs / 100, centisecs % 100,
kps / 1000, (kps % 1000) / 10); kps / 1000, (kps % 1000) / 10);
} }
...@@ -219,7 +220,7 @@ int swsusp_shrink_memory(void) ...@@ -219,7 +220,7 @@ int swsusp_shrink_memory(void)
char *p = "-\\|/"; char *p = "-\\|/";
struct timeval start, stop; struct timeval start, stop;
printk("Shrinking memory... "); printk(KERN_INFO "PM: Shrinking memory... ");
do_gettimeofday(&start); do_gettimeofday(&start);
do { do {
long size, highmem_size; long size, highmem_size;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment