aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/cio
diff options
context:
space:
mode:
authorJan Glauber <jang@linux.vnet.ibm.com>2008-12-25 07:38:46 -0500
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2008-12-25 07:38:59 -0500
commit22f9934767f49012ffbae753b28b8055bd28348f (patch)
tree7cb58ceff25b9c6b5ade5646b6444b7689621f81 /drivers/s390/cio
parent9a1ce28aeb7a8b1666eaa9f104c1a2f5a149f9df (diff)
[S390] qdio: rework debug feature logging
- make qdio_trace a per device view - remove s390dbf exceptions - remove CONFIG_QDIO_DEBUG, not needed anymore if we check for the level before calling sprintf - use snprintf for dbf entries - add start markers to see if the dbf view wrapped - add a global error view for all queues Signed-off-by: Jan Glauber <jang@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390/cio')
-rw-r--r--drivers/s390/cio/qdio.h3
-rw-r--r--drivers/s390/cio/qdio_debug.c97
-rw-r--r--drivers/s390/cio/qdio_debug.h112
-rw-r--r--drivers/s390/cio/qdio_main.c324
-rw-r--r--drivers/s390/cio/qdio_setup.c110
-rw-r--r--drivers/s390/cio/qdio_thinint.c25
6 files changed, 238 insertions, 433 deletions
diff --git a/drivers/s390/cio/qdio.h b/drivers/s390/cio/qdio.h
index e4e33839c7fe..7b50882577d5 100644
--- a/drivers/s390/cio/qdio.h
+++ b/drivers/s390/cio/qdio.h
@@ -10,6 +10,7 @@
10 10
11#include <asm/page.h> 11#include <asm/page.h>
12#include <asm/schid.h> 12#include <asm/schid.h>
13#include <asm/debug.h>
13#include "chsc.h" 14#include "chsc.h"
14 15
15#define QDIO_BUSY_BIT_PATIENCE 100 /* 100 microseconds */ 16#define QDIO_BUSY_BIT_PATIENCE 100 /* 100 microseconds */
@@ -300,11 +301,13 @@ struct qdio_irq {
300 struct qdio_q *input_qs[QDIO_MAX_QUEUES_PER_IRQ]; 301 struct qdio_q *input_qs[QDIO_MAX_QUEUES_PER_IRQ];
301 struct qdio_q *output_qs[QDIO_MAX_QUEUES_PER_IRQ]; 302 struct qdio_q *output_qs[QDIO_MAX_QUEUES_PER_IRQ];
302 303
304 debug_info_t *debug_area;
303 struct mutex setup_mutex; 305 struct mutex setup_mutex;
304}; 306};
305 307
306/* helper functions */ 308/* helper functions */
307#define queue_type(q) q->irq_ptr->qib.qfmt 309#define queue_type(q) q->irq_ptr->qib.qfmt
310#define SCH_NO(q) (q->irq_ptr->schid.sch_no)
308 311
309#define is_thinint_irq(irq) \ 312#define is_thinint_irq(irq) \
310 (irq->qib.qfmt == QDIO_IQDIO_QFMT || \ 313 (irq->qib.qfmt == QDIO_IQDIO_QFMT || \
diff --git a/drivers/s390/cio/qdio_debug.c b/drivers/s390/cio/qdio_debug.c
index f05590355be8..0add07c1b5d2 100644
--- a/drivers/s390/cio/qdio_debug.c
+++ b/drivers/s390/cio/qdio_debug.c
@@ -14,7 +14,7 @@
14#include "qdio.h" 14#include "qdio.h"
15 15
16debug_info_t *qdio_dbf_setup; 16debug_info_t *qdio_dbf_setup;
17debug_info_t *qdio_dbf_trace; 17debug_info_t *qdio_dbf_error;
18 18
19static struct dentry *debugfs_root; 19static struct dentry *debugfs_root;
20#define MAX_DEBUGFS_QUEUES 32 20#define MAX_DEBUGFS_QUEUES 32
@@ -22,59 +22,33 @@ static struct dentry *debugfs_queues[MAX_DEBUGFS_QUEUES] = { NULL };
22static DEFINE_MUTEX(debugfs_mutex); 22static DEFINE_MUTEX(debugfs_mutex);
23#define QDIO_DEBUGFS_NAME_LEN 40 23#define QDIO_DEBUGFS_NAME_LEN 40
24 24
25void qdio_allocate_do_dbf(struct qdio_initialize *init_data) 25void qdio_allocate_dbf(struct qdio_initialize *init_data,
26 struct qdio_irq *irq_ptr)
26{ 27{
27 char dbf_text[20]; 28 char text[20];
28 29
29 sprintf(dbf_text, "qfmt:%x", init_data->q_format); 30 DBF_EVENT("qfmt:%1d", init_data->q_format);
30 QDIO_DBF_TEXT0(0, setup, dbf_text); 31 DBF_HEX(init_data->adapter_name, 8);
31 QDIO_DBF_HEX0(0, setup, init_data->adapter_name, 8); 32 DBF_EVENT("qpff%4x", init_data->qib_param_field_format);
32 sprintf(dbf_text, "qpff%4x", init_data->qib_param_field_format); 33 DBF_HEX(&init_data->qib_param_field, sizeof(void *));
33 QDIO_DBF_TEXT0(0, setup, dbf_text); 34 DBF_HEX(&init_data->input_slib_elements, sizeof(void *));
34 QDIO_DBF_HEX0(0, setup, &init_data->qib_param_field, sizeof(void *)); 35 DBF_HEX(&init_data->output_slib_elements, sizeof(void *));
35 QDIO_DBF_HEX0(0, setup, &init_data->input_slib_elements, sizeof(void *)); 36 DBF_EVENT("niq:%1d noq:%1d", init_data->no_input_qs,
36 QDIO_DBF_HEX0(0, setup, &init_data->output_slib_elements, sizeof(void *)); 37 init_data->no_output_qs);
37 sprintf(dbf_text, "niq:%4x", init_data->no_input_qs); 38 DBF_HEX(&init_data->input_handler, sizeof(void *));
38 QDIO_DBF_TEXT0(0, setup, dbf_text); 39 DBF_HEX(&init_data->output_handler, sizeof(void *));
39 sprintf(dbf_text, "noq:%4x", init_data->no_output_qs); 40 DBF_HEX(&init_data->int_parm, sizeof(long));
40 QDIO_DBF_TEXT0(0, setup, dbf_text); 41 DBF_HEX(&init_data->flags, sizeof(long));
41 QDIO_DBF_HEX0(0, setup, &init_data->input_handler, sizeof(void *)); 42 DBF_HEX(&init_data->input_sbal_addr_array, sizeof(void *));
42 QDIO_DBF_HEX0(0, setup, &init_data->output_handler, sizeof(void *)); 43 DBF_HEX(&init_data->output_sbal_addr_array, sizeof(void *));
43 QDIO_DBF_HEX0(0, setup, &init_data->int_parm, sizeof(long)); 44 DBF_EVENT("irq:%8lx", (unsigned long)irq_ptr);
44 QDIO_DBF_HEX0(0, setup, &init_data->flags, sizeof(long)); 45
45 QDIO_DBF_HEX0(0, setup, &init_data->input_sbal_addr_array, sizeof(void *)); 46 /* allocate trace view for the interface */
46 QDIO_DBF_HEX0(0, setup, &init_data->output_sbal_addr_array, sizeof(void *)); 47 snprintf(text, 20, "qdio_%s", dev_name(&init_data->cdev->dev));
47} 48 irq_ptr->debug_area = debug_register(text, 2, 1, 16);
48 49 debug_register_view(irq_ptr->debug_area, &debug_hex_ascii_view);
49static void qdio_unregister_dbf_views(void) 50 debug_set_level(irq_ptr->debug_area, DBF_WARN);
50{ 51 DBF_DEV_EVENT(DBF_ERR, irq_ptr, "dbf created");
51 if (qdio_dbf_setup)
52 debug_unregister(qdio_dbf_setup);
53 if (qdio_dbf_trace)
54 debug_unregister(qdio_dbf_trace);
55}
56
57static int qdio_register_dbf_views(void)
58{
59 qdio_dbf_setup = debug_register("qdio_setup", QDIO_DBF_SETUP_PAGES,
60 QDIO_DBF_SETUP_NR_AREAS,
61 QDIO_DBF_SETUP_LEN);
62 if (!qdio_dbf_setup)
63 goto oom;
64 debug_register_view(qdio_dbf_setup, &debug_hex_ascii_view);
65 debug_set_level(qdio_dbf_setup, QDIO_DBF_SETUP_LEVEL);
66
67 qdio_dbf_trace = debug_register("qdio_trace", QDIO_DBF_TRACE_PAGES,
68 QDIO_DBF_TRACE_NR_AREAS,
69 QDIO_DBF_TRACE_LEN);
70 if (!qdio_dbf_trace)
71 goto oom;
72 debug_register_view(qdio_dbf_trace, &debug_hex_ascii_view);
73 debug_set_level(qdio_dbf_trace, QDIO_DBF_TRACE_LEVEL);
74 return 0;
75oom:
76 qdio_unregister_dbf_views();
77 return -ENOMEM;
78} 52}
79 53
80static int qstat_show(struct seq_file *m, void *v) 54static int qstat_show(struct seq_file *m, void *v)
@@ -223,11 +197,24 @@ void qdio_shutdown_debug_entries(struct qdio_irq *irq_ptr, struct ccw_device *cd
223int __init qdio_debug_init(void) 197int __init qdio_debug_init(void)
224{ 198{
225 debugfs_root = debugfs_create_dir("qdio_queues", NULL); 199 debugfs_root = debugfs_create_dir("qdio_queues", NULL);
226 return qdio_register_dbf_views(); 200
201 qdio_dbf_setup = debug_register("qdio_setup", 16, 1, 16);
202 debug_register_view(qdio_dbf_setup, &debug_hex_ascii_view);
203 debug_set_level(qdio_dbf_setup, DBF_INFO);
204 DBF_EVENT("dbf created\n");
205
206 qdio_dbf_error = debug_register("qdio_error", 4, 1, 16);
207 debug_register_view(qdio_dbf_error, &debug_hex_ascii_view);
208 debug_set_level(qdio_dbf_error, DBF_INFO);
209 DBF_ERROR("dbf created\n");
210 return 0;
227} 211}
228 212
229void qdio_debug_exit(void) 213void qdio_debug_exit(void)
230{ 214{
231 debugfs_remove(debugfs_root); 215 debugfs_remove(debugfs_root);
232 qdio_unregister_dbf_views(); 216 if (qdio_dbf_setup)
217 debug_unregister(qdio_dbf_setup);
218 if (qdio_dbf_error)
219 debug_unregister(qdio_dbf_error);
233} 220}
diff --git a/drivers/s390/cio/qdio_debug.h b/drivers/s390/cio/qdio_debug.h
index 5a4d85b829ad..5d70bd162ae9 100644
--- a/drivers/s390/cio/qdio_debug.h
+++ b/drivers/s390/cio/qdio_debug.h
@@ -12,80 +12,72 @@
12#include <asm/qdio.h> 12#include <asm/qdio.h>
13#include "qdio.h" 13#include "qdio.h"
14 14
15#define QDIO_DBF_HEX(ex, name, level, addr, len) \ 15/* that gives us 15 characters in the text event views */
16#define QDIO_DBF_LEN 16
17
18extern debug_info_t *qdio_dbf_setup;
19extern debug_info_t *qdio_dbf_error;
20
21/* sort out low debug levels early to avoid wasted sprints */
22static inline int qdio_dbf_passes(debug_info_t *dbf_grp, int level)
23{
24 return (level <= dbf_grp->level);
25}
26
27#define DBF_ERR 3 /* error conditions */
28#define DBF_WARN 4 /* warning conditions */
29#define DBF_INFO 6 /* informational */
30
31#undef DBF_EVENT
32#undef DBF_ERROR
33#undef DBF_DEV_EVENT
34
35#define DBF_EVENT(text...) \
16 do { \ 36 do { \
17 if (ex) \ 37 char debug_buffer[QDIO_DBF_LEN]; \
18 debug_exception(qdio_dbf_##name, level, (void *)(addr), len); \ 38 snprintf(debug_buffer, QDIO_DBF_LEN, text); \
19 else \ 39 debug_text_event(qdio_dbf_setup, DBF_ERR, debug_buffer); \
20 debug_event(qdio_dbf_##name, level, (void *)(addr), len); \
21 } while (0) 40 } while (0)
22#define QDIO_DBF_TEXT(ex, name, level, text) \ 41
42#define DBF_HEX(addr, len) \
23 do { \ 43 do { \
24 if (ex) \ 44 debug_event(qdio_dbf_setup, DBF_ERR, (void*)(addr), len); \
25 debug_text_exception(qdio_dbf_##name, level, text); \
26 else \
27 debug_text_event(qdio_dbf_##name, level, text); \
28 } while (0) 45 } while (0)
29 46
30#define QDIO_DBF_HEX0(ex, name, addr, len) QDIO_DBF_HEX(ex, name, 0, addr, len) 47#define DBF_ERROR(text...) \
31#define QDIO_DBF_HEX1(ex, name, addr, len) QDIO_DBF_HEX(ex, name, 1, addr, len) 48 do { \
32#define QDIO_DBF_HEX2(ex, name, addr, len) QDIO_DBF_HEX(ex, name, 2, addr, len) 49 char debug_buffer[QDIO_DBF_LEN]; \
33 50 snprintf(debug_buffer, QDIO_DBF_LEN, text); \
34#ifdef CONFIG_QDIO_DEBUG 51 debug_text_event(qdio_dbf_error, DBF_ERR, debug_buffer); \
35#define QDIO_DBF_HEX3(ex, name, addr, len) QDIO_DBF_HEX(ex, name, 3, addr, len) 52 } while (0)
36#define QDIO_DBF_HEX4(ex, name, addr, len) QDIO_DBF_HEX(ex, name, 4, addr, len)
37#define QDIO_DBF_HEX5(ex, name, addr, len) QDIO_DBF_HEX(ex, name, 5, addr, len)
38#define QDIO_DBF_HEX6(ex, name, addr, len) QDIO_DBF_HEX(ex, name, 6, addr, len)
39#else
40#define QDIO_DBF_HEX3(ex, name, addr, len) do {} while (0)
41#define QDIO_DBF_HEX4(ex, name, addr, len) do {} while (0)
42#define QDIO_DBF_HEX5(ex, name, addr, len) do {} while (0)
43#define QDIO_DBF_HEX6(ex, name, addr, len) do {} while (0)
44#endif /* CONFIG_QDIO_DEBUG */
45
46#define QDIO_DBF_TEXT0(ex, name, text) QDIO_DBF_TEXT(ex, name, 0, text)
47#define QDIO_DBF_TEXT1(ex, name, text) QDIO_DBF_TEXT(ex, name, 1, text)
48#define QDIO_DBF_TEXT2(ex, name, text) QDIO_DBF_TEXT(ex, name, 2, text)
49
50#ifdef CONFIG_QDIO_DEBUG
51#define QDIO_DBF_TEXT3(ex, name, text) QDIO_DBF_TEXT(ex, name, 3, text)
52#define QDIO_DBF_TEXT4(ex, name, text) QDIO_DBF_TEXT(ex, name, 4, text)
53#define QDIO_DBF_TEXT5(ex, name, text) QDIO_DBF_TEXT(ex, name, 5, text)
54#define QDIO_DBF_TEXT6(ex, name, text) QDIO_DBF_TEXT(ex, name, 6, text)
55#else
56#define QDIO_DBF_TEXT3(ex, name, text) do {} while (0)
57#define QDIO_DBF_TEXT4(ex, name, text) do {} while (0)
58#define QDIO_DBF_TEXT5(ex, name, text) do {} while (0)
59#define QDIO_DBF_TEXT6(ex, name, text) do {} while (0)
60#endif /* CONFIG_QDIO_DEBUG */
61 53
62/* s390dbf views */ 54#define DBF_ERROR_HEX(addr, len) \
63#define QDIO_DBF_SETUP_LEN 8 55 do { \
64#define QDIO_DBF_SETUP_PAGES 8 56 debug_event(qdio_dbf_error, DBF_ERR, (void*)(addr), len); \
65#define QDIO_DBF_SETUP_NR_AREAS 1 57 } while (0)
66 58
67#define QDIO_DBF_TRACE_LEN 8
68#define QDIO_DBF_TRACE_NR_AREAS 2
69 59
70#ifdef CONFIG_QDIO_DEBUG 60#define DBF_DEV_EVENT(level, device, text...) \
71#define QDIO_DBF_TRACE_PAGES 32 61 do { \
72#define QDIO_DBF_SETUP_LEVEL 6 62 char debug_buffer[QDIO_DBF_LEN]; \
73#define QDIO_DBF_TRACE_LEVEL 4 63 if (qdio_dbf_passes(device->debug_area, level)) { \
74#else /* !CONFIG_QDIO_DEBUG */ 64 snprintf(debug_buffer, QDIO_DBF_LEN, text); \
75#define QDIO_DBF_TRACE_PAGES 8 65 debug_text_event(device->debug_area, level, debug_buffer); \
76#define QDIO_DBF_SETUP_LEVEL 2 66 } \
77#define QDIO_DBF_TRACE_LEVEL 2 67 } while (0)
78#endif /* CONFIG_QDIO_DEBUG */
79 68
80extern debug_info_t *qdio_dbf_setup; 69#define DBF_DEV_HEX(level, device, addr, len) \
81extern debug_info_t *qdio_dbf_trace; 70 do { \
71 debug_event(device->debug_area, level, (void*)(addr), len); \
72 } while (0)
82 73
83void qdio_allocate_do_dbf(struct qdio_initialize *init_data); 74void qdio_allocate_dbf(struct qdio_initialize *init_data,
84void debug_print_bstat(struct qdio_q *q); 75 struct qdio_irq *irq_ptr);
85void qdio_setup_debug_entries(struct qdio_irq *irq_ptr, 76void qdio_setup_debug_entries(struct qdio_irq *irq_ptr,
86 struct ccw_device *cdev); 77 struct ccw_device *cdev);
87void qdio_shutdown_debug_entries(struct qdio_irq *irq_ptr, 78void qdio_shutdown_debug_entries(struct qdio_irq *irq_ptr,
88 struct ccw_device *cdev); 79 struct ccw_device *cdev);
89int qdio_debug_init(void); 80int qdio_debug_init(void);
90void qdio_debug_exit(void); 81void qdio_debug_exit(void);
82
91#endif 83#endif
diff --git a/drivers/s390/cio/qdio_main.c b/drivers/s390/cio/qdio_main.c
index 9e6ab41e5a3c..c810214d3d08 100644
--- a/drivers/s390/cio/qdio_main.c
+++ b/drivers/s390/cio/qdio_main.c
@@ -95,8 +95,6 @@ static inline int do_siga_output(unsigned long schid, unsigned long mask,
95 95
96static inline int qdio_check_ccq(struct qdio_q *q, unsigned int ccq) 96static inline int qdio_check_ccq(struct qdio_q *q, unsigned int ccq)
97{ 97{
98 char dbf_text[15];
99
100 /* all done or next buffer state different */ 98 /* all done or next buffer state different */
101 if (ccq == 0 || ccq == 32) 99 if (ccq == 0 || ccq == 32)
102 return 0; 100 return 0;
@@ -104,8 +102,7 @@ static inline int qdio_check_ccq(struct qdio_q *q, unsigned int ccq)
104 if (ccq == 96 || ccq == 97) 102 if (ccq == 96 || ccq == 97)
105 return 1; 103 return 1;
106 /* notify devices immediately */ 104 /* notify devices immediately */
107 sprintf(dbf_text, "%d", ccq); 105 DBF_ERROR("%4x ccq:%3d", SCH_NO(q), ccq);
108 QDIO_DBF_TEXT2(1, trace, dbf_text);
109 return -EIO; 106 return -EIO;
110} 107}
111 108
@@ -126,7 +123,6 @@ static int qdio_do_eqbs(struct qdio_q *q, unsigned char *state,
126 int tmp_count = count, tmp_start = start; 123 int tmp_count = count, tmp_start = start;
127 int nr = q->nr; 124 int nr = q->nr;
128 int rc; 125 int rc;
129 char dbf_text[15];
130 126
131 BUG_ON(!q->irq_ptr->sch_token); 127 BUG_ON(!q->irq_ptr->sch_token);
132 qdio_perf_stat_inc(&perf_stats.debug_eqbs_all); 128 qdio_perf_stat_inc(&perf_stats.debug_eqbs_all);
@@ -144,15 +140,15 @@ again:
144 qdio_perf_stat_inc(&perf_stats.debug_eqbs_incomplete); 140 qdio_perf_stat_inc(&perf_stats.debug_eqbs_incomplete);
145 return (count - tmp_count); 141 return (count - tmp_count);
146 } 142 }
143
147 if (rc == 1) { 144 if (rc == 1) {
148 QDIO_DBF_TEXT5(1, trace, "eqAGAIN"); 145 DBF_DEV_EVENT(DBF_WARN, q->irq_ptr, "EQBS again:%2d", ccq);
149 goto again; 146 goto again;
150 } 147 }
151 148
152 if (rc < 0) { 149 if (rc < 0) {
153 QDIO_DBF_TEXT2(1, trace, "eqberr"); 150 DBF_ERROR("%4x EQBS ERROR", SCH_NO(q));
154 sprintf(dbf_text, "%2x,%2x,%d,%d", count, tmp_count, ccq, nr); 151 DBF_ERROR("%3d%3d%2d", count, tmp_count, nr);
155 QDIO_DBF_TEXT2(1, trace, dbf_text);
156 q->handler(q->irq_ptr->cdev, 152 q->handler(q->irq_ptr->cdev,
157 QDIO_ERROR_ACTIVATE_CHECK_CONDITION, 153 QDIO_ERROR_ACTIVATE_CHECK_CONDITION,
158 0, -1, -1, q->irq_ptr->int_parm); 154 0, -1, -1, q->irq_ptr->int_parm);
@@ -179,7 +175,6 @@ static int qdio_do_sqbs(struct qdio_q *q, unsigned char state, int start,
179 int tmp_count = count, tmp_start = start; 175 int tmp_count = count, tmp_start = start;
180 int nr = q->nr; 176 int nr = q->nr;
181 int rc; 177 int rc;
182 char dbf_text[15];
183 178
184 BUG_ON(!q->irq_ptr->sch_token); 179 BUG_ON(!q->irq_ptr->sch_token);
185 qdio_perf_stat_inc(&perf_stats.debug_sqbs_all); 180 qdio_perf_stat_inc(&perf_stats.debug_sqbs_all);
@@ -190,17 +185,13 @@ again:
190 ccq = do_sqbs(q->irq_ptr->sch_token, state, nr, &tmp_start, &tmp_count); 185 ccq = do_sqbs(q->irq_ptr->sch_token, state, nr, &tmp_start, &tmp_count);
191 rc = qdio_check_ccq(q, ccq); 186 rc = qdio_check_ccq(q, ccq);
192 if (rc == 1) { 187 if (rc == 1) {
193 QDIO_DBF_TEXT5(1, trace, "sqAGAIN"); 188 DBF_DEV_EVENT(DBF_INFO, q->irq_ptr, "SQBS again:%2d", ccq);
194 qdio_perf_stat_inc(&perf_stats.debug_sqbs_incomplete); 189 qdio_perf_stat_inc(&perf_stats.debug_sqbs_incomplete);
195 goto again; 190 goto again;
196 } 191 }
197 if (rc < 0) { 192 if (rc < 0) {
198 QDIO_DBF_TEXT3(1, trace, "sqberr"); 193 DBF_ERROR("%4x SQBS ERROR", SCH_NO(q));
199 sprintf(dbf_text, "%2x,%2x", count, tmp_count); 194 DBF_ERROR("%3d%3d%2d", count, tmp_count, nr);
200 QDIO_DBF_TEXT3(1, trace, dbf_text);
201 sprintf(dbf_text, "%d,%d", ccq, nr);
202 QDIO_DBF_TEXT3(1, trace, dbf_text);
203
204 q->handler(q->irq_ptr->cdev, 195 q->handler(q->irq_ptr->cdev,
205 QDIO_ERROR_ACTIVATE_CHECK_CONDITION, 196 QDIO_ERROR_ACTIVATE_CHECK_CONDITION,
206 0, -1, -1, q->irq_ptr->int_parm); 197 0, -1, -1, q->irq_ptr->int_parm);
@@ -287,14 +278,13 @@ static int qdio_siga_sync(struct qdio_q *q, unsigned int output,
287 if (!need_siga_sync(q)) 278 if (!need_siga_sync(q))
288 return 0; 279 return 0;
289 280
281 DBF_DEV_EVENT(DBF_INFO, q->irq_ptr, "siga-s:");
282 DBF_DEV_HEX(DBF_INFO, q->irq_ptr, q, sizeof(void *));
290 qdio_perf_stat_inc(&perf_stats.siga_sync); 283 qdio_perf_stat_inc(&perf_stats.siga_sync);
291 284
292 cc = do_siga_sync(q->irq_ptr->schid, output, input); 285 cc = do_siga_sync(q->irq_ptr->schid, output, input);
293 if (cc) { 286 if (cc)
294 QDIO_DBF_TEXT4(0, trace, "sigasync"); 287 DBF_ERROR("%4x SIGA-S:%2d", SCH_NO(q), cc);
295 QDIO_DBF_HEX4(0, trace, &q, sizeof(void *));
296 QDIO_DBF_HEX3(0, trace, &cc, sizeof(int *));
297 }
298 return cc; 288 return cc;
299} 289}
300 290
@@ -338,17 +328,13 @@ static int qdio_siga_output(struct qdio_q *q)
338 int cc; 328 int cc;
339 u32 busy_bit; 329 u32 busy_bit;
340 u64 start_time = 0; 330 u64 start_time = 0;
341 char dbf_text[15];
342
343 QDIO_DBF_TEXT5(0, trace, "sigaout");
344 QDIO_DBF_HEX5(0, trace, &q, sizeof(void *));
345 331
332 DBF_DEV_EVENT(DBF_INFO, q->irq_ptr, "siga-w:%1d", q->nr);
346 qdio_perf_stat_inc(&perf_stats.siga_out); 333 qdio_perf_stat_inc(&perf_stats.siga_out);
347again: 334again:
348 cc = qdio_do_siga_output(q, &busy_bit); 335 cc = qdio_do_siga_output(q, &busy_bit);
349 if (queue_type(q) == QDIO_IQDIO_QFMT && cc == 2 && busy_bit) { 336 if (queue_type(q) == QDIO_IQDIO_QFMT && cc == 2 && busy_bit) {
350 sprintf(dbf_text, "bb%4x%2x", q->irq_ptr->schid.sch_no, q->nr); 337 DBF_DEV_EVENT(DBF_INFO, q->irq_ptr, "siga-w bb:%2d", q->nr);
351 QDIO_DBF_TEXT3(0, trace, dbf_text);
352 338
353 if (!start_time) 339 if (!start_time)
354 start_time = get_usecs(); 340 start_time = get_usecs();
@@ -359,7 +345,7 @@ again:
359 if (cc == 2 && busy_bit) 345 if (cc == 2 && busy_bit)
360 cc |= QDIO_ERROR_SIGA_BUSY; 346 cc |= QDIO_ERROR_SIGA_BUSY;
361 if (cc) 347 if (cc)
362 QDIO_DBF_HEX3(0, trace, &cc, sizeof(int *)); 348 DBF_ERROR("%4x SIGA-W:%2d", SCH_NO(q), cc);
363 return cc; 349 return cc;
364} 350}
365 351
@@ -367,14 +353,12 @@ static inline int qdio_siga_input(struct qdio_q *q)
367{ 353{
368 int cc; 354 int cc;
369 355
370 QDIO_DBF_TEXT4(0, trace, "sigain"); 356 DBF_DEV_EVENT(DBF_INFO, q->irq_ptr, "siga-r:%1d", q->nr);
371 QDIO_DBF_HEX4(0, trace, &q, sizeof(void *));
372
373 qdio_perf_stat_inc(&perf_stats.siga_in); 357 qdio_perf_stat_inc(&perf_stats.siga_in);
374 358
375 cc = do_siga_input(q->irq_ptr->schid, q->mask); 359 cc = do_siga_input(q->irq_ptr->schid, q->mask);
376 if (cc) 360 if (cc)
377 QDIO_DBF_HEX3(0, trace, &cc, sizeof(int *)); 361 DBF_ERROR("%4x SIGA-R:%2d", SCH_NO(q), cc);
378 return cc; 362 return cc;
379} 363}
380 364
@@ -407,18 +391,12 @@ inline void qdio_stop_polling(struct qdio_q *q)
407 391
408static void announce_buffer_error(struct qdio_q *q) 392static void announce_buffer_error(struct qdio_q *q)
409{ 393{
410 char dbf_text[15]; 394 DBF_ERROR("%4x BUF ERROR", SCH_NO(q));
411 395 DBF_ERROR((q->is_input_q) ? "IN:%2d" : "OUT:%2d", q->nr);
412 if (q->is_input_q) 396 DBF_ERROR("FTC:%3d", q->first_to_check);
413 QDIO_DBF_TEXT3(1, trace, "inperr"); 397 DBF_ERROR("F14:%2x F15:%2x",
414 else 398 q->sbal[q->first_to_check]->element[14].flags & 0xff,
415 QDIO_DBF_TEXT3(0, trace, "outperr"); 399 q->sbal[q->first_to_check]->element[15].flags & 0xff);
416
417 sprintf(dbf_text, "%x-%x-%x", q->first_to_check,
418 q->sbal[q->first_to_check]->element[14].flags,
419 q->sbal[q->first_to_check]->element[15].flags);
420 QDIO_DBF_TEXT3(1, trace, dbf_text);
421 QDIO_DBF_HEX2(1, trace, q->sbal[q->first_to_check], 256);
422 400
423 q->qdio_error = QDIO_ERROR_SLSB_STATE; 401 q->qdio_error = QDIO_ERROR_SLSB_STATE;
424} 402}
@@ -461,7 +439,7 @@ check_next:
461 439
462 switch (state) { 440 switch (state) {
463 case SLSB_P_INPUT_PRIMED: 441 case SLSB_P_INPUT_PRIMED:
464 QDIO_DBF_TEXT5(0, trace, "inptprim"); 442 DBF_DEV_EVENT(DBF_INFO, q->irq_ptr, "in prim: %3d", count);
465 443
466 /* 444 /*
467 * Only ACK the first buffer. The ACK will be removed in 445 * Only ACK the first buffer. The ACK will be removed in
@@ -500,13 +478,12 @@ check_next:
500 case SLSB_CU_INPUT_EMPTY: 478 case SLSB_CU_INPUT_EMPTY:
501 case SLSB_P_INPUT_NOT_INIT: 479 case SLSB_P_INPUT_NOT_INIT:
502 case SLSB_P_INPUT_ACK: 480 case SLSB_P_INPUT_ACK:
503 QDIO_DBF_TEXT5(0, trace, "inpnipro"); 481 DBF_DEV_EVENT(DBF_INFO, q->irq_ptr, "in nop");
504 break; 482 break;
505 default: 483 default:
506 BUG(); 484 BUG();
507 } 485 }
508out: 486out:
509 QDIO_DBF_HEX4(0, trace, &q->first_to_check, sizeof(int));
510 return q->first_to_check; 487 return q->first_to_check;
511} 488}
512 489
@@ -520,8 +497,7 @@ int qdio_inbound_q_moved(struct qdio_q *q)
520 if (!need_siga_sync(q) && !pci_out_supported(q)) 497 if (!need_siga_sync(q) && !pci_out_supported(q))
521 q->u.in.timestamp = get_usecs(); 498 q->u.in.timestamp = get_usecs();
522 499
523 QDIO_DBF_TEXT4(0, trace, "inhasmvd"); 500 DBF_DEV_EVENT(DBF_INFO, q->irq_ptr, "in moved");
524 QDIO_DBF_HEX4(0, trace, &q, sizeof(void *));
525 return 1; 501 return 1;
526 } else 502 } else
527 return 0; 503 return 0;
@@ -530,9 +506,6 @@ int qdio_inbound_q_moved(struct qdio_q *q)
530static int qdio_inbound_q_done(struct qdio_q *q) 506static int qdio_inbound_q_done(struct qdio_q *q)
531{ 507{
532 unsigned char state = 0; 508 unsigned char state = 0;
533#ifdef CONFIG_QDIO_DEBUG
534 char dbf_text[15];
535#endif
536 509
537 if (!atomic_read(&q->nr_buf_used)) 510 if (!atomic_read(&q->nr_buf_used))
538 return 1; 511 return 1;
@@ -557,20 +530,12 @@ static int qdio_inbound_q_done(struct qdio_q *q)
557 * has (probably) not moved (see qdio_inbound_processing). 530 * has (probably) not moved (see qdio_inbound_processing).
558 */ 531 */
559 if (get_usecs() > q->u.in.timestamp + QDIO_INPUT_THRESHOLD) { 532 if (get_usecs() > q->u.in.timestamp + QDIO_INPUT_THRESHOLD) {
560#ifdef CONFIG_QDIO_DEBUG 533 DBF_DEV_EVENT(DBF_INFO, q->irq_ptr, "in done:%3d",
561 QDIO_DBF_TEXT4(0, trace, "inqisdon"); 534 q->first_to_check);
562 QDIO_DBF_HEX4(0, trace, &q, sizeof(void *));
563 sprintf(dbf_text, "pf%02x", q->first_to_check);
564 QDIO_DBF_TEXT4(0, trace, dbf_text);
565#endif /* CONFIG_QDIO_DEBUG */
566 return 1; 535 return 1;
567 } else { 536 } else {
568#ifdef CONFIG_QDIO_DEBUG 537 DBF_DEV_EVENT(DBF_INFO, q->irq_ptr, "in notd:%3d",
569 QDIO_DBF_TEXT4(0, trace, "inqisntd"); 538 q->first_to_check);
570 QDIO_DBF_HEX4(0, trace, &q, sizeof(void *));
571 sprintf(dbf_text, "pf%02x", q->first_to_check);
572 QDIO_DBF_TEXT4(0, trace, dbf_text);
573#endif /* CONFIG_QDIO_DEBUG */
574 return 0; 539 return 0;
575 } 540 }
576} 541}
@@ -578,9 +543,6 @@ static int qdio_inbound_q_done(struct qdio_q *q)
578void qdio_kick_inbound_handler(struct qdio_q *q) 543void qdio_kick_inbound_handler(struct qdio_q *q)
579{ 544{
580 int count, start, end; 545 int count, start, end;
581#ifdef CONFIG_QDIO_DEBUG
582 char dbf_text[15];
583#endif
584 546
585 qdio_perf_stat_inc(&perf_stats.inbound_handler); 547 qdio_perf_stat_inc(&perf_stats.inbound_handler);
586 548
@@ -591,10 +553,7 @@ void qdio_kick_inbound_handler(struct qdio_q *q)
591 else 553 else
592 count = end + QDIO_MAX_BUFFERS_PER_Q - start; 554 count = end + QDIO_MAX_BUFFERS_PER_Q - start;
593 555
594#ifdef CONFIG_QDIO_DEBUG 556 DBF_DEV_EVENT(DBF_INFO, q->irq_ptr, "kih s:%3d c:%3d", start, count);
595 sprintf(dbf_text, "s=%2xc=%2x", start, count);
596 QDIO_DBF_TEXT4(0, trace, dbf_text);
597#endif /* CONFIG_QDIO_DEBUG */
598 557
599 if (unlikely(q->irq_ptr->state != QDIO_IRQ_STATE_ACTIVE)) 558 if (unlikely(q->irq_ptr->state != QDIO_IRQ_STATE_ACTIVE))
600 return; 559 return;
@@ -667,7 +626,7 @@ check_next:
667 switch (state) { 626 switch (state) {
668 case SLSB_P_OUTPUT_EMPTY: 627 case SLSB_P_OUTPUT_EMPTY:
669 /* the adapter got it */ 628 /* the adapter got it */
670 QDIO_DBF_TEXT5(0, trace, "outpempt"); 629 DBF_DEV_EVENT(DBF_INFO, q->irq_ptr, "out empty:%1d %3d", q->nr, count);
671 630
672 atomic_sub(count, &q->nr_buf_used); 631 atomic_sub(count, &q->nr_buf_used);
673 q->first_to_check = add_buf(q->first_to_check, count); 632 q->first_to_check = add_buf(q->first_to_check, count);
@@ -686,7 +645,7 @@ check_next:
686 break; 645 break;
687 case SLSB_CU_OUTPUT_PRIMED: 646 case SLSB_CU_OUTPUT_PRIMED:
688 /* the adapter has not fetched the output yet */ 647 /* the adapter has not fetched the output yet */
689 QDIO_DBF_TEXT5(0, trace, "outpprim"); 648 DBF_DEV_EVENT(DBF_INFO, q->irq_ptr, "out primed:%1d", q->nr);
690 break; 649 break;
691 case SLSB_P_OUTPUT_NOT_INIT: 650 case SLSB_P_OUTPUT_NOT_INIT:
692 case SLSB_P_OUTPUT_HALTED: 651 case SLSB_P_OUTPUT_HALTED:
@@ -711,8 +670,7 @@ static inline int qdio_outbound_q_moved(struct qdio_q *q)
711 670
712 if ((bufnr != q->last_move_ftc) || q->qdio_error) { 671 if ((bufnr != q->last_move_ftc) || q->qdio_error) {
713 q->last_move_ftc = bufnr; 672 q->last_move_ftc = bufnr;
714 QDIO_DBF_TEXT4(0, trace, "oqhasmvd"); 673 DBF_DEV_EVENT(DBF_INFO, q->irq_ptr, "out moved:%1d", q->nr);
715 QDIO_DBF_HEX4(0, trace, &q, sizeof(void *));
716 return 1; 674 return 1;
717 } else 675 } else
718 return 0; 676 return 0;
@@ -747,12 +705,8 @@ static inline int qdio_outbound_q_moved(struct qdio_q *q)
747static void qdio_kick_outbound_q(struct qdio_q *q) 705static void qdio_kick_outbound_q(struct qdio_q *q)
748{ 706{
749 int rc; 707 int rc;
750#ifdef CONFIG_QDIO_DEBUG
751 char dbf_text[15];
752 708
753 QDIO_DBF_TEXT5(0, trace, "kickoutq"); 709 DBF_DEV_EVENT(DBF_INFO, q->irq_ptr, "kickoutq:%1d", q->nr);
754 QDIO_DBF_HEX5(0, trace, &q, sizeof(void *));
755#endif /* CONFIG_QDIO_DEBUG */
756 710
757 if (!need_siga_out(q)) 711 if (!need_siga_out(q))
758 return; 712 return;
@@ -761,15 +715,9 @@ static void qdio_kick_outbound_q(struct qdio_q *q)
761 switch (rc) { 715 switch (rc) {
762 case 0: 716 case 0:
763 /* TODO: improve error handling for CC=0 case */ 717 /* TODO: improve error handling for CC=0 case */
764#ifdef CONFIG_QDIO_DEBUG 718 if (q->u.out.timestamp)
765 if (q->u.out.timestamp) { 719 DBF_DEV_EVENT(DBF_INFO, q->irq_ptr, "cc2 rslv:%4x",
766 QDIO_DBF_TEXT3(0, trace, "cc2reslv"); 720 atomic_read(&q->u.out.busy_siga_counter));
767 sprintf(dbf_text, "%4x%2x%2x", q->irq_ptr->schid.sch_no,
768 q->nr,
769 atomic_read(&q->u.out.busy_siga_counter));
770 QDIO_DBF_TEXT3(0, trace, dbf_text);
771 }
772#endif /* CONFIG_QDIO_DEBUG */
773 /* went smooth this time, reset timestamp */ 721 /* went smooth this time, reset timestamp */
774 q->u.out.timestamp = 0; 722 q->u.out.timestamp = 0;
775 break; 723 break;
@@ -786,12 +734,7 @@ static void qdio_kick_outbound_q(struct qdio_q *q)
786 tasklet_schedule(&q->tasklet); 734 tasklet_schedule(&q->tasklet);
787 break; 735 break;
788 } 736 }
789 QDIO_DBF_TEXT2(0, trace, "cc2REPRT"); 737 DBF_ERROR("%4x cc2 REP:%1d", SCH_NO(q), q->nr);
790#ifdef CONFIG_QDIO_DEBUG
791 sprintf(dbf_text, "%4x%2x%2x", q->irq_ptr->schid.sch_no, q->nr,
792 atomic_read(&q->u.out.busy_siga_counter));
793 QDIO_DBF_TEXT3(0, trace, dbf_text);
794#endif /* CONFIG_QDIO_DEBUG */
795 default: 738 default:
796 /* for plain cc=1, 2 or 3 */ 739 /* for plain cc=1, 2 or 3 */
797 q->qdio_error = rc; 740 q->qdio_error = rc;
@@ -801,9 +744,6 @@ static void qdio_kick_outbound_q(struct qdio_q *q)
801static void qdio_kick_outbound_handler(struct qdio_q *q) 744static void qdio_kick_outbound_handler(struct qdio_q *q)
802{ 745{
803 int start, end, count; 746 int start, end, count;
804#ifdef CONFIG_QDIO_DEBUG
805 char dbf_text[15];
806#endif
807 747
808 start = q->first_to_kick; 748 start = q->first_to_kick;
809 end = q->last_move_ftc; 749 end = q->last_move_ftc;
@@ -812,13 +752,8 @@ static void qdio_kick_outbound_handler(struct qdio_q *q)
812 else 752 else
813 count = end + QDIO_MAX_BUFFERS_PER_Q - start; 753 count = end + QDIO_MAX_BUFFERS_PER_Q - start;
814 754
815#ifdef CONFIG_QDIO_DEBUG 755 DBF_DEV_EVENT(DBF_INFO, q->irq_ptr, "kickouth: %1d", q->nr);
816 QDIO_DBF_TEXT4(0, trace, "kickouth"); 756 DBF_DEV_EVENT(DBF_INFO, q->irq_ptr, "s:%3d c:%3d", start, count);
817 QDIO_DBF_HEX4(0, trace, &q, sizeof(void *));
818
819 sprintf(dbf_text, "s=%2xc=%2x", start, count);
820 QDIO_DBF_TEXT4(0, trace, dbf_text);
821#endif /* CONFIG_QDIO_DEBUG */
822 757
823 if (unlikely(q->irq_ptr->state != QDIO_IRQ_STATE_ACTIVE)) 758 if (unlikely(q->irq_ptr->state != QDIO_IRQ_STATE_ACTIVE))
824 return; 759 return;
@@ -913,27 +848,18 @@ void qdio_check_outbound_after_thinint(struct qdio_q *q)
913static inline void qdio_set_state(struct qdio_irq *irq_ptr, 848static inline void qdio_set_state(struct qdio_irq *irq_ptr,
914 enum qdio_irq_states state) 849 enum qdio_irq_states state)
915{ 850{
916#ifdef CONFIG_QDIO_DEBUG 851 DBF_DEV_EVENT(DBF_INFO, irq_ptr, "newstate: %1d", state);
917 char dbf_text[15];
918
919 QDIO_DBF_TEXT5(0, trace, "newstate");
920 sprintf(dbf_text, "%4x%4x", irq_ptr->schid.sch_no, state);
921 QDIO_DBF_TEXT5(0, trace, dbf_text);
922#endif /* CONFIG_QDIO_DEBUG */
923 852
924 irq_ptr->state = state; 853 irq_ptr->state = state;
925 mb(); 854 mb();
926} 855}
927 856
928static void qdio_irq_check_sense(struct subchannel_id schid, struct irb *irb) 857static void qdio_irq_check_sense(struct qdio_irq *irq_ptr, struct irb *irb)
929{ 858{
930 char dbf_text[15];
931
932 if (irb->esw.esw0.erw.cons) { 859 if (irb->esw.esw0.erw.cons) {
933 sprintf(dbf_text, "sens%4x", schid.sch_no); 860 DBF_ERROR("%4x sense:", irq_ptr->schid.sch_no);
934 QDIO_DBF_TEXT2(1, trace, dbf_text); 861 DBF_ERROR_HEX(irb, 64);
935 QDIO_DBF_HEX0(0, trace, irb, 64); 862 DBF_ERROR_HEX(irb->ecw, 64);
936 QDIO_DBF_HEX0(0, trace, irb->ecw, 64);
937 } 863 }
938} 864}
939 865
@@ -967,14 +893,10 @@ static void qdio_handle_activate_check(struct ccw_device *cdev,
967{ 893{
968 struct qdio_irq *irq_ptr = cdev->private->qdio_data; 894 struct qdio_irq *irq_ptr = cdev->private->qdio_data;
969 struct qdio_q *q; 895 struct qdio_q *q;
970 char dbf_text[15];
971 896
972 QDIO_DBF_TEXT2(1, trace, "ick2"); 897 DBF_ERROR("%4x ACT CHECK", irq_ptr->schid.sch_no);
973 sprintf(dbf_text, "%s", dev_name(&cdev->dev)); 898 DBF_ERROR("intp :%lx", intparm);
974 QDIO_DBF_TEXT2(1, trace, dbf_text); 899 DBF_ERROR("ds: %2x cs:%2x", dstat, cstat);
975 QDIO_DBF_HEX2(0, trace, &intparm, sizeof(int));
976 QDIO_DBF_HEX2(0, trace, &dstat, sizeof(int));
977 QDIO_DBF_HEX2(0, trace, &cstat, sizeof(int));
978 900
979 if (irq_ptr->nr_input_qs) { 901 if (irq_ptr->nr_input_qs) {
980 q = irq_ptr->input_qs[0]; 902 q = irq_ptr->input_qs[0];
@@ -1027,28 +949,29 @@ static void qdio_int_error(struct ccw_device *cdev)
1027} 949}
1028 950
1029static int qdio_establish_check_errors(struct ccw_device *cdev, int cstat, 951static int qdio_establish_check_errors(struct ccw_device *cdev, int cstat,
1030 int dstat) 952 int dstat)
1031{ 953{
1032 struct qdio_irq *irq_ptr = cdev->private->qdio_data; 954 struct qdio_irq *irq_ptr = cdev->private->qdio_data;
1033 955
1034 if (cstat || (dstat & ~(DEV_STAT_CHN_END | DEV_STAT_DEV_END))) { 956 if (cstat || (dstat & ~(DEV_STAT_CHN_END | DEV_STAT_DEV_END))) {
1035 QDIO_DBF_TEXT2(1, setup, "eq:ckcon"); 957 DBF_ERROR("EQ:ck con");
1036 goto error; 958 goto error;
1037 } 959 }
1038 960
1039 if (!(dstat & DEV_STAT_DEV_END)) { 961 if (!(dstat & DEV_STAT_DEV_END)) {
1040 QDIO_DBF_TEXT2(1, setup, "eq:no de"); 962 DBF_ERROR("EQ:no dev");
1041 goto error; 963 goto error;
1042 } 964 }
1043 965
1044 if (dstat & ~(DEV_STAT_CHN_END | DEV_STAT_DEV_END)) { 966 if (dstat & ~(DEV_STAT_CHN_END | DEV_STAT_DEV_END)) {
1045 QDIO_DBF_TEXT2(1, setup, "eq:badio"); 967 DBF_ERROR("EQ: bad io");
1046 goto error; 968 goto error;
1047 } 969 }
1048 return 0; 970 return 0;
1049error: 971error:
1050 QDIO_DBF_HEX2(0, trace, &cstat, sizeof(int)); 972 DBF_ERROR("%4x EQ:error", irq_ptr->schid.sch_no);
1051 QDIO_DBF_HEX2(0, trace, &dstat, sizeof(int)); 973 DBF_ERROR("ds: %2x cs:%2x", dstat, cstat);
974
1052 qdio_set_state(irq_ptr, QDIO_IRQ_STATE_ERR); 975 qdio_set_state(irq_ptr, QDIO_IRQ_STATE_ERR);
1053 return 1; 976 return 1;
1054} 977}
@@ -1057,12 +980,8 @@ static void qdio_establish_handle_irq(struct ccw_device *cdev, int cstat,
1057 int dstat) 980 int dstat)
1058{ 981{
1059 struct qdio_irq *irq_ptr = cdev->private->qdio_data; 982 struct qdio_irq *irq_ptr = cdev->private->qdio_data;
1060 char dbf_text[15];
1061
1062 sprintf(dbf_text, "qehi%4x", cdev->private->schid.sch_no);
1063 QDIO_DBF_TEXT0(0, setup, dbf_text);
1064 QDIO_DBF_TEXT0(0, trace, dbf_text);
1065 983
984 DBF_DEV_EVENT(DBF_INFO, irq_ptr, "qest irq");
1066 if (!qdio_establish_check_errors(cdev, cstat, dstat)) 985 if (!qdio_establish_check_errors(cdev, cstat, dstat))
1067 qdio_set_state(irq_ptr, QDIO_IRQ_STATE_ESTABLISHED); 986 qdio_set_state(irq_ptr, QDIO_IRQ_STATE_ESTABLISHED);
1068} 987}
@@ -1073,25 +992,21 @@ void qdio_int_handler(struct ccw_device *cdev, unsigned long intparm,
1073{ 992{
1074 struct qdio_irq *irq_ptr = cdev->private->qdio_data; 993 struct qdio_irq *irq_ptr = cdev->private->qdio_data;
1075 int cstat, dstat; 994 int cstat, dstat;
1076 char dbf_text[15];
1077 995
1078 qdio_perf_stat_inc(&perf_stats.qdio_int); 996 qdio_perf_stat_inc(&perf_stats.qdio_int);
1079 997
1080 if (!intparm || !irq_ptr) { 998 if (!intparm || !irq_ptr) {
1081 sprintf(dbf_text, "qihd%4x", cdev->private->schid.sch_no); 999 DBF_ERROR("qint:%4x", cdev->private->schid.sch_no);
1082 QDIO_DBF_TEXT2(1, setup, dbf_text);
1083 return; 1000 return;
1084 } 1001 }
1085 1002
1086 if (IS_ERR(irb)) { 1003 if (IS_ERR(irb)) {
1087 switch (PTR_ERR(irb)) { 1004 switch (PTR_ERR(irb)) {
1088 case -EIO: 1005 case -EIO:
1089 sprintf(dbf_text, "ierr%4x", irq_ptr->schid.sch_no); 1006 DBF_ERROR("%4x IO error", irq_ptr->schid.sch_no);
1090 QDIO_DBF_TEXT2(1, setup, dbf_text);
1091 return; 1007 return;
1092 case -ETIMEDOUT: 1008 case -ETIMEDOUT:
1093 sprintf(dbf_text, "qtoh%4x", irq_ptr->schid.sch_no); 1009 DBF_ERROR("%4x IO timeout", irq_ptr->schid.sch_no);
1094 QDIO_DBF_TEXT2(1, setup, dbf_text);
1095 qdio_int_error(cdev); 1010 qdio_int_error(cdev);
1096 return; 1011 return;
1097 default: 1012 default:
@@ -1099,7 +1014,7 @@ void qdio_int_handler(struct ccw_device *cdev, unsigned long intparm,
1099 return; 1014 return;
1100 } 1015 }
1101 } 1016 }
1102 qdio_irq_check_sense(irq_ptr->schid, irb); 1017 qdio_irq_check_sense(irq_ptr, irb);
1103 1018
1104 cstat = irb->scsw.cmd.cstat; 1019 cstat = irb->scsw.cmd.cstat;
1105 dstat = irb->scsw.cmd.dstat; 1020 dstat = irb->scsw.cmd.dstat;
@@ -1142,14 +1057,11 @@ void qdio_int_handler(struct ccw_device *cdev, unsigned long intparm,
1142int qdio_get_ssqd_desc(struct ccw_device *cdev, 1057int qdio_get_ssqd_desc(struct ccw_device *cdev,
1143 struct qdio_ssqd_desc *data) 1058 struct qdio_ssqd_desc *data)
1144{ 1059{
1145 char dbf_text[15];
1146 1060
1147 if (!cdev || !cdev->private) 1061 if (!cdev || !cdev->private)
1148 return -EINVAL; 1062 return -EINVAL;
1149 1063
1150 sprintf(dbf_text, "qssq%4x", cdev->private->schid.sch_no); 1064 DBF_EVENT("get ssqd:%4x", cdev->private->schid.sch_no);
1151 QDIO_DBF_TEXT0(0, setup, dbf_text);
1152
1153 return qdio_setup_get_ssqd(NULL, &cdev->private->schid, data); 1065 return qdio_setup_get_ssqd(NULL, &cdev->private->schid, data);
1154} 1066}
1155EXPORT_SYMBOL_GPL(qdio_get_ssqd_desc); 1067EXPORT_SYMBOL_GPL(qdio_get_ssqd_desc);
@@ -1164,14 +1076,9 @@ EXPORT_SYMBOL_GPL(qdio_get_ssqd_desc);
1164 */ 1076 */
1165int qdio_cleanup(struct ccw_device *cdev, int how) 1077int qdio_cleanup(struct ccw_device *cdev, int how)
1166{ 1078{
1167 struct qdio_irq *irq_ptr; 1079 struct qdio_irq *irq_ptr = cdev->private->qdio_data;
1168 char dbf_text[15];
1169 int rc; 1080 int rc;
1170 1081
1171 sprintf(dbf_text, "qcln%4x", cdev->private->schid.sch_no);
1172 QDIO_DBF_TEXT0(0, setup, dbf_text);
1173
1174 irq_ptr = cdev->private->qdio_data;
1175 if (!irq_ptr) 1082 if (!irq_ptr)
1176 return -ENODEV; 1083 return -ENODEV;
1177 1084
@@ -1204,18 +1111,15 @@ static void qdio_shutdown_queues(struct ccw_device *cdev)
1204 */ 1111 */
1205int qdio_shutdown(struct ccw_device *cdev, int how) 1112int qdio_shutdown(struct ccw_device *cdev, int how)
1206{ 1113{
1207 struct qdio_irq *irq_ptr; 1114 struct qdio_irq *irq_ptr = cdev->private->qdio_data;
1208 int rc; 1115 int rc;
1209 unsigned long flags; 1116 unsigned long flags;
1210 char dbf_text[15];
1211 1117
1212 sprintf(dbf_text, "qshu%4x", cdev->private->schid.sch_no);
1213 QDIO_DBF_TEXT0(0, setup, dbf_text);
1214
1215 irq_ptr = cdev->private->qdio_data;
1216 if (!irq_ptr) 1118 if (!irq_ptr)
1217 return -ENODEV; 1119 return -ENODEV;
1218 1120
1121 DBF_EVENT("qshutdown:%4x", cdev->private->schid.sch_no);
1122
1219 mutex_lock(&irq_ptr->setup_mutex); 1123 mutex_lock(&irq_ptr->setup_mutex);
1220 /* 1124 /*
1221 * Subchannel was already shot down. We cannot prevent being called 1125 * Subchannel was already shot down. We cannot prevent being called
@@ -1239,10 +1143,8 @@ int qdio_shutdown(struct ccw_device *cdev, int how)
1239 /* default behaviour is halt */ 1143 /* default behaviour is halt */
1240 rc = ccw_device_halt(cdev, QDIO_DOING_CLEANUP); 1144 rc = ccw_device_halt(cdev, QDIO_DOING_CLEANUP);
1241 if (rc) { 1145 if (rc) {
1242 sprintf(dbf_text, "sher%4x", irq_ptr->schid.sch_no); 1146 DBF_ERROR("%4x SHUTD ERR", irq_ptr->schid.sch_no);
1243 QDIO_DBF_TEXT0(0, setup, dbf_text); 1147 DBF_ERROR("rc:%4d", rc);
1244 sprintf(dbf_text, "rc=%d", rc);
1245 QDIO_DBF_TEXT0(0, setup, dbf_text);
1246 goto no_cleanup; 1148 goto no_cleanup;
1247 } 1149 }
1248 1150
@@ -1276,17 +1178,18 @@ EXPORT_SYMBOL_GPL(qdio_shutdown);
1276 */ 1178 */
1277int qdio_free(struct ccw_device *cdev) 1179int qdio_free(struct ccw_device *cdev)
1278{ 1180{
1279 struct qdio_irq *irq_ptr; 1181 struct qdio_irq *irq_ptr = cdev->private->qdio_data;
1280 char dbf_text[15];
1281
1282 sprintf(dbf_text, "qfre%4x", cdev->private->schid.sch_no);
1283 QDIO_DBF_TEXT0(0, setup, dbf_text);
1284 1182
1285 irq_ptr = cdev->private->qdio_data;
1286 if (!irq_ptr) 1183 if (!irq_ptr)
1287 return -ENODEV; 1184 return -ENODEV;
1288 1185
1186 DBF_EVENT("qfree:%4x", cdev->private->schid.sch_no);
1289 mutex_lock(&irq_ptr->setup_mutex); 1187 mutex_lock(&irq_ptr->setup_mutex);
1188
1189 if (irq_ptr->debug_area != NULL) {
1190 debug_unregister(irq_ptr->debug_area);
1191 irq_ptr->debug_area = NULL;
1192 }
1290 cdev->private->qdio_data = NULL; 1193 cdev->private->qdio_data = NULL;
1291 mutex_unlock(&irq_ptr->setup_mutex); 1194 mutex_unlock(&irq_ptr->setup_mutex);
1292 1195
@@ -1305,10 +1208,6 @@ EXPORT_SYMBOL_GPL(qdio_free);
1305int qdio_initialize(struct qdio_initialize *init_data) 1208int qdio_initialize(struct qdio_initialize *init_data)
1306{ 1209{
1307 int rc; 1210 int rc;
1308 char dbf_text[15];
1309
1310 sprintf(dbf_text, "qini%4x", init_data->cdev->private->schid.sch_no);
1311 QDIO_DBF_TEXT0(0, setup, dbf_text);
1312 1211
1313 rc = qdio_allocate(init_data); 1212 rc = qdio_allocate(init_data);
1314 if (rc) 1213 if (rc)
@@ -1328,10 +1227,8 @@ EXPORT_SYMBOL_GPL(qdio_initialize);
1328int qdio_allocate(struct qdio_initialize *init_data) 1227int qdio_allocate(struct qdio_initialize *init_data)
1329{ 1228{
1330 struct qdio_irq *irq_ptr; 1229 struct qdio_irq *irq_ptr;
1331 char dbf_text[15];
1332 1230
1333 sprintf(dbf_text, "qalc%4x", init_data->cdev->private->schid.sch_no); 1231 DBF_EVENT("qallocate:%4x", init_data->cdev->private->schid.sch_no);
1334 QDIO_DBF_TEXT0(0, setup, dbf_text);
1335 1232
1336 if ((init_data->no_input_qs && !init_data->input_handler) || 1233 if ((init_data->no_input_qs && !init_data->input_handler) ||
1337 (init_data->no_output_qs && !init_data->output_handler)) 1234 (init_data->no_output_qs && !init_data->output_handler))
@@ -1345,16 +1242,13 @@ int qdio_allocate(struct qdio_initialize *init_data)
1345 (!init_data->output_sbal_addr_array)) 1242 (!init_data->output_sbal_addr_array))
1346 return -EINVAL; 1243 return -EINVAL;
1347 1244
1348 qdio_allocate_do_dbf(init_data);
1349
1350 /* irq_ptr must be in GFP_DMA since it contains ccw1.cda */ 1245 /* irq_ptr must be in GFP_DMA since it contains ccw1.cda */
1351 irq_ptr = (void *) get_zeroed_page(GFP_KERNEL | GFP_DMA); 1246 irq_ptr = (void *) get_zeroed_page(GFP_KERNEL | GFP_DMA);
1352 if (!irq_ptr) 1247 if (!irq_ptr)
1353 goto out_err; 1248 goto out_err;
1354 QDIO_DBF_TEXT0(0, setup, "irq_ptr:");
1355 QDIO_DBF_HEX0(0, setup, &irq_ptr, sizeof(void *));
1356 1249
1357 mutex_init(&irq_ptr->setup_mutex); 1250 mutex_init(&irq_ptr->setup_mutex);
1251 qdio_allocate_dbf(init_data, irq_ptr);
1358 1252
1359 /* 1253 /*
1360 * Allocate a page for the chsc calls in qdio_establish. 1254 * Allocate a page for the chsc calls in qdio_establish.
@@ -1372,9 +1266,6 @@ int qdio_allocate(struct qdio_initialize *init_data)
1372 goto out_rel; 1266 goto out_rel;
1373 WARN_ON((unsigned long)irq_ptr->qdr & 0xfff); 1267 WARN_ON((unsigned long)irq_ptr->qdr & 0xfff);
1374 1268
1375 QDIO_DBF_TEXT0(0, setup, "qdr:");
1376 QDIO_DBF_HEX0(0, setup, &irq_ptr->qdr, sizeof(void *));
1377
1378 if (qdio_allocate_qs(irq_ptr, init_data->no_input_qs, 1269 if (qdio_allocate_qs(irq_ptr, init_data->no_input_qs,
1379 init_data->no_output_qs)) 1270 init_data->no_output_qs))
1380 goto out_rel; 1271 goto out_rel;
@@ -1395,14 +1286,12 @@ EXPORT_SYMBOL_GPL(qdio_allocate);
1395 */ 1286 */
1396int qdio_establish(struct qdio_initialize *init_data) 1287int qdio_establish(struct qdio_initialize *init_data)
1397{ 1288{
1398 char dbf_text[20];
1399 struct qdio_irq *irq_ptr; 1289 struct qdio_irq *irq_ptr;
1400 struct ccw_device *cdev = init_data->cdev; 1290 struct ccw_device *cdev = init_data->cdev;
1401 unsigned long saveflags; 1291 unsigned long saveflags;
1402 int rc; 1292 int rc;
1403 1293
1404 sprintf(dbf_text, "qest%4x", cdev->private->schid.sch_no); 1294 DBF_EVENT("qestablish:%4x", cdev->private->schid.sch_no);
1405 QDIO_DBF_TEXT0(0, setup, dbf_text);
1406 1295
1407 irq_ptr = cdev->private->qdio_data; 1296 irq_ptr = cdev->private->qdio_data;
1408 if (!irq_ptr) 1297 if (!irq_ptr)
@@ -1432,10 +1321,8 @@ int qdio_establish(struct qdio_initialize *init_data)
1432 1321
1433 rc = ccw_device_start(cdev, &irq_ptr->ccw, QDIO_DOING_ESTABLISH, 0, 0); 1322 rc = ccw_device_start(cdev, &irq_ptr->ccw, QDIO_DOING_ESTABLISH, 0, 0);
1434 if (rc) { 1323 if (rc) {
1435 sprintf(dbf_text, "eq:io%4x", irq_ptr->schid.sch_no); 1324 DBF_ERROR("%4x est IO ERR", irq_ptr->schid.sch_no);
1436 QDIO_DBF_TEXT2(1, setup, dbf_text); 1325 DBF_ERROR("rc:%4x", rc);
1437 sprintf(dbf_text, "eq:rc%4x", rc);
1438 QDIO_DBF_TEXT2(1, setup, dbf_text);
1439 } 1326 }
1440 spin_unlock_irqrestore(get_ccwdev_lock(cdev), saveflags); 1327 spin_unlock_irqrestore(get_ccwdev_lock(cdev), saveflags);
1441 1328
@@ -1456,10 +1343,8 @@ int qdio_establish(struct qdio_initialize *init_data)
1456 } 1343 }
1457 1344
1458 qdio_setup_ssqd_info(irq_ptr); 1345 qdio_setup_ssqd_info(irq_ptr);
1459 sprintf(dbf_text, "qDmmwc%2x", irq_ptr->ssqd_desc.mmwc); 1346 DBF_EVENT("qDmmwc:%2x", irq_ptr->ssqd_desc.mmwc);
1460 QDIO_DBF_TEXT2(0, setup, dbf_text); 1347 DBF_EVENT("qib ac:%4x", irq_ptr->qib.ac);
1461 sprintf(dbf_text, "qib ac%2x", irq_ptr->qib.ac);
1462 QDIO_DBF_TEXT2(0, setup, dbf_text);
1463 1348
1464 /* qebsm is now setup if available, initialize buffer states */ 1349 /* qebsm is now setup if available, initialize buffer states */
1465 qdio_init_buf_states(irq_ptr); 1350 qdio_init_buf_states(irq_ptr);
@@ -1480,10 +1365,8 @@ int qdio_activate(struct ccw_device *cdev)
1480 struct qdio_irq *irq_ptr; 1365 struct qdio_irq *irq_ptr;
1481 int rc; 1366 int rc;
1482 unsigned long saveflags; 1367 unsigned long saveflags;
1483 char dbf_text[20];
1484 1368
1485 sprintf(dbf_text, "qact%4x", cdev->private->schid.sch_no); 1369 DBF_EVENT("qactivate:%4x", cdev->private->schid.sch_no);
1486 QDIO_DBF_TEXT0(0, setup, dbf_text);
1487 1370
1488 irq_ptr = cdev->private->qdio_data; 1371 irq_ptr = cdev->private->qdio_data;
1489 if (!irq_ptr) 1372 if (!irq_ptr)
@@ -1509,10 +1392,8 @@ int qdio_activate(struct ccw_device *cdev)
1509 rc = ccw_device_start(cdev, &irq_ptr->ccw, QDIO_DOING_ACTIVATE, 1392 rc = ccw_device_start(cdev, &irq_ptr->ccw, QDIO_DOING_ACTIVATE,
1510 0, DOIO_DENY_PREFETCH); 1393 0, DOIO_DENY_PREFETCH);
1511 if (rc) { 1394 if (rc) {
1512 sprintf(dbf_text, "aq:io%4x", irq_ptr->schid.sch_no); 1395 DBF_ERROR("%4x act IO ERR", irq_ptr->schid.sch_no);
1513 QDIO_DBF_TEXT2(1, setup, dbf_text); 1396 DBF_ERROR("rc:%4x", rc);
1514 sprintf(dbf_text, "aq:rc%4x", rc);
1515 QDIO_DBF_TEXT2(1, setup, dbf_text);
1516 } 1397 }
1517 spin_unlock_irqrestore(get_ccwdev_lock(cdev), saveflags); 1398 spin_unlock_irqrestore(get_ccwdev_lock(cdev), saveflags);
1518 1399
@@ -1658,7 +1539,7 @@ static void handle_outbound(struct qdio_q *q, unsigned int callflags,
1658 if (state != SLSB_CU_OUTPUT_PRIMED) 1539 if (state != SLSB_CU_OUTPUT_PRIMED)
1659 qdio_kick_outbound_q(q); 1540 qdio_kick_outbound_q(q);
1660 else { 1541 else {
1661 QDIO_DBF_TEXT5(0, trace, "fast-req"); 1542 DBF_DEV_EVENT(DBF_INFO, q->irq_ptr, "fast-req");
1662 qdio_perf_stat_inc(&perf_stats.fast_requeue); 1543 qdio_perf_stat_inc(&perf_stats.fast_requeue);
1663 } 1544 }
1664out: 1545out:
@@ -1678,12 +1559,6 @@ int do_QDIO(struct ccw_device *cdev, unsigned int callflags,
1678 int q_nr, int bufnr, int count) 1559 int q_nr, int bufnr, int count)
1679{ 1560{
1680 struct qdio_irq *irq_ptr; 1561 struct qdio_irq *irq_ptr;
1681#ifdef CONFIG_QDIO_DEBUG
1682 char dbf_text[20];
1683
1684 sprintf(dbf_text, "doQD%4x", cdev->private->schid.sch_no);
1685 QDIO_DBF_TEXT3(0, trace, dbf_text);
1686#endif /* CONFIG_QDIO_DEBUG */
1687 1562
1688 if ((bufnr > QDIO_MAX_BUFFERS_PER_Q) || 1563 if ((bufnr > QDIO_MAX_BUFFERS_PER_Q) ||
1689 (count > QDIO_MAX_BUFFERS_PER_Q) || 1564 (count > QDIO_MAX_BUFFERS_PER_Q) ||
@@ -1697,33 +1572,24 @@ int do_QDIO(struct ccw_device *cdev, unsigned int callflags,
1697 if (!irq_ptr) 1572 if (!irq_ptr)
1698 return -ENODEV; 1573 return -ENODEV;
1699 1574
1700#ifdef CONFIG_QDIO_DEBUG
1701 if (callflags & QDIO_FLAG_SYNC_INPUT) 1575 if (callflags & QDIO_FLAG_SYNC_INPUT)
1702 QDIO_DBF_HEX3(0, trace, &irq_ptr->input_qs[q_nr], 1576 DBF_DEV_EVENT(DBF_INFO, irq_ptr, "doQDIO input");
1703 sizeof(void *));
1704 else 1577 else
1705 QDIO_DBF_HEX3(0, trace, &irq_ptr->output_qs[q_nr], 1578 DBF_DEV_EVENT(DBF_INFO, irq_ptr, "doQDIO output");
1706 sizeof(void *)); 1579 DBF_DEV_EVENT(DBF_INFO, irq_ptr, "q:%1d flag:%4x", q_nr, callflags);
1707 1580 DBF_DEV_EVENT(DBF_INFO, irq_ptr, "buf:%2d cnt:%3d", bufnr, count);
1708 sprintf(dbf_text, "flag%04x", callflags);
1709 QDIO_DBF_TEXT3(0, trace, dbf_text);
1710 sprintf(dbf_text, "qi%02xct%02x", bufnr, count);
1711 QDIO_DBF_TEXT3(0, trace, dbf_text);
1712#endif /* CONFIG_QDIO_DEBUG */
1713 1581
1714 if (irq_ptr->state != QDIO_IRQ_STATE_ACTIVE) 1582 if (irq_ptr->state != QDIO_IRQ_STATE_ACTIVE)
1715 return -EBUSY; 1583 return -EBUSY;
1716 1584
1717 if (callflags & QDIO_FLAG_SYNC_INPUT) 1585 if (callflags & QDIO_FLAG_SYNC_INPUT)
1718 handle_inbound(irq_ptr->input_qs[q_nr], 1586 handle_inbound(irq_ptr->input_qs[q_nr], callflags, bufnr,
1719 callflags, bufnr, count); 1587 count);
1720 else if (callflags & QDIO_FLAG_SYNC_OUTPUT) 1588 else if (callflags & QDIO_FLAG_SYNC_OUTPUT)
1721 handle_outbound(irq_ptr->output_qs[q_nr], 1589 handle_outbound(irq_ptr->output_qs[q_nr], callflags, bufnr,
1722 callflags, bufnr, count); 1590 count);
1723 else { 1591 else
1724 QDIO_DBF_TEXT3(1, trace, "doQD:inv");
1725 return -EINVAL; 1592 return -EINVAL;
1726 }
1727 return 0; 1593 return 0;
1728} 1594}
1729EXPORT_SYMBOL_GPL(do_QDIO); 1595EXPORT_SYMBOL_GPL(do_QDIO);
diff --git a/drivers/s390/cio/qdio_setup.c b/drivers/s390/cio/qdio_setup.c
index 22ee0272a104..7323799b2ce3 100644
--- a/drivers/s390/cio/qdio_setup.c
+++ b/drivers/s390/cio/qdio_setup.c
@@ -120,14 +120,12 @@ static void setup_queues_misc(struct qdio_q *q, struct qdio_irq *irq_ptr,
120} 120}
121 121
122static void setup_storage_lists(struct qdio_q *q, struct qdio_irq *irq_ptr, 122static void setup_storage_lists(struct qdio_q *q, struct qdio_irq *irq_ptr,
123 void **sbals_array, char *dbf_text, int i) 123 void **sbals_array, int i)
124{ 124{
125 struct qdio_q *prev; 125 struct qdio_q *prev;
126 int j; 126 int j;
127 127
128 QDIO_DBF_TEXT0(0, setup, dbf_text); 128 DBF_HEX(&q, sizeof(void *));
129 QDIO_DBF_HEX0(0, setup, &q, sizeof(void *));
130
131 q->sl = (struct sl *)((char *)q->slib + PAGE_SIZE / 2); 129 q->sl = (struct sl *)((char *)q->slib + PAGE_SIZE / 2);
132 130
133 /* fill in sbal */ 131 /* fill in sbal */
@@ -150,31 +148,27 @@ static void setup_storage_lists(struct qdio_q *q, struct qdio_irq *irq_ptr,
150 for (j = 0; j < QDIO_MAX_BUFFERS_PER_Q; j++) 148 for (j = 0; j < QDIO_MAX_BUFFERS_PER_Q; j++)
151 q->sl->element[j].sbal = (unsigned long)q->sbal[j]; 149 q->sl->element[j].sbal = (unsigned long)q->sbal[j];
152 150
153 QDIO_DBF_TEXT2(0, setup, "sl-sb-b0"); 151 DBF_EVENT("sl-slsb-sbal");
154 QDIO_DBF_HEX2(0, setup, q->sl, sizeof(void *)); 152 DBF_HEX(q->sl, sizeof(void *));
155 QDIO_DBF_HEX2(0, setup, &q->slsb, sizeof(void *)); 153 DBF_HEX(&q->slsb, sizeof(void *));
156 QDIO_DBF_HEX2(0, setup, q->sbal, sizeof(void *)); 154 DBF_HEX(q->sbal, sizeof(void *));
157} 155}
158 156
159static void setup_queues(struct qdio_irq *irq_ptr, 157static void setup_queues(struct qdio_irq *irq_ptr,
160 struct qdio_initialize *qdio_init) 158 struct qdio_initialize *qdio_init)
161{ 159{
162 char dbf_text[20];
163 struct qdio_q *q; 160 struct qdio_q *q;
164 void **input_sbal_array = qdio_init->input_sbal_addr_array; 161 void **input_sbal_array = qdio_init->input_sbal_addr_array;
165 void **output_sbal_array = qdio_init->output_sbal_addr_array; 162 void **output_sbal_array = qdio_init->output_sbal_addr_array;
166 int i; 163 int i;
167 164
168 sprintf(dbf_text, "qset%4x", qdio_init->cdev->private->schid.sch_no);
169 QDIO_DBF_TEXT0(0, setup, dbf_text);
170
171 for_each_input_queue(irq_ptr, q, i) { 165 for_each_input_queue(irq_ptr, q, i) {
172 sprintf(dbf_text, "in-q%4x", i); 166 DBF_EVENT("in-q:%1d", i);
173 setup_queues_misc(q, irq_ptr, qdio_init->input_handler, i); 167 setup_queues_misc(q, irq_ptr, qdio_init->input_handler, i);
174 168
175 q->is_input_q = 1; 169 q->is_input_q = 1;
176 spin_lock_init(&q->u.in.lock); 170 spin_lock_init(&q->u.in.lock);
177 setup_storage_lists(q, irq_ptr, input_sbal_array, dbf_text, i); 171 setup_storage_lists(q, irq_ptr, input_sbal_array, i);
178 input_sbal_array += QDIO_MAX_BUFFERS_PER_Q; 172 input_sbal_array += QDIO_MAX_BUFFERS_PER_Q;
179 173
180 if (is_thinint_irq(irq_ptr)) 174 if (is_thinint_irq(irq_ptr))
@@ -186,12 +180,11 @@ static void setup_queues(struct qdio_irq *irq_ptr,
186 } 180 }
187 181
188 for_each_output_queue(irq_ptr, q, i) { 182 for_each_output_queue(irq_ptr, q, i) {
189 sprintf(dbf_text, "outq%4x", i); 183 DBF_EVENT("outq:%1d", i);
190 setup_queues_misc(q, irq_ptr, qdio_init->output_handler, i); 184 setup_queues_misc(q, irq_ptr, qdio_init->output_handler, i);
191 185
192 q->is_input_q = 0; 186 q->is_input_q = 0;
193 setup_storage_lists(q, irq_ptr, output_sbal_array, 187 setup_storage_lists(q, irq_ptr, output_sbal_array, i);
194 dbf_text, i);
195 output_sbal_array += QDIO_MAX_BUFFERS_PER_Q; 188 output_sbal_array += QDIO_MAX_BUFFERS_PER_Q;
196 189
197 tasklet_init(&q->tasklet, qdio_outbound_processing, 190 tasklet_init(&q->tasklet, qdio_outbound_processing,
@@ -222,8 +215,6 @@ static void process_ac_flags(struct qdio_irq *irq_ptr, unsigned char qdioac)
222static void check_and_setup_qebsm(struct qdio_irq *irq_ptr, 215static void check_and_setup_qebsm(struct qdio_irq *irq_ptr,
223 unsigned char qdioac, unsigned long token) 216 unsigned char qdioac, unsigned long token)
224{ 217{
225 char dbf_text[15];
226
227 if (!(irq_ptr->qib.rflags & QIB_RFLAGS_ENABLE_QEBSM)) 218 if (!(irq_ptr->qib.rflags & QIB_RFLAGS_ENABLE_QEBSM))
228 goto no_qebsm; 219 goto no_qebsm;
229 if (!(qdioac & AC1_SC_QEBSM_AVAILABLE) || 220 if (!(qdioac & AC1_SC_QEBSM_AVAILABLE) ||
@@ -232,15 +223,14 @@ static void check_and_setup_qebsm(struct qdio_irq *irq_ptr,
232 223
233 irq_ptr->sch_token = token; 224 irq_ptr->sch_token = token;
234 225
235 QDIO_DBF_TEXT0(0, setup, "V=V:1"); 226 DBF_EVENT("V=V:1");
236 sprintf(dbf_text, "%8lx", irq_ptr->sch_token); 227 DBF_EVENT("%8lx", irq_ptr->sch_token);
237 QDIO_DBF_TEXT0(0, setup, dbf_text);
238 return; 228 return;
239 229
240no_qebsm: 230no_qebsm:
241 irq_ptr->sch_token = 0; 231 irq_ptr->sch_token = 0;
242 irq_ptr->qib.rflags &= ~QIB_RFLAGS_ENABLE_QEBSM; 232 irq_ptr->qib.rflags &= ~QIB_RFLAGS_ENABLE_QEBSM;
243 QDIO_DBF_TEXT0(0, setup, "noV=V"); 233 DBF_EVENT("noV=V");
244} 234}
245 235
246/* 236/*
@@ -254,7 +244,7 @@ int qdio_setup_get_ssqd(struct qdio_irq *irq_ptr,
254 struct chsc_ssqd_area *ssqd; 244 struct chsc_ssqd_area *ssqd;
255 int rc; 245 int rc;
256 246
257 QDIO_DBF_TEXT0(0, setup, "getssqd"); 247 DBF_EVENT("getssqd:%4x", schid->sch_no);
258 if (irq_ptr != NULL) 248 if (irq_ptr != NULL)
259 ssqd = (struct chsc_ssqd_area *)irq_ptr->chsc_page; 249 ssqd = (struct chsc_ssqd_area *)irq_ptr->chsc_page;
260 else 250 else
@@ -294,16 +284,12 @@ int qdio_setup_get_ssqd(struct qdio_irq *irq_ptr,
294void qdio_setup_ssqd_info(struct qdio_irq *irq_ptr) 284void qdio_setup_ssqd_info(struct qdio_irq *irq_ptr)
295{ 285{
296 unsigned char qdioac; 286 unsigned char qdioac;
297 char dbf_text[15];
298 int rc; 287 int rc;
299 288
300 rc = qdio_setup_get_ssqd(irq_ptr, &irq_ptr->schid, NULL); 289 rc = qdio_setup_get_ssqd(irq_ptr, &irq_ptr->schid, NULL);
301 if (rc) { 290 if (rc) {
302 QDIO_DBF_TEXT2(0, setup, "ssqdasig"); 291 DBF_ERROR("%4x ssqd ERR", irq_ptr->schid.sch_no);
303 sprintf(dbf_text, "schn%4x", irq_ptr->schid.sch_no); 292 DBF_ERROR("rc:%x", rc);
304 QDIO_DBF_TEXT2(0, setup, dbf_text);
305 sprintf(dbf_text, "rc:%d", rc);
306 QDIO_DBF_TEXT2(0, setup, dbf_text);
307 /* all flags set, worst case */ 293 /* all flags set, worst case */
308 qdioac = AC1_SIGA_INPUT_NEEDED | AC1_SIGA_OUTPUT_NEEDED | 294 qdioac = AC1_SIGA_INPUT_NEEDED | AC1_SIGA_OUTPUT_NEEDED |
309 AC1_SIGA_SYNC_NEEDED; 295 AC1_SIGA_SYNC_NEEDED;
@@ -312,9 +298,7 @@ void qdio_setup_ssqd_info(struct qdio_irq *irq_ptr)
312 298
313 check_and_setup_qebsm(irq_ptr, qdioac, irq_ptr->ssqd_desc.sch_token); 299 check_and_setup_qebsm(irq_ptr, qdioac, irq_ptr->ssqd_desc.sch_token);
314 process_ac_flags(irq_ptr, qdioac); 300 process_ac_flags(irq_ptr, qdioac);
315 301 DBF_EVENT("qdioac:%4x", qdioac);
316 sprintf(dbf_text, "qdioac%2x", qdioac);
317 QDIO_DBF_TEXT2(0, setup, dbf_text);
318} 302}
319 303
320void qdio_release_memory(struct qdio_irq *irq_ptr) 304void qdio_release_memory(struct qdio_irq *irq_ptr)
@@ -434,7 +418,7 @@ int qdio_setup_irq(struct qdio_initialize *init_data)
434 /* get qdio commands */ 418 /* get qdio commands */
435 ciw = ccw_device_get_ciw(init_data->cdev, CIW_TYPE_EQUEUE); 419 ciw = ccw_device_get_ciw(init_data->cdev, CIW_TYPE_EQUEUE);
436 if (!ciw) { 420 if (!ciw) {
437 QDIO_DBF_TEXT2(1, setup, "no eq"); 421 DBF_ERROR("%4x NO EQ", irq_ptr->schid.sch_no);
438 rc = -EINVAL; 422 rc = -EINVAL;
439 goto out_err; 423 goto out_err;
440 } 424 }
@@ -442,7 +426,7 @@ int qdio_setup_irq(struct qdio_initialize *init_data)
442 426
443 ciw = ccw_device_get_ciw(init_data->cdev, CIW_TYPE_AQUEUE); 427 ciw = ccw_device_get_ciw(init_data->cdev, CIW_TYPE_AQUEUE);
444 if (!ciw) { 428 if (!ciw) {
445 QDIO_DBF_TEXT2(1, setup, "no aq"); 429 DBF_ERROR("%4x NO AQ", irq_ptr->schid.sch_no);
446 rc = -EINVAL; 430 rc = -EINVAL;
447 goto out_err; 431 goto out_err;
448 } 432 }
@@ -462,56 +446,38 @@ void qdio_print_subchannel_info(struct qdio_irq *irq_ptr,
462{ 446{
463 char s[80]; 447 char s[80];
464 448
465 sprintf(s, "qdio: %s ", dev_name(&cdev->dev)); 449 snprintf(s, 80, "qdio: %s %s on SC %x using "
466 switch (irq_ptr->qib.qfmt) { 450 "AI:%d QEBSM:%d PCI:%d TDD:%d SIGA:%s%s%s%s%s%s\n",
467 case QDIO_QETH_QFMT: 451 dev_name(&cdev->dev),
468 sprintf(s + strlen(s), "OSA "); 452 (irq_ptr->qib.qfmt == QDIO_QETH_QFMT) ? "OSA" :
469 break; 453 ((irq_ptr->qib.qfmt == QDIO_ZFCP_QFMT) ? "ZFCP" : "HS"),
470 case QDIO_ZFCP_QFMT: 454 irq_ptr->schid.sch_no,
471 sprintf(s + strlen(s), "ZFCP "); 455 is_thinint_irq(irq_ptr),
472 break; 456 (irq_ptr->sch_token) ? 1 : 0,
473 case QDIO_IQDIO_QFMT: 457 (irq_ptr->qib.ac & QIB_AC_OUTBOUND_PCI_SUPPORTED) ? 1 : 0,
474 sprintf(s + strlen(s), "HS "); 458 css_general_characteristics.aif_tdd,
475 break; 459 (irq_ptr->siga_flag.input) ? "R" : " ",
476 } 460 (irq_ptr->siga_flag.output) ? "W" : " ",
477 sprintf(s + strlen(s), "on SC %x using ", irq_ptr->schid.sch_no); 461 (irq_ptr->siga_flag.sync) ? "S" : " ",
478 sprintf(s + strlen(s), "AI:%d ", is_thinint_irq(irq_ptr)); 462 (!irq_ptr->siga_flag.no_sync_ti) ? "A" : " ",
479 sprintf(s + strlen(s), "QEBSM:%d ", (irq_ptr->sch_token) ? 1 : 0); 463 (!irq_ptr->siga_flag.no_sync_out_ti) ? "O" : " ",
480 sprintf(s + strlen(s), "PCI:%d ", 464 (!irq_ptr->siga_flag.no_sync_out_pci) ? "P" : " ");
481 (irq_ptr->qib.ac & QIB_AC_OUTBOUND_PCI_SUPPORTED) ? 1 : 0);
482 sprintf(s + strlen(s), "TDD:%d ", css_general_characteristics.aif_tdd);
483 sprintf(s + strlen(s), "SIGA:");
484 sprintf(s + strlen(s), "%s", (irq_ptr->siga_flag.input) ? "R" : " ");
485 sprintf(s + strlen(s), "%s", (irq_ptr->siga_flag.output) ? "W" : " ");
486 sprintf(s + strlen(s), "%s", (irq_ptr->siga_flag.sync) ? "S" : " ");
487 sprintf(s + strlen(s), "%s",
488 (!irq_ptr->siga_flag.no_sync_ti) ? "A" : " ");
489 sprintf(s + strlen(s), "%s",
490 (!irq_ptr->siga_flag.no_sync_out_ti) ? "O" : " ");
491 sprintf(s + strlen(s), "%s",
492 (!irq_ptr->siga_flag.no_sync_out_pci) ? "P" : " ");
493 sprintf(s + strlen(s), "\n");
494 printk(KERN_INFO "%s", s); 465 printk(KERN_INFO "%s", s);
495} 466}
496 467
497int __init qdio_setup_init(void) 468int __init qdio_setup_init(void)
498{ 469{
499 char dbf_text[15];
500
501 qdio_q_cache = kmem_cache_create("qdio_q", sizeof(struct qdio_q), 470 qdio_q_cache = kmem_cache_create("qdio_q", sizeof(struct qdio_q),
502 256, 0, NULL); 471 256, 0, NULL);
503 if (!qdio_q_cache) 472 if (!qdio_q_cache)
504 return -ENOMEM; 473 return -ENOMEM;
505 474
506 /* Check for OSA/FCP thin interrupts (bit 67). */ 475 /* Check for OSA/FCP thin interrupts (bit 67). */
507 sprintf(dbf_text, "thini%1x", 476 DBF_EVENT("thinint:%1d",
508 (css_general_characteristics.aif_osa) ? 1 : 0); 477 (css_general_characteristics.aif_osa) ? 1 : 0);
509 QDIO_DBF_TEXT0(0, setup, dbf_text);
510 478
511 /* Check for QEBSM support in general (bit 58). */ 479 /* Check for QEBSM support in general (bit 58). */
512 sprintf(dbf_text, "cssQBS:%1x", 480 DBF_EVENT("cssQEBSM:%1d", (qebsm_possible()) ? 1 : 0);
513 (qebsm_possible()) ? 1 : 0);
514 QDIO_DBF_TEXT0(0, setup, dbf_text);
515 return 0; 481 return 0;
516} 482}
517 483
diff --git a/drivers/s390/cio/qdio_thinint.c b/drivers/s390/cio/qdio_thinint.c
index c47f6699a434..47ee741d65b2 100644
--- a/drivers/s390/cio/qdio_thinint.c
+++ b/drivers/s390/cio/qdio_thinint.c
@@ -258,8 +258,6 @@ static void tiqdio_thinint_handler(void *ind, void *drv_data)
258static int set_subchannel_ind(struct qdio_irq *irq_ptr, int reset) 258static int set_subchannel_ind(struct qdio_irq *irq_ptr, int reset)
259{ 259{
260 struct scssc_area *scssc_area; 260 struct scssc_area *scssc_area;
261 char dbf_text[15];
262 void *ptr;
263 int rc; 261 int rc;
264 262
265 scssc_area = (struct scssc_area *)irq_ptr->chsc_page; 263 scssc_area = (struct scssc_area *)irq_ptr->chsc_page;
@@ -294,19 +292,15 @@ static int set_subchannel_ind(struct qdio_irq *irq_ptr, int reset)
294 292
295 rc = chsc_error_from_response(scssc_area->response.code); 293 rc = chsc_error_from_response(scssc_area->response.code);
296 if (rc) { 294 if (rc) {
297 sprintf(dbf_text, "sidR%4x", scssc_area->response.code); 295 DBF_ERROR("%4x SSI r:%4x", irq_ptr->schid.sch_no,
298 QDIO_DBF_TEXT1(0, trace, dbf_text); 296 scssc_area->response.code);
299 QDIO_DBF_TEXT1(0, setup, dbf_text); 297 DBF_ERROR_HEX(&scssc_area->response, sizeof(void *));
300 ptr = &scssc_area->response;
301 QDIO_DBF_HEX2(1, setup, &ptr, QDIO_DBF_SETUP_LEN);
302 return rc; 298 return rc;
303 } 299 }
304 300
305 QDIO_DBF_TEXT2(0, setup, "setscind"); 301 DBF_EVENT("setscind");
306 QDIO_DBF_HEX2(0, setup, &scssc_area->summary_indicator_addr, 302 DBF_HEX(&scssc_area->summary_indicator_addr, sizeof(unsigned long));
307 sizeof(unsigned long)); 303 DBF_HEX(&scssc_area->subchannel_indicator_addr, sizeof(unsigned long));
308 QDIO_DBF_HEX2(0, setup, &scssc_area->subchannel_indicator_addr,
309 sizeof(unsigned long));
310 return 0; 304 return 0;
311} 305}
312 306
@@ -327,14 +321,11 @@ void tiqdio_free_memory(void)
327 321
328int __init tiqdio_register_thinints(void) 322int __init tiqdio_register_thinints(void)
329{ 323{
330 char dbf_text[20];
331
332 isc_register(QDIO_AIRQ_ISC); 324 isc_register(QDIO_AIRQ_ISC);
333 tiqdio_alsi = s390_register_adapter_interrupt(&tiqdio_thinint_handler, 325 tiqdio_alsi = s390_register_adapter_interrupt(&tiqdio_thinint_handler,
334 NULL, QDIO_AIRQ_ISC); 326 NULL, QDIO_AIRQ_ISC);
335 if (IS_ERR(tiqdio_alsi)) { 327 if (IS_ERR(tiqdio_alsi)) {
336 sprintf(dbf_text, "regthn%lx", PTR_ERR(tiqdio_alsi)); 328 DBF_EVENT("RTI:%lx", PTR_ERR(tiqdio_alsi));
337 QDIO_DBF_TEXT0(0, setup, dbf_text);
338 tiqdio_alsi = NULL; 329 tiqdio_alsi = NULL;
339 isc_unregister(QDIO_AIRQ_ISC); 330 isc_unregister(QDIO_AIRQ_ISC);
340 return -ENOMEM; 331 return -ENOMEM;
@@ -360,7 +351,7 @@ void qdio_setup_thinint(struct qdio_irq *irq_ptr)
360 if (!is_thinint_irq(irq_ptr)) 351 if (!is_thinint_irq(irq_ptr))
361 return; 352 return;
362 irq_ptr->dsci = get_indicator(); 353 irq_ptr->dsci = get_indicator();
363 QDIO_DBF_HEX1(0, setup, &irq_ptr->dsci, sizeof(void *)); 354 DBF_HEX(&irq_ptr->dsci, sizeof(void *));
364} 355}
365 356
366void qdio_shutdown_thinint(struct qdio_irq *irq_ptr) 357void qdio_shutdown_thinint(struct qdio_irq *irq_ptr)