aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390')
-rw-r--r--drivers/s390/char/monreader.c41
1 files changed, 17 insertions, 24 deletions
diff --git a/drivers/s390/char/monreader.c b/drivers/s390/char/monreader.c
index 35fd8dfcaaa6..97e63cf46944 100644
--- a/drivers/s390/char/monreader.c
+++ b/drivers/s390/char/monreader.c
@@ -7,6 +7,9 @@
7 * Author: Gerald Schaefer <gerald.schaefer@de.ibm.com> 7 * Author: Gerald Schaefer <gerald.schaefer@de.ibm.com>
8 */ 8 */
9 9
10#define KMSG_COMPONENT "monreader"
11#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
12
10#include <linux/module.h> 13#include <linux/module.h>
11#include <linux/moduleparam.h> 14#include <linux/moduleparam.h>
12#include <linux/init.h> 15#include <linux/init.h>
@@ -24,19 +27,6 @@
24#include <asm/ebcdic.h> 27#include <asm/ebcdic.h>
25#include <asm/extmem.h> 28#include <asm/extmem.h>
26 29
27//#define MON_DEBUG /* Debug messages on/off */
28
29#define MON_NAME "monreader"
30
31#define P_INFO(x...) printk(KERN_INFO MON_NAME " info: " x)
32#define P_ERROR(x...) printk(KERN_ERR MON_NAME " error: " x)
33#define P_WARNING(x...) printk(KERN_WARNING MON_NAME " warning: " x)
34
35#ifdef MON_DEBUG
36#define P_DEBUG(x...) printk(KERN_DEBUG MON_NAME " debug: " x)
37#else
38#define P_DEBUG(x...) do {} while (0)
39#endif
40 30
41#define MON_COLLECT_SAMPLE 0x80 31#define MON_COLLECT_SAMPLE 0x80
42#define MON_COLLECT_EVENT 0x40 32#define MON_COLLECT_EVENT 0x40
@@ -172,7 +162,7 @@ static int mon_send_reply(struct mon_msg *monmsg,
172 } else 162 } else
173 monmsg->replied_msglim = 1; 163 monmsg->replied_msglim = 1;
174 if (rc) { 164 if (rc) {
175 P_ERROR("read, IUCV reply failed with rc = %i\n\n", rc); 165 pr_err("Reading monitor data failed with rc=%i\n", rc);
176 return -EIO; 166 return -EIO;
177 } 167 }
178 return 0; 168 return 0;
@@ -251,7 +241,8 @@ static void mon_iucv_path_severed(struct iucv_path *path, u8 ipuser[16])
251{ 241{
252 struct mon_private *monpriv = path->private; 242 struct mon_private *monpriv = path->private;
253 243
254 P_ERROR("IUCV connection severed with rc = 0x%X\n", ipuser[0]); 244 pr_err("z/VM *MONITOR system service disconnected with rc=%i\n",
245 ipuser[0]);
255 iucv_path_sever(path, NULL); 246 iucv_path_sever(path, NULL);
256 atomic_set(&monpriv->iucv_severed, 1); 247 atomic_set(&monpriv->iucv_severed, 1);
257 wake_up(&mon_conn_wait_queue); 248 wake_up(&mon_conn_wait_queue);
@@ -266,8 +257,7 @@ static void mon_iucv_message_pending(struct iucv_path *path,
266 memcpy(&monpriv->msg_array[monpriv->write_index]->msg, 257 memcpy(&monpriv->msg_array[monpriv->write_index]->msg,
267 msg, sizeof(*msg)); 258 msg, sizeof(*msg));
268 if (atomic_inc_return(&monpriv->msglim_count) == MON_MSGLIM) { 259 if (atomic_inc_return(&monpriv->msglim_count) == MON_MSGLIM) {
269 P_WARNING("IUCV message pending, message limit (%i) reached\n", 260 pr_warning("The read queue for monitor data is full\n");
270 MON_MSGLIM);
271 monpriv->msg_array[monpriv->write_index]->msglim_reached = 1; 261 monpriv->msg_array[monpriv->write_index]->msglim_reached = 1;
272 } 262 }
273 monpriv->write_index = (monpriv->write_index + 1) % MON_MSGLIM; 263 monpriv->write_index = (monpriv->write_index + 1) % MON_MSGLIM;
@@ -311,8 +301,8 @@ static int mon_open(struct inode *inode, struct file *filp)
311 rc = iucv_path_connect(monpriv->path, &monreader_iucv_handler, 301 rc = iucv_path_connect(monpriv->path, &monreader_iucv_handler,
312 MON_SERVICE, NULL, user_data_connect, monpriv); 302 MON_SERVICE, NULL, user_data_connect, monpriv);
313 if (rc) { 303 if (rc) {
314 P_ERROR("iucv connection to *MONITOR failed with " 304 pr_err("Connecting to the z/VM *MONITOR system service "
315 "IPUSER SEVER code = %i\n", rc); 305 "failed with rc=%i\n", rc);
316 rc = -EIO; 306 rc = -EIO;
317 goto out_path; 307 goto out_path;
318 } 308 }
@@ -353,7 +343,8 @@ static int mon_close(struct inode *inode, struct file *filp)
353 */ 343 */
354 rc = iucv_path_sever(monpriv->path, user_data_sever); 344 rc = iucv_path_sever(monpriv->path, user_data_sever);
355 if (rc) 345 if (rc)
356 P_ERROR("close, iucv_sever failed with rc = %i\n", rc); 346 pr_warning("Disconnecting the z/VM *MONITOR system service "
347 "failed with rc=%i\n", rc);
357 348
358 atomic_set(&monpriv->iucv_severed, 0); 349 atomic_set(&monpriv->iucv_severed, 0);
359 atomic_set(&monpriv->iucv_connected, 0); 350 atomic_set(&monpriv->iucv_connected, 0);
@@ -469,7 +460,8 @@ static int __init mon_init(void)
469 int rc; 460 int rc;
470 461
471 if (!MACHINE_IS_VM) { 462 if (!MACHINE_IS_VM) {
472 P_ERROR("not running under z/VM, driver not loaded\n"); 463 pr_err("The z/VM *MONITOR record device driver cannot be "
464 "loaded without z/VM\n");
473 return -ENODEV; 465 return -ENODEV;
474 } 466 }
475 467
@@ -478,7 +470,8 @@ static int __init mon_init(void)
478 */ 470 */
479 rc = iucv_register(&monreader_iucv_handler, 1); 471 rc = iucv_register(&monreader_iucv_handler, 1);
480 if (rc) { 472 if (rc) {
481 P_ERROR("failed to register with iucv driver\n"); 473 pr_err("The z/VM *MONITOR record device driver failed to "
474 "register with IUCV\n");
482 return rc; 475 return rc;
483 } 476 }
484 477
@@ -488,8 +481,8 @@ static int __init mon_init(void)
488 goto out_iucv; 481 goto out_iucv;
489 } 482 }
490 if (rc != SEG_TYPE_SC) { 483 if (rc != SEG_TYPE_SC) {
491 P_ERROR("segment %s has unsupported type, should be SC\n", 484 pr_err("The specified *MONITOR DCSS %s does not have the "
492 mon_dcss_name); 485 "required type SC\n", mon_dcss_name);
493 rc = -EINVAL; 486 rc = -EINVAL;
494 goto out_iucv; 487 goto out_iucv;
495 } 488 }