aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/pseries/scanlog.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/platforms/pseries/scanlog.c')
-rw-r--r--arch/powerpc/platforms/pseries/scanlog.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/arch/powerpc/platforms/pseries/scanlog.c b/arch/powerpc/platforms/pseries/scanlog.c
index e5b0ea870164..bec3803f0618 100644
--- a/arch/powerpc/platforms/pseries/scanlog.c
+++ b/arch/powerpc/platforms/pseries/scanlog.c
@@ -38,9 +38,7 @@
38#define SCANLOG_HWERROR -1 38#define SCANLOG_HWERROR -1
39#define SCANLOG_CONTINUE 1 39#define SCANLOG_CONTINUE 1
40 40
41#define DEBUG(A...) do { if (scanlog_debug) printk(KERN_ERR "scanlog: " A); } while (0)
42 41
43static int scanlog_debug;
44static unsigned int ibm_scan_log_dump; /* RTAS token */ 42static unsigned int ibm_scan_log_dump; /* RTAS token */
45static struct proc_dir_entry *proc_ppc64_scan_log_dump; /* The proc file */ 43static struct proc_dir_entry *proc_ppc64_scan_log_dump; /* The proc file */
46 44
@@ -86,14 +84,14 @@ static ssize_t scanlog_read(struct file *file, char __user *buf,
86 memcpy(data, rtas_data_buf, RTAS_DATA_BUF_SIZE); 84 memcpy(data, rtas_data_buf, RTAS_DATA_BUF_SIZE);
87 spin_unlock(&rtas_data_buf_lock); 85 spin_unlock(&rtas_data_buf_lock);
88 86
89 DEBUG("status=%d, data[0]=%x, data[1]=%x, data[2]=%x\n", 87 pr_debug("scanlog: status=%d, data[0]=%x, data[1]=%x, " \
90 status, data[0], data[1], data[2]); 88 "data[2]=%x\n", status, data[0], data[1], data[2]);
91 switch (status) { 89 switch (status) {
92 case SCANLOG_COMPLETE: 90 case SCANLOG_COMPLETE:
93 DEBUG("hit eof\n"); 91 pr_debug("scanlog: hit eof\n");
94 return 0; 92 return 0;
95 case SCANLOG_HWERROR: 93 case SCANLOG_HWERROR:
96 DEBUG("hardware error reading scan log data\n"); 94 pr_debug("scanlog: hardware error reading data\n");
97 return -EIO; 95 return -EIO;
98 case SCANLOG_CONTINUE: 96 case SCANLOG_CONTINUE:
99 /* We may or may not have data yet */ 97 /* We may or may not have data yet */
@@ -110,7 +108,8 @@ static ssize_t scanlog_read(struct file *file, char __user *buf,
110 /* Assume extended busy */ 108 /* Assume extended busy */
111 wait_time = rtas_busy_delay_time(status); 109 wait_time = rtas_busy_delay_time(status);
112 if (!wait_time) { 110 if (!wait_time) {
113 printk(KERN_ERR "scanlog: unknown error from rtas: %d\n", status); 111 printk(KERN_ERR "scanlog: unknown error " \
112 "from rtas: %d\n", status);
114 return -EIO; 113 return -EIO;
115 } 114 }
116 } 115 }
@@ -134,15 +133,9 @@ static ssize_t scanlog_write(struct file * file, const char __user * buf,
134 133
135 if (buf) { 134 if (buf) {
136 if (strncmp(stkbuf, "reset", 5) == 0) { 135 if (strncmp(stkbuf, "reset", 5) == 0) {
137 DEBUG("reset scanlog\n"); 136 pr_debug("scanlog: reset scanlog\n");
138 status = rtas_call(ibm_scan_log_dump, 2, 1, NULL, 0, 0); 137 status = rtas_call(ibm_scan_log_dump, 2, 1, NULL, 0, 0);
139 DEBUG("rtas returns %d\n", status); 138 pr_debug("scanlog: rtas returns %d\n", status);
140 } else if (strncmp(stkbuf, "debugon", 7) == 0) {
141 printk(KERN_ERR "scanlog: debug on\n");
142 scanlog_debug = 1;
143 } else if (strncmp(stkbuf, "debugoff", 8) == 0) {
144 printk(KERN_ERR "scanlog: debug off\n");
145 scanlog_debug = 0;
146 } 139 }
147 } 140 }
148 return count; 141 return count;