diff options
author | Jan Glauber <jang@linux.vnet.ibm.com> | 2008-12-25 07:38:46 -0500 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2008-12-25 07:38:59 -0500 |
commit | 22f9934767f49012ffbae753b28b8055bd28348f (patch) | |
tree | 7cb58ceff25b9c6b5ade5646b6444b7689621f81 /drivers/s390/cio/qdio_setup.c | |
parent | 9a1ce28aeb7a8b1666eaa9f104c1a2f5a149f9df (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/qdio_setup.c')
-rw-r--r-- | drivers/s390/cio/qdio_setup.c | 110 |
1 files changed, 38 insertions, 72 deletions
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 | ||
122 | static void setup_storage_lists(struct qdio_q *q, struct qdio_irq *irq_ptr, | 122 | static 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 | ||
159 | static void setup_queues(struct qdio_irq *irq_ptr, | 157 | static 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) | |||
222 | static void check_and_setup_qebsm(struct qdio_irq *irq_ptr, | 215 | static 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 | ||
240 | no_qebsm: | 230 | no_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, | |||
294 | void qdio_setup_ssqd_info(struct qdio_irq *irq_ptr) | 284 | void 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 | ||
320 | void qdio_release_memory(struct qdio_irq *irq_ptr) | 304 | void 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 | ||
497 | int __init qdio_setup_init(void) | 468 | int __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 | ||