aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/power
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2007-12-07 20:09:43 -0500
committerLen Brown <len.brown@intel.com>2008-02-01 18:30:55 -0500
commit23976728a48c3b76d34e17ead19addd52b3a280e (patch)
tree964eb95ae9dccb179165649c7ea631d96b23bc91 /kernel/power
parent465d2b477f6a0ffe01242561a93e7bf81d67c776 (diff)
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: Rafael J. Wysocki <rjw@sisk.pl> Acked-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'kernel/power')
-rw-r--r--kernel/power/disk.c28
-rw-r--r--kernel/power/snapshot.c23
-rw-r--r--kernel/power/swap.c31
-rw-r--r--kernel/power/swsusp.c5
4 files changed, 47 insertions, 40 deletions
diff --git a/kernel/power/disk.c b/kernel/power/disk.c
index 3e24a200f1d4..64e42ab8b57c 100644
--- a/kernel/power/disk.c
+++ b/kernel/power/disk.c
@@ -191,8 +191,8 @@ int create_image(int platform_mode)
191 */ 191 */
192 error = device_power_down(PMSG_FREEZE); 192 error = device_power_down(PMSG_FREEZE);
193 if (error) { 193 if (error) {
194 printk(KERN_ERR "Some devices failed to power down, " 194 printk(KERN_ERR "PM: Some devices failed to power down, "
195 KERN_ERR "aborting suspend\n"); 195 "aborting hibernation\n");
196 goto Enable_irqs; 196 goto Enable_irqs;
197 } 197 }
198 198
@@ -203,7 +203,8 @@ int create_image(int platform_mode)
203 save_processor_state(); 203 save_processor_state();
204 error = swsusp_arch_suspend(); 204 error = swsusp_arch_suspend();
205 if (error) 205 if (error)
206 printk(KERN_ERR "Error %d while creating the image\n", error); 206 printk(KERN_ERR "PM: Error %d creating hibernation image\n",
207 error);
207 /* Restore control flow magically appears here */ 208 /* Restore control flow magically appears here */
208 restore_processor_state(); 209 restore_processor_state();
209 if (!in_suspend) 210 if (!in_suspend)
@@ -289,7 +290,7 @@ static int resume_target_kernel(void)
289 local_irq_disable(); 290 local_irq_disable();
290 error = device_power_down(PMSG_PRETHAW); 291 error = device_power_down(PMSG_PRETHAW);
291 if (error) { 292 if (error) {
292 printk(KERN_ERR "Some devices failed to power down, " 293 printk(KERN_ERR "PM: Some devices failed to power down, "
293 "aborting resume\n"); 294 "aborting resume\n");
294 goto Enable_irqs; 295 goto Enable_irqs;
295 } 296 }
@@ -438,7 +439,7 @@ static void power_down(void)
438 * Valid image is on the disk, if we continue we risk serious data 439 * Valid image is on the disk, if we continue we risk serious data
439 * corruption after resume. 440 * corruption after resume.
440 */ 441 */
441 printk(KERN_CRIT "Please power me down manually\n"); 442 printk(KERN_CRIT "PM: Please power down manually\n");
442 while(1); 443 while(1);
443} 444}
444 445
@@ -484,7 +485,7 @@ int hibernate(void)
484 if (error) 485 if (error)
485 goto Exit; 486 goto Exit;
486 487
487 printk("Syncing filesystems ... "); 488 printk(KERN_INFO "PM: Syncing filesystems ... ");
488 sys_sync(); 489 sys_sync();
489 printk("done.\n"); 490 printk("done.\n");
490 491
@@ -560,10 +561,11 @@ static int software_resume(void)
560 return -ENOENT; 561 return -ENOENT;
561 } 562 }
562 swsusp_resume_device = name_to_dev_t(resume_file); 563 swsusp_resume_device = name_to_dev_t(resume_file);
563 pr_debug("swsusp: Resume From Partition %s\n", resume_file); 564 pr_debug("PM: Resume from partition %s\n", resume_file);
564 } else { 565 } else {
565 pr_debug("swsusp: Resume From Partition %d:%d\n", 566 pr_debug("PM: Resume from partition %d:%d\n",
566 MAJOR(swsusp_resume_device), MINOR(swsusp_resume_device)); 567 MAJOR(swsusp_resume_device),
568 MINOR(swsusp_resume_device));
567 } 569 }
568 570
569 if (noresume) { 571 if (noresume) {
@@ -575,7 +577,7 @@ static int software_resume(void)
575 return 0; 577 return 0;
576 } 578 }
577 579
578 pr_debug("PM: Checking swsusp image.\n"); 580 pr_debug("PM: Checking hibernation image.\n");
579 error = swsusp_check(); 581 error = swsusp_check();
580 if (error) 582 if (error)
581 goto Unlock; 583 goto Unlock;
@@ -601,7 +603,7 @@ static int software_resume(void)
601 goto Done; 603 goto Done;
602 } 604 }
603 605
604 pr_debug("PM: Reading swsusp image.\n"); 606 pr_debug("PM: Reading hibernation image.\n");
605 607
606 error = swsusp_read(&flags); 608 error = swsusp_read(&flags);
607 if (!error) 609 if (!error)
@@ -728,7 +730,7 @@ static ssize_t disk_store(struct kobject *kobj, struct kobj_attribute *attr,
728 error = -EINVAL; 730 error = -EINVAL;
729 731
730 if (!error) 732 if (!error)
731 pr_debug("PM: suspend-to-disk mode set to '%s'\n", 733 pr_debug("PM: Hibernation mode set to '%s'\n",
732 hibernation_modes[mode]); 734 hibernation_modes[mode]);
733 mutex_unlock(&pm_mutex); 735 mutex_unlock(&pm_mutex);
734 return error ? error : n; 736 return error ? error : n;
@@ -760,7 +762,7 @@ static ssize_t resume_store(struct kobject *kobj, struct kobj_attribute *attr,
760 mutex_lock(&pm_mutex); 762 mutex_lock(&pm_mutex);
761 swsusp_resume_device = res; 763 swsusp_resume_device = res;
762 mutex_unlock(&pm_mutex); 764 mutex_unlock(&pm_mutex);
763 printk("Attempting manual resume\n"); 765 printk(KERN_INFO "PM: Starting manual resume from disk\n");
764 noresume = 0; 766 noresume = 0;
765 software_resume(); 767 software_resume();
766 ret = n; 768 ret = n;
diff --git a/kernel/power/snapshot.c b/kernel/power/snapshot.c
index 1ec3eccb1a34..f6a5df934f8d 100644
--- a/kernel/power/snapshot.c
+++ b/kernel/power/snapshot.c
@@ -635,7 +635,7 @@ __register_nosave_region(unsigned long start_pfn, unsigned long end_pfn,
635 region->end_pfn = end_pfn; 635 region->end_pfn = end_pfn;
636 list_add_tail(&region->list, &nosave_regions); 636 list_add_tail(&region->list, &nosave_regions);
637 Report: 637 Report:
638 printk("swsusp: Registered nosave memory region: %016lx - %016lx\n", 638 printk(KERN_INFO "PM: Registered nosave memory: %016lx - %016lx\n",
639 start_pfn << PAGE_SHIFT, end_pfn << PAGE_SHIFT); 639 start_pfn << PAGE_SHIFT, end_pfn << PAGE_SHIFT);
640} 640}
641 641
@@ -704,7 +704,7 @@ static void mark_nosave_pages(struct memory_bitmap *bm)
704 list_for_each_entry(region, &nosave_regions, list) { 704 list_for_each_entry(region, &nosave_regions, list) {
705 unsigned long pfn; 705 unsigned long pfn;
706 706
707 printk("swsusp: Marking nosave pages: %016lx - %016lx\n", 707 pr_debug("PM: Marking nosave pages: %016lx - %016lx\n",
708 region->start_pfn << PAGE_SHIFT, 708 region->start_pfn << PAGE_SHIFT,
709 region->end_pfn << PAGE_SHIFT); 709 region->end_pfn << PAGE_SHIFT);
710 710
@@ -749,7 +749,7 @@ int create_basic_memory_bitmaps(void)
749 free_pages_map = bm2; 749 free_pages_map = bm2;
750 mark_nosave_pages(forbidden_pages_map); 750 mark_nosave_pages(forbidden_pages_map);
751 751
752 printk("swsusp: Basic memory bitmaps created\n"); 752 pr_debug("PM: Basic memory bitmaps created\n");
753 753
754 return 0; 754 return 0;
755 755
@@ -784,7 +784,7 @@ void free_basic_memory_bitmaps(void)
784 memory_bm_free(bm2, PG_UNSAFE_CLEAR); 784 memory_bm_free(bm2, PG_UNSAFE_CLEAR);
785 kfree(bm2); 785 kfree(bm2);
786 786
787 printk("swsusp: Basic memory bitmaps freed\n"); 787 pr_debug("PM: Basic memory bitmaps freed\n");
788} 788}
789 789
790/** 790/**
@@ -1088,7 +1088,7 @@ static int enough_free_mem(unsigned int nr_pages, unsigned int nr_highmem)
1088 } 1088 }
1089 1089
1090 nr_pages += count_pages_for_highmem(nr_highmem); 1090 nr_pages += count_pages_for_highmem(nr_highmem);
1091 pr_debug("swsusp: Normal pages needed: %u + %u + %u, available pages: %u\n", 1091 pr_debug("PM: Normal pages needed: %u + %u + %u, available pages: %u\n",
1092 nr_pages, PAGES_FOR_IO, meta, free); 1092 nr_pages, PAGES_FOR_IO, meta, free);
1093 1093
1094 return free > nr_pages + PAGES_FOR_IO + meta; 1094 return free > nr_pages + PAGES_FOR_IO + meta;
@@ -1201,20 +1201,20 @@ asmlinkage int swsusp_save(void)
1201{ 1201{
1202 unsigned int nr_pages, nr_highmem; 1202 unsigned int nr_pages, nr_highmem;
1203 1203
1204 printk("swsusp: critical section: \n"); 1204 printk(KERN_INFO "PM: Creating hibernation image: \n");
1205 1205
1206 drain_local_pages(); 1206 drain_local_pages();
1207 nr_pages = count_data_pages(); 1207 nr_pages = count_data_pages();
1208 nr_highmem = count_highmem_pages(); 1208 nr_highmem = count_highmem_pages();
1209 printk("swsusp: Need to copy %u pages\n", nr_pages + nr_highmem); 1209 printk(KERN_INFO "PM: Need to copy %u pages\n", nr_pages + nr_highmem);
1210 1210
1211 if (!enough_free_mem(nr_pages, nr_highmem)) { 1211 if (!enough_free_mem(nr_pages, nr_highmem)) {
1212 printk(KERN_ERR "swsusp: Not enough free memory\n"); 1212 printk(KERN_ERR "PM: Not enough free memory\n");
1213 return -ENOMEM; 1213 return -ENOMEM;
1214 } 1214 }
1215 1215
1216 if (swsusp_alloc(&orig_bm, &copy_bm, nr_pages, nr_highmem)) { 1216 if (swsusp_alloc(&orig_bm, &copy_bm, nr_pages, nr_highmem)) {
1217 printk(KERN_ERR "swsusp: Memory allocation failed\n"); 1217 printk(KERN_ERR "PM: Memory allocation failed\n");
1218 return -ENOMEM; 1218 return -ENOMEM;
1219 } 1219 }
1220 1220
@@ -1234,7 +1234,8 @@ asmlinkage int swsusp_save(void)
1234 nr_copy_pages = nr_pages; 1234 nr_copy_pages = nr_pages;
1235 nr_meta_pages = DIV_ROUND_UP(nr_pages * sizeof(long), PAGE_SIZE); 1235 nr_meta_pages = DIV_ROUND_UP(nr_pages * sizeof(long), PAGE_SIZE);
1236 1236
1237 printk("swsusp: critical section: done (%d pages copied)\n", nr_pages); 1237 printk(KERN_INFO "PM: Hibernation image created (%d pages copied)\n",
1238 nr_pages);
1238 1239
1239 return 0; 1240 return 0;
1240} 1241}
@@ -1433,7 +1434,7 @@ static int check_header(struct swsusp_info *info)
1433 if (!reason && info->num_physpages != num_physpages) 1434 if (!reason && info->num_physpages != num_physpages)
1434 reason = "memory size"; 1435 reason = "memory size";
1435 if (reason) { 1436 if (reason) {
1436 printk(KERN_ERR "swsusp: Resume mismatch: %s\n", reason); 1437 printk(KERN_ERR "PM: Image mismatch: %s\n", reason);
1437 return -EPERM; 1438 return -EPERM;
1438 } 1439 }
1439 return 0; 1440 return 0;
diff --git a/kernel/power/swap.c b/kernel/power/swap.c
index ef41440879ba..a0abf9a463f9 100644
--- a/kernel/power/swap.c
+++ b/kernel/power/swap.c
@@ -71,7 +71,8 @@ static int submit(int rw, pgoff_t page_off, struct page *page,
71 bio->bi_end_io = end_swap_bio_read; 71 bio->bi_end_io = end_swap_bio_read;
72 72
73 if (bio_add_page(bio, page, PAGE_SIZE, 0) < PAGE_SIZE) { 73 if (bio_add_page(bio, page, PAGE_SIZE, 0) < PAGE_SIZE) {
74 printk("swsusp: ERROR: adding page to bio at %ld\n", page_off); 74 printk(KERN_ERR "PM: Adding page to bio failed at %ld\n",
75 page_off);
75 bio_put(bio); 76 bio_put(bio);
76 return -EFAULT; 77 return -EFAULT;
77 } 78 }
@@ -151,7 +152,7 @@ static int mark_swapfiles(sector_t start, unsigned int flags)
151 error = bio_write_page(swsusp_resume_block, 152 error = bio_write_page(swsusp_resume_block,
152 swsusp_header, NULL); 153 swsusp_header, NULL);
153 } else { 154 } else {
154 printk(KERN_ERR "swsusp: Swap header not found!\n"); 155 printk(KERN_ERR "PM: Swap header not found!\n");
155 error = -ENODEV; 156 error = -ENODEV;
156 } 157 }
157 return error; 158 return error;
@@ -323,7 +324,8 @@ static int save_image(struct swap_map_handle *handle,
323 struct timeval start; 324 struct timeval start;
324 struct timeval stop; 325 struct timeval stop;
325 326
326 printk("Saving image data pages (%u pages) ... ", nr_to_write); 327 printk(KERN_INFO "PM: Saving image data pages (%u pages) ... ",
328 nr_to_write);
327 m = nr_to_write / 100; 329 m = nr_to_write / 100;
328 if (!m) 330 if (!m)
329 m = 1; 331 m = 1;
@@ -363,7 +365,7 @@ static int enough_swap(unsigned int nr_pages)
363{ 365{
364 unsigned int free_swap = count_swap_pages(root_swap, 1); 366 unsigned int free_swap = count_swap_pages(root_swap, 1);
365 367
366 pr_debug("swsusp: free swap pages: %u\n", free_swap); 368 pr_debug("PM: Free swap pages: %u\n", free_swap);
367 return free_swap > nr_pages + PAGES_FOR_IO; 369 return free_swap > nr_pages + PAGES_FOR_IO;
368} 370}
369 371
@@ -386,7 +388,7 @@ int swsusp_write(unsigned int flags)
386 388
387 error = swsusp_swap_check(); 389 error = swsusp_swap_check();
388 if (error) { 390 if (error) {
389 printk(KERN_ERR "swsusp: Cannot find swap device, try " 391 printk(KERN_ERR "PM: Cannot find swap device, try "
390 "swapon -a.\n"); 392 "swapon -a.\n");
391 return error; 393 return error;
392 } 394 }
@@ -400,7 +402,7 @@ int swsusp_write(unsigned int flags)
400 } 402 }
401 header = (struct swsusp_info *)data_of(snapshot); 403 header = (struct swsusp_info *)data_of(snapshot);
402 if (!enough_swap(header->pages)) { 404 if (!enough_swap(header->pages)) {
403 printk(KERN_ERR "swsusp: Not enough free swap\n"); 405 printk(KERN_ERR "PM: Not enough free swap\n");
404 error = -ENOSPC; 406 error = -ENOSPC;
405 goto out; 407 goto out;
406 } 408 }
@@ -415,7 +417,7 @@ int swsusp_write(unsigned int flags)
415 417
416 if (!error) { 418 if (!error) {
417 flush_swap_writer(&handle); 419 flush_swap_writer(&handle);
418 printk("S"); 420 printk(KERN_INFO "PM: S");
419 error = mark_swapfiles(start, flags); 421 error = mark_swapfiles(start, flags);
420 printk("|\n"); 422 printk("|\n");
421 } 423 }
@@ -505,7 +507,8 @@ static int load_image(struct swap_map_handle *handle,
505 int err2; 507 int err2;
506 unsigned nr_pages; 508 unsigned nr_pages;
507 509
508 printk("Loading image data pages (%u pages) ... ", nr_to_read); 510 printk(KERN_INFO "PM: Loading image data pages (%u pages) ... ",
511 nr_to_read);
509 m = nr_to_read / 100; 512 m = nr_to_read / 100;
510 if (!m) 513 if (!m)
511 m = 1; 514 m = 1;
@@ -556,7 +559,7 @@ int swsusp_read(unsigned int *flags_p)
556 559
557 *flags_p = swsusp_header->flags; 560 *flags_p = swsusp_header->flags;
558 if (IS_ERR(resume_bdev)) { 561 if (IS_ERR(resume_bdev)) {
559 pr_debug("swsusp: block device not initialised\n"); 562 pr_debug("PM: Image device not initialised\n");
560 return PTR_ERR(resume_bdev); 563 return PTR_ERR(resume_bdev);
561 } 564 }
562 565
@@ -575,9 +578,9 @@ int swsusp_read(unsigned int *flags_p)
575 blkdev_put(resume_bdev); 578 blkdev_put(resume_bdev);
576 579
577 if (!error) 580 if (!error)
578 pr_debug("swsusp: Reading resume file was successful\n"); 581 pr_debug("PM: Image successfully loaded\n");
579 else 582 else
580 pr_debug("swsusp: Error %d resuming\n", error); 583 pr_debug("PM: Error %d resuming\n", error);
581 return error; 584 return error;
582} 585}
583 586
@@ -609,13 +612,13 @@ int swsusp_check(void)
609 if (error) 612 if (error)
610 blkdev_put(resume_bdev); 613 blkdev_put(resume_bdev);
611 else 614 else
612 pr_debug("swsusp: Signature found, resuming\n"); 615 pr_debug("PM: Signature found, resuming\n");
613 } else { 616 } else {
614 error = PTR_ERR(resume_bdev); 617 error = PTR_ERR(resume_bdev);
615 } 618 }
616 619
617 if (error) 620 if (error)
618 pr_debug("swsusp: Error %d check for resume file\n", error); 621 pr_debug("PM: Error %d checking image file\n", error);
619 622
620 return error; 623 return error;
621} 624}
@@ -627,7 +630,7 @@ int swsusp_check(void)
627void swsusp_close(void) 630void swsusp_close(void)
628{ 631{
629 if (IS_ERR(resume_bdev)) { 632 if (IS_ERR(resume_bdev)) {
630 pr_debug("swsusp: block device not initialised\n"); 633 pr_debug("PM: Image device not initialised\n");
631 return; 634 return;
632 } 635 }
633 636
diff --git a/kernel/power/swsusp.c b/kernel/power/swsusp.c
index dc29a20aff41..023ff2a31d89 100644
--- a/kernel/power/swsusp.c
+++ b/kernel/power/swsusp.c
@@ -188,7 +188,8 @@ void swsusp_show_speed(struct timeval *start, struct timeval *stop,
188 centisecs = 1; /* avoid div-by-zero */ 188 centisecs = 1; /* avoid div-by-zero */
189 k = nr_pages * (PAGE_SIZE / 1024); 189 k = nr_pages * (PAGE_SIZE / 1024);
190 kps = (k * 100) / centisecs; 190 kps = (k * 100) / centisecs;
191 printk("%s %d kbytes in %d.%02d seconds (%d.%02d MB/s)\n", msg, k, 191 printk(KERN_INFO "PM: %s %d kbytes in %d.%02d seconds (%d.%02d MB/s)\n",
192 msg, k,
192 centisecs / 100, centisecs % 100, 193 centisecs / 100, centisecs % 100,
193 kps / 1000, (kps % 1000) / 10); 194 kps / 1000, (kps % 1000) / 10);
194} 195}
@@ -219,7 +220,7 @@ int swsusp_shrink_memory(void)
219 char *p = "-\\|/"; 220 char *p = "-\\|/";
220 struct timeval start, stop; 221 struct timeval start, stop;
221 222
222 printk("Shrinking memory... "); 223 printk(KERN_INFO "PM: Shrinking memory... ");
223 do_gettimeofday(&start); 224 do_gettimeofday(&start);
224 do { 225 do {
225 long size, highmem_size; 226 long size, highmem_size;