aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390
diff options
context:
space:
mode:
authorHongjie Yang <hongjie@us.ibm.com>2008-12-25 07:39:45 -0500
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2008-12-25 07:39:23 -0500
commit93098bf01578763bb84b627fe893f219cc44b995 (patch)
treefa33eaad7ffd8ed30462e0460f42f51d607c2342 /arch/s390
parent1519c0c6ebd2bfd29bae762a1741963a1d06bca2 (diff)
[S390] convert dcssblk and extmem printks messages to pr_xxx macros.
Signed-off-by: Hongjie Yang <hongjie@us.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390')
-rw-r--r--arch/s390/mm/extmem.c106
1 files changed, 43 insertions, 63 deletions
diff --git a/arch/s390/mm/extmem.c b/arch/s390/mm/extmem.c
index 580fc64cc73..5c845712960 100644
--- a/arch/s390/mm/extmem.c
+++ b/arch/s390/mm/extmem.c
@@ -7,6 +7,9 @@
7 * (C) IBM Corporation 2002-2004 7 * (C) IBM Corporation 2002-2004
8 */ 8 */
9 9
10#define KMSG_COMPONENT "extmem"
11#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
12
10#include <linux/kernel.h> 13#include <linux/kernel.h>
11#include <linux/string.h> 14#include <linux/string.h>
12#include <linux/spinlock.h> 15#include <linux/spinlock.h>
@@ -24,19 +27,6 @@
24#include <asm/cpcmd.h> 27#include <asm/cpcmd.h>
25#include <asm/setup.h> 28#include <asm/setup.h>
26 29
27#define DCSS_DEBUG /* Debug messages on/off */
28
29#define DCSS_NAME "extmem"
30#ifdef DCSS_DEBUG
31#define PRINT_DEBUG(x...) printk(KERN_DEBUG DCSS_NAME " debug:" x)
32#else
33#define PRINT_DEBUG(x...) do {} while (0)
34#endif
35#define PRINT_INFO(x...) printk(KERN_INFO DCSS_NAME " info:" x)
36#define PRINT_WARN(x...) printk(KERN_WARNING DCSS_NAME " warning:" x)
37#define PRINT_ERR(x...) printk(KERN_ERR DCSS_NAME " error:" x)
38
39
40#define DCSS_LOADSHR 0x00 30#define DCSS_LOADSHR 0x00
41#define DCSS_LOADNSR 0x04 31#define DCSS_LOADNSR 0x04
42#define DCSS_PURGESEG 0x08 32#define DCSS_PURGESEG 0x08
@@ -286,7 +276,7 @@ query_segment_type (struct dcss_segment *seg)
286 goto out_free; 276 goto out_free;
287 } 277 }
288 if (diag_cc > 1) { 278 if (diag_cc > 1) {
289 PRINT_WARN ("segment_type: diag returned error %ld\n", vmrc); 279 pr_warning("Querying a DCSS type failed with rc=%ld\n", vmrc);
290 rc = dcss_diag_translate_rc (vmrc); 280 rc = dcss_diag_translate_rc (vmrc);
291 goto out_free; 281 goto out_free;
292 } 282 }
@@ -368,7 +358,6 @@ query_segment_type (struct dcss_segment *seg)
368 * -EIO : could not perform query diagnose 358 * -EIO : could not perform query diagnose
369 * -ENOENT : no such segment 359 * -ENOENT : no such segment
370 * -ENOTSUPP: multi-part segment cannot be used with linux 360 * -ENOTSUPP: multi-part segment cannot be used with linux
371 * -ENOSPC : segment cannot be used (overlaps with storage)
372 * -ENOMEM : out of memory 361 * -ENOMEM : out of memory
373 * 0 .. 6 : type of segment as defined in include/asm-s390/extmem.h 362 * 0 .. 6 : type of segment as defined in include/asm-s390/extmem.h
374 */ 363 */
@@ -480,9 +469,8 @@ __segment_load (char *name, int do_nonshared, unsigned long *addr, unsigned long
480 goto out_resource; 469 goto out_resource;
481 } 470 }
482 if (diag_cc > 1) { 471 if (diag_cc > 1) {
483 PRINT_WARN ("segment_load: could not load segment %s - " 472 pr_warning("Loading DCSS %s failed with rc=%ld\n", name,
484 "diag returned error (%ld)\n", 473 end_addr);
485 name, end_addr);
486 rc = dcss_diag_translate_rc(end_addr); 474 rc = dcss_diag_translate_rc(end_addr);
487 dcss_diag(&purgeseg_scode, seg->dcss_name, 475 dcss_diag(&purgeseg_scode, seg->dcss_name,
488 &dummy, &dummy); 476 &dummy, &dummy);
@@ -496,15 +484,13 @@ __segment_load (char *name, int do_nonshared, unsigned long *addr, unsigned long
496 *addr = seg->start_addr; 484 *addr = seg->start_addr;
497 *end = seg->end; 485 *end = seg->end;
498 if (do_nonshared) 486 if (do_nonshared)
499 PRINT_INFO ("segment_load: loaded segment %s range %p .. %p " 487 pr_info("DCSS %s of range %p to %p and type %s loaded as "
500 "type %s in non-shared mode\n", name, 488 "exclusive-writable\n", name, (void*) seg->start_addr,
501 (void*)seg->start_addr, (void*)seg->end, 489 (void*) seg->end, segtype_string[seg->vm_segtype]);
502 segtype_string[seg->vm_segtype]);
503 else { 490 else {
504 PRINT_INFO ("segment_load: loaded segment %s range %p .. %p " 491 pr_info("DCSS %s of range %p to %p and type %s loaded in "
505 "type %s in shared mode\n", name, 492 "shared access mode\n", name, (void*) seg->start_addr,
506 (void*)seg->start_addr, (void*)seg->end, 493 (void*) seg->end, segtype_string[seg->vm_segtype]);
507 segtype_string[seg->vm_segtype]);
508 } 494 }
509 goto out; 495 goto out;
510 out_resource: 496 out_resource:
@@ -593,14 +579,14 @@ segment_modify_shared (char *name, int do_nonshared)
593 goto out_unlock; 579 goto out_unlock;
594 } 580 }
595 if (do_nonshared == seg->do_nonshared) { 581 if (do_nonshared == seg->do_nonshared) {
596 PRINT_INFO ("segment_modify_shared: not reloading segment %s" 582 pr_info("DCSS %s is already in the requested access "
597 " - already in requested mode\n",name); 583 "mode\n", name);
598 rc = 0; 584 rc = 0;
599 goto out_unlock; 585 goto out_unlock;
600 } 586 }
601 if (atomic_read (&seg->ref_count) != 1) { 587 if (atomic_read (&seg->ref_count) != 1) {
602 PRINT_WARN ("segment_modify_shared: not reloading segment %s - " 588 pr_warning("DCSS %s is in use and cannot be reloaded\n",
603 "segment is in use by other driver(s)\n",name); 589 name);
604 rc = -EAGAIN; 590 rc = -EAGAIN;
605 goto out_unlock; 591 goto out_unlock;
606 } 592 }
@@ -613,8 +599,8 @@ segment_modify_shared (char *name, int do_nonshared)
613 seg->res->flags |= IORESOURCE_READONLY; 599 seg->res->flags |= IORESOURCE_READONLY;
614 600
615 if (request_resource(&iomem_resource, seg->res)) { 601 if (request_resource(&iomem_resource, seg->res)) {
616 PRINT_WARN("segment_modify_shared: could not reload segment %s" 602 pr_warning("DCSS %s overlaps with used memory resources "
617 " - overlapping resources\n", name); 603 "and cannot be reloaded\n", name);
618 rc = -EBUSY; 604 rc = -EBUSY;
619 kfree(seg->res); 605 kfree(seg->res);
620 goto out_del_mem; 606 goto out_del_mem;
@@ -632,9 +618,8 @@ segment_modify_shared (char *name, int do_nonshared)
632 goto out_del_res; 618 goto out_del_res;
633 } 619 }
634 if (diag_cc > 1) { 620 if (diag_cc > 1) {
635 PRINT_WARN ("segment_modify_shared: could not reload segment %s" 621 pr_warning("Reloading DCSS %s failed with rc=%ld\n", name,
636 " - diag returned error (%ld)\n", 622 end_addr);
637 name, end_addr);
638 rc = dcss_diag_translate_rc(end_addr); 623 rc = dcss_diag_translate_rc(end_addr);
639 goto out_del_res; 624 goto out_del_res;
640 } 625 }
@@ -673,8 +658,7 @@ segment_unload(char *name)
673 mutex_lock(&dcss_lock); 658 mutex_lock(&dcss_lock);
674 seg = segment_by_name (name); 659 seg = segment_by_name (name);
675 if (seg == NULL) { 660 if (seg == NULL) {
676 PRINT_ERR ("could not find segment %s in segment_unload, " 661 pr_err("Unloading unknown DCSS %s failed\n", name);
677 "please report to linux390@de.ibm.com\n",name);
678 goto out_unlock; 662 goto out_unlock;
679 } 663 }
680 if (atomic_dec_return(&seg->ref_count) != 0) 664 if (atomic_dec_return(&seg->ref_count) != 0)
@@ -709,8 +693,7 @@ segment_save(char *name)
709 seg = segment_by_name (name); 693 seg = segment_by_name (name);
710 694
711 if (seg == NULL) { 695 if (seg == NULL) {
712 PRINT_ERR("could not find segment %s in segment_save, please " 696 pr_err("Saving unknown DCSS %s failed\n", name);
713 "report to linux390@de.ibm.com\n", name);
714 goto out; 697 goto out;
715 } 698 }
716 699
@@ -727,14 +710,14 @@ segment_save(char *name)
727 response = 0; 710 response = 0;
728 cpcmd(cmd1, NULL, 0, &response); 711 cpcmd(cmd1, NULL, 0, &response);
729 if (response) { 712 if (response) {
730 PRINT_ERR("segment_save: DEFSEG failed with response code %i\n", 713 pr_err("Saving a DCSS failed with DEFSEG response code "
731 response); 714 "%i\n", response);
732 goto out; 715 goto out;
733 } 716 }
734 cpcmd(cmd2, NULL, 0, &response); 717 cpcmd(cmd2, NULL, 0, &response);
735 if (response) { 718 if (response) {
736 PRINT_ERR("segment_save: SAVESEG failed with response code %i\n", 719 pr_err("Saving a DCSS failed with SAVESEG response code "
737 response); 720 "%i\n", response);
738 goto out; 721 goto out;
739 } 722 }
740out: 723out:
@@ -749,44 +732,41 @@ void segment_warning(int rc, char *seg_name)
749{ 732{
750 switch (rc) { 733 switch (rc) {
751 case -ENOENT: 734 case -ENOENT:
752 PRINT_WARN("cannot load/query segment %s, " 735 pr_err("DCSS %s cannot be loaded or queried\n", seg_name);
753 "does not exist\n", seg_name);
754 break; 736 break;
755 case -ENOSYS: 737 case -ENOSYS:
756 PRINT_WARN("cannot load/query segment %s, " 738 pr_err("DCSS %s cannot be loaded or queried without "
757 "not running on VM\n", seg_name); 739 "z/VM\n", seg_name);
758 break; 740 break;
759 case -EIO: 741 case -EIO:
760 PRINT_WARN("cannot load/query segment %s, " 742 pr_err("Loading or querying DCSS %s resulted in a "
761 "hardware error\n", seg_name); 743 "hardware error\n", seg_name);
762 break; 744 break;
763 case -ENOTSUPP: 745 case -ENOTSUPP:
764 PRINT_WARN("cannot load/query segment %s, " 746 pr_err("DCSS %s has multiple page ranges and cannot be "
765 "is a multi-part segment\n", seg_name); 747 "loaded or queried\n", seg_name);
766 break; 748 break;
767 case -ENOSPC: 749 case -ENOSPC:
768 PRINT_WARN("cannot load/query segment %s, " 750 pr_err("DCSS %s overlaps with used storage and cannot "
769 "overlaps with storage\n", seg_name); 751 "be loaded\n", seg_name);
770 break; 752 break;
771 case -EBUSY: 753 case -EBUSY:
772 PRINT_WARN("cannot load/query segment %s, " 754 pr_err("%s needs used memory resources and cannot be "
773 "overlaps with already loaded dcss\n", seg_name); 755 "loaded or queried\n", seg_name);
774 break; 756 break;
775 case -EPERM: 757 case -EPERM:
776 PRINT_WARN("cannot load/query segment %s, " 758 pr_err("DCSS %s is already loaded in a different access "
777 "already loaded in incompatible mode\n", seg_name); 759 "mode\n", seg_name);
778 break; 760 break;
779 case -ENOMEM: 761 case -ENOMEM:
780 PRINT_WARN("cannot load/query segment %s, " 762 pr_err("There is not enough memory to load or query "
781 "out of memory\n", seg_name); 763 "DCSS %s\n", seg_name);
782 break; 764 break;
783 case -ERANGE: 765 case -ERANGE:
784 PRINT_WARN("cannot load/query segment %s, " 766 pr_err("DCSS %s exceeds the kernel mapping range (%lu) "
785 "exceeds kernel mapping range\n", seg_name); 767 "and cannot be loaded\n", seg_name, VMEM_MAX_PHYS);
786 break; 768 break;
787 default: 769 default:
788 PRINT_WARN("cannot load/query segment %s, "
789 "return value %i\n", seg_name, rc);
790 break; 770 break;
791 } 771 }
792} 772}