aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/s390/cio/cio.c38
-rw-r--r--drivers/s390/cio/cio_debug.h22
-rw-r--r--drivers/s390/cio/device_fsm.c8
3 files changed, 33 insertions, 35 deletions
diff --git a/drivers/s390/cio/cio.c b/drivers/s390/cio/cio.c
index 469b00774c5e..cd5475b82420 100644
--- a/drivers/s390/cio/cio.c
+++ b/drivers/s390/cio/cio.c
@@ -56,39 +56,37 @@ __setup ("cio_msg=", cio_setup);
56 56
57/* 57/*
58 * Function: cio_debug_init 58 * Function: cio_debug_init
59 * Initializes three debug logs (under /proc/s390dbf) for common I/O: 59 * Initializes three debug logs for common I/O:
60 * - cio_msg logs the messages which are printk'ed when CONFIG_DEBUG_IO is on 60 * - cio_msg logs generic cio messages
61 * - cio_trace logs the calling of different functions 61 * - cio_trace logs the calling of different functions
62 * - cio_crw logs the messages which are printk'ed when CONFIG_DEBUG_CRW is on 62 * - cio_crw logs machine check related cio messages
63 * debug levels depend on CONFIG_DEBUG_IO resp. CONFIG_DEBUG_CRW
64 */ 63 */
65static int __init 64static int __init cio_debug_init(void)
66cio_debug_init (void)
67{ 65{
68 cio_debug_msg_id = debug_register ("cio_msg", 16, 4, 16*sizeof (long)); 66 cio_debug_msg_id = debug_register("cio_msg", 16, 4, 16 * sizeof(long));
69 if (!cio_debug_msg_id) 67 if (!cio_debug_msg_id)
70 goto out_unregister; 68 goto out_unregister;
71 debug_register_view (cio_debug_msg_id, &debug_sprintf_view); 69 debug_register_view(cio_debug_msg_id, &debug_sprintf_view);
72 debug_set_level (cio_debug_msg_id, 2); 70 debug_set_level(cio_debug_msg_id, 2);
73 cio_debug_trace_id = debug_register ("cio_trace", 16, 4, 16); 71 cio_debug_trace_id = debug_register("cio_trace", 16, 4, 16);
74 if (!cio_debug_trace_id) 72 if (!cio_debug_trace_id)
75 goto out_unregister; 73 goto out_unregister;
76 debug_register_view (cio_debug_trace_id, &debug_hex_ascii_view); 74 debug_register_view(cio_debug_trace_id, &debug_hex_ascii_view);
77 debug_set_level (cio_debug_trace_id, 2); 75 debug_set_level(cio_debug_trace_id, 2);
78 cio_debug_crw_id = debug_register ("cio_crw", 4, 4, 16*sizeof (long)); 76 cio_debug_crw_id = debug_register("cio_crw", 16, 4, 16 * sizeof(long));
79 if (!cio_debug_crw_id) 77 if (!cio_debug_crw_id)
80 goto out_unregister; 78 goto out_unregister;
81 debug_register_view (cio_debug_crw_id, &debug_sprintf_view); 79 debug_register_view(cio_debug_crw_id, &debug_sprintf_view);
82 debug_set_level (cio_debug_crw_id, 2); 80 debug_set_level(cio_debug_crw_id, 4);
83 return 0; 81 return 0;
84 82
85out_unregister: 83out_unregister:
86 if (cio_debug_msg_id) 84 if (cio_debug_msg_id)
87 debug_unregister (cio_debug_msg_id); 85 debug_unregister(cio_debug_msg_id);
88 if (cio_debug_trace_id) 86 if (cio_debug_trace_id)
89 debug_unregister (cio_debug_trace_id); 87 debug_unregister(cio_debug_trace_id);
90 if (cio_debug_crw_id) 88 if (cio_debug_crw_id)
91 debug_unregister (cio_debug_crw_id); 89 debug_unregister(cio_debug_crw_id);
92 printk(KERN_WARNING"cio: could not initialize debugging\n"); 90 printk(KERN_WARNING"cio: could not initialize debugging\n");
93 return -1; 91 return -1;
94} 92}
@@ -567,7 +565,7 @@ cio_validate_subchannel (struct subchannel *sch, struct subchannel_id schid)
567 */ 565 */
568 if (sch->st != 0) { 566 if (sch->st != 0) {
569 CIO_DEBUG(KERN_INFO, 0, 567 CIO_DEBUG(KERN_INFO, 0,
570 "cio: Subchannel 0.%x.%04x reports " 568 "Subchannel 0.%x.%04x reports "
571 "non-I/O subchannel type %04X\n", 569 "non-I/O subchannel type %04X\n",
572 sch->schid.ssid, sch->schid.sch_no, sch->st); 570 sch->schid.ssid, sch->schid.sch_no, sch->st);
573 /* We stop here for non-io subchannels. */ 571 /* We stop here for non-io subchannels. */
@@ -600,7 +598,7 @@ cio_validate_subchannel (struct subchannel *sch, struct subchannel_id schid)
600 sch->lpm = sch->schib.pmcw.pam & sch->opm; 598 sch->lpm = sch->schib.pmcw.pam & sch->opm;
601 599
602 CIO_DEBUG(KERN_INFO, 0, 600 CIO_DEBUG(KERN_INFO, 0,
603 "cio: Detected device %04x on subchannel 0.%x.%04X" 601 "Detected device %04x on subchannel 0.%x.%04X"
604 " - PIM = %02X, PAM = %02X, POM = %02X\n", 602 " - PIM = %02X, PAM = %02X, POM = %02X\n",
605 sch->schib.pmcw.dev, sch->schid.ssid, 603 sch->schib.pmcw.dev, sch->schid.ssid,
606 sch->schid.sch_no, sch->schib.pmcw.pim, 604 sch->schid.sch_no, sch->schib.pmcw.pim,
diff --git a/drivers/s390/cio/cio_debug.h b/drivers/s390/cio/cio_debug.h
index c9bf8989930f..d7429ef6c666 100644
--- a/drivers/s390/cio/cio_debug.h
+++ b/drivers/s390/cio/cio_debug.h
@@ -8,20 +8,19 @@ extern debug_info_t *cio_debug_msg_id;
8extern debug_info_t *cio_debug_trace_id; 8extern debug_info_t *cio_debug_trace_id;
9extern debug_info_t *cio_debug_crw_id; 9extern debug_info_t *cio_debug_crw_id;
10 10
11#define CIO_TRACE_EVENT(imp, txt) do { \ 11#define CIO_TRACE_EVENT(imp, txt) do { \
12 debug_text_event(cio_debug_trace_id, imp, txt); \ 12 debug_text_event(cio_debug_trace_id, imp, txt); \
13 } while (0) 13 } while (0)
14 14
15#define CIO_MSG_EVENT(imp, args...) do { \ 15#define CIO_MSG_EVENT(imp, args...) do { \
16 debug_sprintf_event(cio_debug_msg_id, imp , ##args); \ 16 debug_sprintf_event(cio_debug_msg_id, imp , ##args); \
17 } while (0) 17 } while (0)
18 18
19#define CIO_CRW_EVENT(imp, args...) do { \ 19#define CIO_CRW_EVENT(imp, args...) do { \
20 debug_sprintf_event(cio_debug_crw_id, imp , ##args); \ 20 debug_sprintf_event(cio_debug_crw_id, imp , ##args); \
21 } while (0) 21 } while (0)
22 22
23static inline void 23static inline void CIO_HEX_EVENT(int level, void *data, int length)
24CIO_HEX_EVENT(int level, void *data, int length)
25{ 24{
26 if (unlikely(!cio_debug_trace_id)) 25 if (unlikely(!cio_debug_trace_id))
27 return; 26 return;
@@ -32,9 +31,10 @@ CIO_HEX_EVENT(int level, void *data, int length)
32 } 31 }
33} 32}
34 33
35#define CIO_DEBUG(printk_level,event_level,msg...) ({ \ 34#define CIO_DEBUG(printk_level, event_level, msg...) do { \
36 if (cio_show_msg) printk(printk_level msg); \ 35 if (cio_show_msg) \
37 CIO_MSG_EVENT (event_level, msg); \ 36 printk(printk_level "cio: " msg); \
38}) 37 CIO_MSG_EVENT(event_level, msg); \
38 } while (0)
39 39
40#endif 40#endif
diff --git a/drivers/s390/cio/device_fsm.c b/drivers/s390/cio/device_fsm.c
index baca6c6c9855..8b6be2142c81 100644
--- a/drivers/s390/cio/device_fsm.c
+++ b/drivers/s390/cio/device_fsm.c
@@ -318,7 +318,7 @@ ccw_device_recog_done(struct ccw_device *cdev, int state)
318 switch (state) { 318 switch (state) {
319 case DEV_STATE_NOT_OPER: 319 case DEV_STATE_NOT_OPER:
320 CIO_DEBUG(KERN_WARNING, 2, 320 CIO_DEBUG(KERN_WARNING, 2,
321 "cio: SenseID : unknown device %04x on subchannel " 321 "SenseID : unknown device %04x on subchannel "
322 "0.%x.%04x\n", cdev->private->dev_id.devno, 322 "0.%x.%04x\n", cdev->private->dev_id.devno,
323 sch->schid.ssid, sch->schid.sch_no); 323 sch->schid.ssid, sch->schid.sch_no);
324 break; 324 break;
@@ -344,7 +344,7 @@ ccw_device_recog_done(struct ccw_device *cdev, int state)
344 } 344 }
345 /* Issue device info message. */ 345 /* Issue device info message. */
346 CIO_DEBUG(KERN_INFO, 2, 346 CIO_DEBUG(KERN_INFO, 2,
347 "cio: SenseID : device 0.%x.%04x reports: " 347 "SenseID : device 0.%x.%04x reports: "
348 "CU Type/Mod = %04X/%02X, Dev Type/Mod = " 348 "CU Type/Mod = %04X/%02X, Dev Type/Mod = "
349 "%04X/%02X\n", 349 "%04X/%02X\n",
350 cdev->private->dev_id.ssid, 350 cdev->private->dev_id.ssid,
@@ -354,7 +354,7 @@ ccw_device_recog_done(struct ccw_device *cdev, int state)
354 break; 354 break;
355 case DEV_STATE_BOXED: 355 case DEV_STATE_BOXED:
356 CIO_DEBUG(KERN_WARNING, 2, 356 CIO_DEBUG(KERN_WARNING, 2,
357 "cio: SenseID : boxed device %04x on subchannel " 357 "SenseID : boxed device %04x on subchannel "
358 "0.%x.%04x\n", cdev->private->dev_id.devno, 358 "0.%x.%04x\n", cdev->private->dev_id.devno,
359 sch->schid.ssid, sch->schid.sch_no); 359 sch->schid.ssid, sch->schid.sch_no);
360 break; 360 break;
@@ -439,7 +439,7 @@ ccw_device_done(struct ccw_device *cdev, int state)
439 439
440 if (state == DEV_STATE_BOXED) 440 if (state == DEV_STATE_BOXED)
441 CIO_DEBUG(KERN_WARNING, 2, 441 CIO_DEBUG(KERN_WARNING, 2,
442 "cio: Boxed device %04x on subchannel %04x\n", 442 "Boxed device %04x on subchannel %04x\n",
443 cdev->private->dev_id.devno, sch->schid.sch_no); 443 cdev->private->dev_id.devno, sch->schid.sch_no);
444 444
445 if (cdev->private->flags.donotify) { 445 if (cdev->private->flags.donotify) {