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_main.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_main.c')
-rw-r--r-- | drivers/s390/cio/qdio_main.c | 324 |
1 files changed, 95 insertions, 229 deletions
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 | ||
96 | static inline int qdio_check_ccq(struct qdio_q *q, unsigned int ccq) | 96 | static 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); |
347 | again: | 334 | again: |
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 | ||
408 | static void announce_buffer_error(struct qdio_q *q) | 392 | static 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 | } |
508 | out: | 486 | out: |
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) | |||
530 | static int qdio_inbound_q_done(struct qdio_q *q) | 506 | static 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) | |||
578 | void qdio_kick_inbound_handler(struct qdio_q *q) | 543 | void 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) | |||
747 | static void qdio_kick_outbound_q(struct qdio_q *q) | 705 | static 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) | |||
801 | static void qdio_kick_outbound_handler(struct qdio_q *q) | 744 | static 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) | |||
913 | static inline void qdio_set_state(struct qdio_irq *irq_ptr, | 848 | static 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 | ||
928 | static void qdio_irq_check_sense(struct subchannel_id schid, struct irb *irb) | 857 | static 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 | ||
1029 | static int qdio_establish_check_errors(struct ccw_device *cdev, int cstat, | 951 | static 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; |
1049 | error: | 971 | error: |
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, | |||
1142 | int qdio_get_ssqd_desc(struct ccw_device *cdev, | 1057 | int 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 | } |
1155 | EXPORT_SYMBOL_GPL(qdio_get_ssqd_desc); | 1067 | EXPORT_SYMBOL_GPL(qdio_get_ssqd_desc); |
@@ -1164,14 +1076,9 @@ EXPORT_SYMBOL_GPL(qdio_get_ssqd_desc); | |||
1164 | */ | 1076 | */ |
1165 | int qdio_cleanup(struct ccw_device *cdev, int how) | 1077 | int 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 | */ |
1205 | int qdio_shutdown(struct ccw_device *cdev, int how) | 1112 | int 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 | */ |
1277 | int qdio_free(struct ccw_device *cdev) | 1179 | int 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); | |||
1305 | int qdio_initialize(struct qdio_initialize *init_data) | 1208 | int 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); | |||
1328 | int qdio_allocate(struct qdio_initialize *init_data) | 1227 | int 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 | */ |
1396 | int qdio_establish(struct qdio_initialize *init_data) | 1287 | int 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 | } |
1664 | out: | 1545 | out: |
@@ -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 | } |
1729 | EXPORT_SYMBOL_GPL(do_QDIO); | 1595 | EXPORT_SYMBOL_GPL(do_QDIO); |