aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoachim Fenkes <fenkes@de.ibm.com>2008-04-23 14:55:45 -0400
committerRoland Dreier <rolandd@cisco.com>2008-04-23 14:55:45 -0400
commit4da27d6d5b92c8fe4b3a3e5bcf42606d9e4a6fc8 (patch)
tree971988a287044db1d26d1cab24ad5e4aeb578ea8
parent863fb09fbf1eb74f56ea02184a62165056aa29cb (diff)
IB/ehca: Move high-volume debug output to higher debug levels
Signed-off-by: Joachim Fenkes <fenkes@de.ibm.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
-rw-r--r--drivers/infiniband/hw/ehca/ehca_irq.c2
-rw-r--r--drivers/infiniband/hw/ehca/ehca_main.c14
-rw-r--r--drivers/infiniband/hw/ehca/ehca_mrmw.c16
-rw-r--r--drivers/infiniband/hw/ehca/ehca_qp.c12
-rw-r--r--drivers/infiniband/hw/ehca/ehca_reqs.c46
-rw-r--r--drivers/infiniband/hw/ehca/ehca_uverbs.c6
-rw-r--r--drivers/infiniband/hw/ehca/hcp_if.c23
7 files changed, 63 insertions, 56 deletions
diff --git a/drivers/infiniband/hw/ehca/ehca_irq.c b/drivers/infiniband/hw/ehca/ehca_irq.c
index b5ca94c6b8d9..ca5eb0cb628c 100644
--- a/drivers/infiniband/hw/ehca/ehca_irq.c
+++ b/drivers/infiniband/hw/ehca/ehca_irq.c
@@ -633,7 +633,7 @@ static inline int find_next_online_cpu(struct ehca_comp_pool *pool)
633 unsigned long flags; 633 unsigned long flags;
634 634
635 WARN_ON_ONCE(!in_interrupt()); 635 WARN_ON_ONCE(!in_interrupt());
636 if (ehca_debug_level) 636 if (ehca_debug_level >= 3)
637 ehca_dmp(&cpu_online_map, sizeof(cpumask_t), ""); 637 ehca_dmp(&cpu_online_map, sizeof(cpumask_t), "");
638 638
639 spin_lock_irqsave(&pool->last_cpu_lock, flags); 639 spin_lock_irqsave(&pool->last_cpu_lock, flags);
diff --git a/drivers/infiniband/hw/ehca/ehca_main.c b/drivers/infiniband/hw/ehca/ehca_main.c
index 65b3362cdb9b..4379beff987f 100644
--- a/drivers/infiniband/hw/ehca/ehca_main.c
+++ b/drivers/infiniband/hw/ehca/ehca_main.c
@@ -85,8 +85,8 @@ module_param_named(lock_hcalls, ehca_lock_hcalls, bool, S_IRUGO);
85MODULE_PARM_DESC(open_aqp1, 85MODULE_PARM_DESC(open_aqp1,
86 "AQP1 on startup (0: no (default), 1: yes)"); 86 "AQP1 on startup (0: no (default), 1: yes)");
87MODULE_PARM_DESC(debug_level, 87MODULE_PARM_DESC(debug_level,
88 "debug level" 88 "Amount of debug output (0: none (default), 1: traces, "
89 " (0: no debug traces (default), 1: with debug traces)"); 89 "2: some dumps, 3: lots)");
90MODULE_PARM_DESC(hw_level, 90MODULE_PARM_DESC(hw_level,
91 "hardware level" 91 "hardware level"
92 " (0: autosensing (default), 1: v. 0.20, 2: v. 0.21)"); 92 " (0: autosensing (default), 1: v. 0.20, 2: v. 0.21)");
@@ -275,6 +275,7 @@ static int ehca_sense_attributes(struct ehca_shca *shca)
275 u64 h_ret; 275 u64 h_ret;
276 struct hipz_query_hca *rblock; 276 struct hipz_query_hca *rblock;
277 struct hipz_query_port *port; 277 struct hipz_query_port *port;
278 const char *loc_code;
278 279
279 static const u32 pgsize_map[] = { 280 static const u32 pgsize_map[] = {
280 HCA_CAP_MR_PGSIZE_4K, 0x1000, 281 HCA_CAP_MR_PGSIZE_4K, 0x1000,
@@ -283,6 +284,12 @@ static int ehca_sense_attributes(struct ehca_shca *shca)
283 HCA_CAP_MR_PGSIZE_16M, 0x1000000, 284 HCA_CAP_MR_PGSIZE_16M, 0x1000000,
284 }; 285 };
285 286
287 ehca_gen_dbg("Probing adapter %s...",
288 shca->ofdev->node->full_name);
289 loc_code = of_get_property(shca->ofdev->node, "ibm,loc-code", NULL);
290 if (loc_code)
291 ehca_gen_dbg(" ... location lode=%s", loc_code);
292
286 rblock = ehca_alloc_fw_ctrlblock(GFP_KERNEL); 293 rblock = ehca_alloc_fw_ctrlblock(GFP_KERNEL);
287 if (!rblock) { 294 if (!rblock) {
288 ehca_gen_err("Cannot allocate rblock memory."); 295 ehca_gen_err("Cannot allocate rblock memory.");
@@ -567,8 +574,7 @@ static int ehca_destroy_aqp1(struct ehca_sport *sport)
567 574
568static ssize_t ehca_show_debug_level(struct device_driver *ddp, char *buf) 575static ssize_t ehca_show_debug_level(struct device_driver *ddp, char *buf)
569{ 576{
570 return snprintf(buf, PAGE_SIZE, "%d\n", 577 return snprintf(buf, PAGE_SIZE, "%d\n", ehca_debug_level);
571 ehca_debug_level);
572} 578}
573 579
574static ssize_t ehca_store_debug_level(struct device_driver *ddp, 580static ssize_t ehca_store_debug_level(struct device_driver *ddp,
diff --git a/drivers/infiniband/hw/ehca/ehca_mrmw.c b/drivers/infiniband/hw/ehca/ehca_mrmw.c
index f26997fc00f8..46ae4eb2c4e1 100644
--- a/drivers/infiniband/hw/ehca/ehca_mrmw.c
+++ b/drivers/infiniband/hw/ehca/ehca_mrmw.c
@@ -1794,8 +1794,9 @@ static int ehca_check_kpages_per_ate(struct scatterlist *page_list,
1794 int t; 1794 int t;
1795 for (t = start_idx; t <= end_idx; t++) { 1795 for (t = start_idx; t <= end_idx; t++) {
1796 u64 pgaddr = page_to_pfn(sg_page(&page_list[t])) << PAGE_SHIFT; 1796 u64 pgaddr = page_to_pfn(sg_page(&page_list[t])) << PAGE_SHIFT;
1797 ehca_gen_dbg("chunk_page=%lx value=%016lx", pgaddr, 1797 if (ehca_debug_level >= 3)
1798 *(u64 *)abs_to_virt(phys_to_abs(pgaddr))); 1798 ehca_gen_dbg("chunk_page=%lx value=%016lx", pgaddr,
1799 *(u64 *)abs_to_virt(phys_to_abs(pgaddr)));
1799 if (pgaddr - PAGE_SIZE != *prev_pgaddr) { 1800 if (pgaddr - PAGE_SIZE != *prev_pgaddr) {
1800 ehca_gen_err("uncontiguous page found pgaddr=%lx " 1801 ehca_gen_err("uncontiguous page found pgaddr=%lx "
1801 "prev_pgaddr=%lx page_list_i=%x", 1802 "prev_pgaddr=%lx page_list_i=%x",
@@ -1862,10 +1863,13 @@ static int ehca_set_pagebuf_user2(struct ehca_mr_pginfo *pginfo,
1862 pgaddr & 1863 pgaddr &
1863 ~(pginfo->hwpage_size - 1)); 1864 ~(pginfo->hwpage_size - 1));
1864 } 1865 }
1865 ehca_gen_dbg("kpage=%lx chunk_page=%lx " 1866 if (ehca_debug_level >= 3) {
1866 "value=%016lx", *kpage, pgaddr, 1867 u64 val = *(u64 *)abs_to_virt(
1867 *(u64 *)abs_to_virt( 1868 phys_to_abs(pgaddr));
1868 phys_to_abs(pgaddr))); 1869 ehca_gen_dbg("kpage=%lx chunk_page=%lx "
1870 "value=%016lx",
1871 *kpage, pgaddr, val);
1872 }
1869 prev_pgaddr = pgaddr; 1873 prev_pgaddr = pgaddr;
1870 i++; 1874 i++;
1871 pginfo->kpage_cnt++; 1875 pginfo->kpage_cnt++;
diff --git a/drivers/infiniband/hw/ehca/ehca_qp.c b/drivers/infiniband/hw/ehca/ehca_qp.c
index 5a653d75fd2e..57bef1152cc2 100644
--- a/drivers/infiniband/hw/ehca/ehca_qp.c
+++ b/drivers/infiniband/hw/ehca/ehca_qp.c
@@ -966,7 +966,7 @@ static int prepare_sqe_rts(struct ehca_qp *my_qp, struct ehca_shca *shca,
966 qp_num, bad_send_wqe_p); 966 qp_num, bad_send_wqe_p);
967 /* convert wqe pointer to vadr */ 967 /* convert wqe pointer to vadr */
968 bad_send_wqe_v = abs_to_virt((u64)bad_send_wqe_p); 968 bad_send_wqe_v = abs_to_virt((u64)bad_send_wqe_p);
969 if (ehca_debug_level) 969 if (ehca_debug_level >= 2)
970 ehca_dmp(bad_send_wqe_v, 32, "qp_num=%x bad_wqe", qp_num); 970 ehca_dmp(bad_send_wqe_v, 32, "qp_num=%x bad_wqe", qp_num);
971 squeue = &my_qp->ipz_squeue; 971 squeue = &my_qp->ipz_squeue;
972 if (ipz_queue_abs_to_offset(squeue, (u64)bad_send_wqe_p, &q_ofs)) { 972 if (ipz_queue_abs_to_offset(squeue, (u64)bad_send_wqe_p, &q_ofs)) {
@@ -979,7 +979,7 @@ static int prepare_sqe_rts(struct ehca_qp *my_qp, struct ehca_shca *shca,
979 wqe = (struct ehca_wqe *)ipz_qeit_calc(squeue, q_ofs); 979 wqe = (struct ehca_wqe *)ipz_qeit_calc(squeue, q_ofs);
980 *bad_wqe_cnt = 0; 980 *bad_wqe_cnt = 0;
981 while (wqe->optype != 0xff && wqe->wqef != 0xff) { 981 while (wqe->optype != 0xff && wqe->wqef != 0xff) {
982 if (ehca_debug_level) 982 if (ehca_debug_level >= 2)
983 ehca_dmp(wqe, 32, "qp_num=%x wqe", qp_num); 983 ehca_dmp(wqe, 32, "qp_num=%x wqe", qp_num);
984 wqe->nr_of_data_seg = 0; /* suppress data access */ 984 wqe->nr_of_data_seg = 0; /* suppress data access */
985 wqe->wqef = WQEF_PURGE; /* WQE to be purged */ 985 wqe->wqef = WQEF_PURGE; /* WQE to be purged */
@@ -1451,7 +1451,7 @@ static int internal_modify_qp(struct ib_qp *ibqp,
1451 /* no support for max_send/recv_sge yet */ 1451 /* no support for max_send/recv_sge yet */
1452 } 1452 }
1453 1453
1454 if (ehca_debug_level) 1454 if (ehca_debug_level >= 2)
1455 ehca_dmp(mqpcb, 4*70, "qp_num=%x", ibqp->qp_num); 1455 ehca_dmp(mqpcb, 4*70, "qp_num=%x", ibqp->qp_num);
1456 1456
1457 h_ret = hipz_h_modify_qp(shca->ipz_hca_handle, 1457 h_ret = hipz_h_modify_qp(shca->ipz_hca_handle,
@@ -1766,7 +1766,7 @@ int ehca_query_qp(struct ib_qp *qp,
1766 if (qp_init_attr) 1766 if (qp_init_attr)
1767 *qp_init_attr = my_qp->init_attr; 1767 *qp_init_attr = my_qp->init_attr;
1768 1768
1769 if (ehca_debug_level) 1769 if (ehca_debug_level >= 2)
1770 ehca_dmp(qpcb, 4*70, "qp_num=%x", qp->qp_num); 1770 ehca_dmp(qpcb, 4*70, "qp_num=%x", qp->qp_num);
1771 1771
1772query_qp_exit1: 1772query_qp_exit1:
@@ -1814,7 +1814,7 @@ int ehca_modify_srq(struct ib_srq *ibsrq, struct ib_srq_attr *attr,
1814 goto modify_srq_exit0; 1814 goto modify_srq_exit0;
1815 } 1815 }
1816 1816
1817 if (ehca_debug_level) 1817 if (ehca_debug_level >= 2)
1818 ehca_dmp(mqpcb, 4*70, "qp_num=%x", my_qp->real_qp_num); 1818 ehca_dmp(mqpcb, 4*70, "qp_num=%x", my_qp->real_qp_num);
1819 1819
1820 h_ret = hipz_h_modify_qp(shca->ipz_hca_handle, my_qp->ipz_qp_handle, 1820 h_ret = hipz_h_modify_qp(shca->ipz_hca_handle, my_qp->ipz_qp_handle,
@@ -1867,7 +1867,7 @@ int ehca_query_srq(struct ib_srq *srq, struct ib_srq_attr *srq_attr)
1867 srq_attr->srq_limit = EHCA_BMASK_GET( 1867 srq_attr->srq_limit = EHCA_BMASK_GET(
1868 MQPCB_CURR_SRQ_LIMIT, qpcb->curr_srq_limit); 1868 MQPCB_CURR_SRQ_LIMIT, qpcb->curr_srq_limit);
1869 1869
1870 if (ehca_debug_level) 1870 if (ehca_debug_level >= 2)
1871 ehca_dmp(qpcb, 4*70, "qp_num=%x", my_qp->real_qp_num); 1871 ehca_dmp(qpcb, 4*70, "qp_num=%x", my_qp->real_qp_num);
1872 1872
1873query_srq_exit1: 1873query_srq_exit1:
diff --git a/drivers/infiniband/hw/ehca/ehca_reqs.c b/drivers/infiniband/hw/ehca/ehca_reqs.c
index 0b2359e2757a..bbe0436f4f75 100644
--- a/drivers/infiniband/hw/ehca/ehca_reqs.c
+++ b/drivers/infiniband/hw/ehca/ehca_reqs.c
@@ -81,7 +81,7 @@ static inline int ehca_write_rwqe(struct ipz_queue *ipz_rqueue,
81 recv_wr->sg_list[cnt_ds].length; 81 recv_wr->sg_list[cnt_ds].length;
82 } 82 }
83 83
84 if (ehca_debug_level) { 84 if (ehca_debug_level >= 3) {
85 ehca_gen_dbg("RECEIVE WQE written into ipz_rqueue=%p", 85 ehca_gen_dbg("RECEIVE WQE written into ipz_rqueue=%p",
86 ipz_rqueue); 86 ipz_rqueue);
87 ehca_dmp(wqe_p, 16*(6 + wqe_p->nr_of_data_seg), "recv wqe"); 87 ehca_dmp(wqe_p, 16*(6 + wqe_p->nr_of_data_seg), "recv wqe");
@@ -281,7 +281,7 @@ static inline int ehca_write_swqe(struct ehca_qp *qp,
281 return -EINVAL; 281 return -EINVAL;
282 } 282 }
283 283
284 if (ehca_debug_level) { 284 if (ehca_debug_level >= 3) {
285 ehca_gen_dbg("SEND WQE written into queue qp=%p ", qp); 285 ehca_gen_dbg("SEND WQE written into queue qp=%p ", qp);
286 ehca_dmp( wqe_p, 16*(6 + wqe_p->nr_of_data_seg), "send wqe"); 286 ehca_dmp( wqe_p, 16*(6 + wqe_p->nr_of_data_seg), "send wqe");
287 } 287 }
@@ -459,13 +459,14 @@ int ehca_post_send(struct ib_qp *qp,
459 goto post_send_exit0; 459 goto post_send_exit0;
460 } 460 }
461 wqe_cnt++; 461 wqe_cnt++;
462 ehca_dbg(qp->device, "ehca_qp=%p qp_num=%x wqe_cnt=%d",
463 my_qp, qp->qp_num, wqe_cnt);
464 } /* eof for cur_send_wr */ 462 } /* eof for cur_send_wr */
465 463
466post_send_exit0: 464post_send_exit0:
467 iosync(); /* serialize GAL register access */ 465 iosync(); /* serialize GAL register access */
468 hipz_update_sqa(my_qp, wqe_cnt); 466 hipz_update_sqa(my_qp, wqe_cnt);
467 if (unlikely(ret || ehca_debug_level >= 2))
468 ehca_dbg(qp->device, "ehca_qp=%p qp_num=%x wqe_cnt=%d ret=%i",
469 my_qp, qp->qp_num, wqe_cnt, ret);
469 my_qp->message_count += wqe_cnt; 470 my_qp->message_count += wqe_cnt;
470 spin_unlock_irqrestore(&my_qp->spinlock_s, flags); 471 spin_unlock_irqrestore(&my_qp->spinlock_s, flags);
471 return ret; 472 return ret;
@@ -525,13 +526,14 @@ static int internal_post_recv(struct ehca_qp *my_qp,
525 goto post_recv_exit0; 526 goto post_recv_exit0;
526 } 527 }
527 wqe_cnt++; 528 wqe_cnt++;
528 ehca_dbg(dev, "ehca_qp=%p qp_num=%x wqe_cnt=%d",
529 my_qp, my_qp->real_qp_num, wqe_cnt);
530 } /* eof for cur_recv_wr */ 529 } /* eof for cur_recv_wr */
531 530
532post_recv_exit0: 531post_recv_exit0:
533 iosync(); /* serialize GAL register access */ 532 iosync(); /* serialize GAL register access */
534 hipz_update_rqa(my_qp, wqe_cnt); 533 hipz_update_rqa(my_qp, wqe_cnt);
534 if (unlikely(ret || ehca_debug_level >= 2))
535 ehca_dbg(dev, "ehca_qp=%p qp_num=%x wqe_cnt=%d ret=%i",
536 my_qp, my_qp->real_qp_num, wqe_cnt, ret);
535 spin_unlock_irqrestore(&my_qp->spinlock_r, flags); 537 spin_unlock_irqrestore(&my_qp->spinlock_r, flags);
536 return ret; 538 return ret;
537} 539}
@@ -575,16 +577,17 @@ static inline int ehca_poll_cq_one(struct ib_cq *cq, struct ib_wc *wc)
575 struct ehca_cq *my_cq = container_of(cq, struct ehca_cq, ib_cq); 577 struct ehca_cq *my_cq = container_of(cq, struct ehca_cq, ib_cq);
576 struct ehca_cqe *cqe; 578 struct ehca_cqe *cqe;
577 struct ehca_qp *my_qp; 579 struct ehca_qp *my_qp;
578 int cqe_count = 0; 580 int cqe_count = 0, is_error;
579 581
580poll_cq_one_read_cqe: 582poll_cq_one_read_cqe:
581 cqe = (struct ehca_cqe *) 583 cqe = (struct ehca_cqe *)
582 ipz_qeit_get_inc_valid(&my_cq->ipz_queue); 584 ipz_qeit_get_inc_valid(&my_cq->ipz_queue);
583 if (!cqe) { 585 if (!cqe) {
584 ret = -EAGAIN; 586 ret = -EAGAIN;
585 ehca_dbg(cq->device, "Completion queue is empty ehca_cq=%p " 587 if (ehca_debug_level >= 3)
586 "cq_num=%x ret=%i", my_cq, my_cq->cq_number, ret); 588 ehca_dbg(cq->device, "Completion queue is empty "
587 goto poll_cq_one_exit0; 589 "my_cq=%p cq_num=%x", my_cq, my_cq->cq_number);
590 goto poll_cq_one_exit0;
588 } 591 }
589 592
590 /* prevents loads being reordered across this point */ 593 /* prevents loads being reordered across this point */
@@ -614,7 +617,7 @@ poll_cq_one_read_cqe:
614 ehca_dbg(cq->device, 617 ehca_dbg(cq->device,
615 "Got CQE with purged bit qp_num=%x src_qp=%x", 618 "Got CQE with purged bit qp_num=%x src_qp=%x",
616 cqe->local_qp_number, cqe->remote_qp_number); 619 cqe->local_qp_number, cqe->remote_qp_number);
617 if (ehca_debug_level) 620 if (ehca_debug_level >= 2)
618 ehca_dmp(cqe, 64, "qp_num=%x src_qp=%x", 621 ehca_dmp(cqe, 64, "qp_num=%x src_qp=%x",
619 cqe->local_qp_number, 622 cqe->local_qp_number,
620 cqe->remote_qp_number); 623 cqe->remote_qp_number);
@@ -627,11 +630,13 @@ poll_cq_one_read_cqe:
627 } 630 }
628 } 631 }
629 632
630 /* tracing cqe */ 633 is_error = cqe->status & WC_STATUS_ERROR_BIT;
631 if (unlikely(ehca_debug_level)) { 634
635 /* trace error CQEs if debug_level >= 1, trace all CQEs if >= 3 */
636 if (unlikely(ehca_debug_level >= 3 || (ehca_debug_level && is_error))) {
632 ehca_dbg(cq->device, 637 ehca_dbg(cq->device,
633 "Received COMPLETION ehca_cq=%p cq_num=%x -----", 638 "Received %sCOMPLETION ehca_cq=%p cq_num=%x -----",
634 my_cq, my_cq->cq_number); 639 is_error ? "ERROR " : "", my_cq, my_cq->cq_number);
635 ehca_dmp(cqe, 64, "ehca_cq=%p cq_num=%x", 640 ehca_dmp(cqe, 64, "ehca_cq=%p cq_num=%x",
636 my_cq, my_cq->cq_number); 641 my_cq, my_cq->cq_number);
637 ehca_dbg(cq->device, 642 ehca_dbg(cq->device,
@@ -654,8 +659,9 @@ poll_cq_one_read_cqe:
654 /* update also queue adder to throw away this entry!!! */ 659 /* update also queue adder to throw away this entry!!! */
655 goto poll_cq_one_exit0; 660 goto poll_cq_one_exit0;
656 } 661 }
662
657 /* eval ib_wc_status */ 663 /* eval ib_wc_status */
658 if (unlikely(cqe->status & WC_STATUS_ERROR_BIT)) { 664 if (unlikely(is_error)) {
659 /* complete with errors */ 665 /* complete with errors */
660 map_ib_wc_status(cqe->status, &wc->status); 666 map_ib_wc_status(cqe->status, &wc->status);
661 wc->vendor_err = wc->status; 667 wc->vendor_err = wc->status;
@@ -676,14 +682,6 @@ poll_cq_one_read_cqe:
676 wc->imm_data = cpu_to_be32(cqe->immediate_data); 682 wc->imm_data = cpu_to_be32(cqe->immediate_data);
677 wc->sl = cqe->service_level; 683 wc->sl = cqe->service_level;
678 684
679 if (unlikely(wc->status != IB_WC_SUCCESS))
680 ehca_dbg(cq->device,
681 "ehca_cq=%p cq_num=%x WARNING unsuccessful cqe "
682 "OPType=%x status=%x qp_num=%x src_qp=%x wr_id=%lx "
683 "cqe=%p", my_cq, my_cq->cq_number, cqe->optype,
684 cqe->status, cqe->local_qp_number,
685 cqe->remote_qp_number, cqe->work_request_id, cqe);
686
687poll_cq_one_exit0: 685poll_cq_one_exit0:
688 if (cqe_count > 0) 686 if (cqe_count > 0)
689 hipz_update_feca(my_cq, cqe_count); 687 hipz_update_feca(my_cq, cqe_count);
diff --git a/drivers/infiniband/hw/ehca/ehca_uverbs.c b/drivers/infiniband/hw/ehca/ehca_uverbs.c
index 1b07f2beafaf..e43ed8f8a0c8 100644
--- a/drivers/infiniband/hw/ehca/ehca_uverbs.c
+++ b/drivers/infiniband/hw/ehca/ehca_uverbs.c
@@ -211,8 +211,7 @@ static int ehca_mmap_qp(struct vm_area_struct *vma, struct ehca_qp *qp,
211 break; 211 break;
212 212
213 case 1: /* qp rqueue_addr */ 213 case 1: /* qp rqueue_addr */
214 ehca_dbg(qp->ib_qp.device, "qp_num=%x rqueue", 214 ehca_dbg(qp->ib_qp.device, "qp_num=%x rq", qp->ib_qp.qp_num);
215 qp->ib_qp.qp_num);
216 ret = ehca_mmap_queue(vma, &qp->ipz_rqueue, 215 ret = ehca_mmap_queue(vma, &qp->ipz_rqueue,
217 &qp->mm_count_rqueue); 216 &qp->mm_count_rqueue);
218 if (unlikely(ret)) { 217 if (unlikely(ret)) {
@@ -224,8 +223,7 @@ static int ehca_mmap_qp(struct vm_area_struct *vma, struct ehca_qp *qp,
224 break; 223 break;
225 224
226 case 2: /* qp squeue_addr */ 225 case 2: /* qp squeue_addr */
227 ehca_dbg(qp->ib_qp.device, "qp_num=%x squeue", 226 ehca_dbg(qp->ib_qp.device, "qp_num=%x sq", qp->ib_qp.qp_num);
228 qp->ib_qp.qp_num);
229 ret = ehca_mmap_queue(vma, &qp->ipz_squeue, 227 ret = ehca_mmap_queue(vma, &qp->ipz_squeue,
230 &qp->mm_count_squeue); 228 &qp->mm_count_squeue);
231 if (unlikely(ret)) { 229 if (unlikely(ret)) {
diff --git a/drivers/infiniband/hw/ehca/hcp_if.c b/drivers/infiniband/hw/ehca/hcp_if.c
index 7029aa653751..5245e13c3a30 100644
--- a/drivers/infiniband/hw/ehca/hcp_if.c
+++ b/drivers/infiniband/hw/ehca/hcp_if.c
@@ -123,8 +123,9 @@ static long ehca_plpar_hcall_norets(unsigned long opcode,
123 int i, sleep_msecs; 123 int i, sleep_msecs;
124 unsigned long flags = 0; 124 unsigned long flags = 0;
125 125
126 ehca_gen_dbg("opcode=%lx " HCALL7_REGS_FORMAT, 126 if (unlikely(ehca_debug_level >= 2))
127 opcode, arg1, arg2, arg3, arg4, arg5, arg6, arg7); 127 ehca_gen_dbg("opcode=%lx " HCALL7_REGS_FORMAT,
128 opcode, arg1, arg2, arg3, arg4, arg5, arg6, arg7);
128 129
129 for (i = 0; i < 5; i++) { 130 for (i = 0; i < 5; i++) {
130 /* serialize hCalls to work around firmware issue */ 131 /* serialize hCalls to work around firmware issue */
@@ -148,7 +149,8 @@ static long ehca_plpar_hcall_norets(unsigned long opcode,
148 opcode, ret, arg1, arg2, arg3, 149 opcode, ret, arg1, arg2, arg3,
149 arg4, arg5, arg6, arg7); 150 arg4, arg5, arg6, arg7);
150 else 151 else
151 ehca_gen_dbg("opcode=%lx ret=%li", opcode, ret); 152 if (unlikely(ehca_debug_level >= 2))
153 ehca_gen_dbg("opcode=%lx ret=%li", opcode, ret);
152 154
153 return ret; 155 return ret;
154 } 156 }
@@ -172,8 +174,10 @@ static long ehca_plpar_hcall9(unsigned long opcode,
172 int i, sleep_msecs; 174 int i, sleep_msecs;
173 unsigned long flags = 0; 175 unsigned long flags = 0;
174 176
175 ehca_gen_dbg("INPUT -- opcode=%lx " HCALL9_REGS_FORMAT, opcode, 177 if (unlikely(ehca_debug_level >= 2))
176 arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9); 178 ehca_gen_dbg("INPUT -- opcode=%lx " HCALL9_REGS_FORMAT, opcode,
179 arg1, arg2, arg3, arg4, arg5,
180 arg6, arg7, arg8, arg9);
177 181
178 for (i = 0; i < 5; i++) { 182 for (i = 0; i < 5; i++) {
179 /* serialize hCalls to work around firmware issue */ 183 /* serialize hCalls to work around firmware issue */
@@ -201,7 +205,7 @@ static long ehca_plpar_hcall9(unsigned long opcode,
201 ret, outs[0], outs[1], outs[2], outs[3], 205 ret, outs[0], outs[1], outs[2], outs[3],
202 outs[4], outs[5], outs[6], outs[7], 206 outs[4], outs[5], outs[6], outs[7],
203 outs[8]); 207 outs[8]);
204 } else 208 } else if (unlikely(ehca_debug_level >= 2))
205 ehca_gen_dbg("OUTPUT -- ret=%li " HCALL9_REGS_FORMAT, 209 ehca_gen_dbg("OUTPUT -- ret=%li " HCALL9_REGS_FORMAT,
206 ret, outs[0], outs[1], outs[2], outs[3], 210 ret, outs[0], outs[1], outs[2], outs[3],
207 outs[4], outs[5], outs[6], outs[7], 211 outs[4], outs[5], outs[6], outs[7],
@@ -381,7 +385,7 @@ u64 hipz_h_query_port(const struct ipz_adapter_handle adapter_handle,
381 r_cb, /* r6 */ 385 r_cb, /* r6 */
382 0, 0, 0, 0); 386 0, 0, 0, 0);
383 387
384 if (ehca_debug_level) 388 if (ehca_debug_level >= 2)
385 ehca_dmp(query_port_response_block, 64, "response_block"); 389 ehca_dmp(query_port_response_block, 64, "response_block");
386 390
387 return ret; 391 return ret;
@@ -731,9 +735,6 @@ u64 hipz_h_alloc_resource_mr(const struct ipz_adapter_handle adapter_handle,
731 u64 ret; 735 u64 ret;
732 u64 outs[PLPAR_HCALL9_BUFSIZE]; 736 u64 outs[PLPAR_HCALL9_BUFSIZE];
733 737
734 ehca_gen_dbg("kernel PAGE_SIZE=%x access_ctrl=%016x "
735 "vaddr=%lx length=%lx",
736 (u32)PAGE_SIZE, access_ctrl, vaddr, length);
737 ret = ehca_plpar_hcall9(H_ALLOC_RESOURCE, outs, 738 ret = ehca_plpar_hcall9(H_ALLOC_RESOURCE, outs,
738 adapter_handle.handle, /* r4 */ 739 adapter_handle.handle, /* r4 */
739 5, /* r5 */ 740 5, /* r5 */
@@ -758,7 +759,7 @@ u64 hipz_h_register_rpage_mr(const struct ipz_adapter_handle adapter_handle,
758{ 759{
759 u64 ret; 760 u64 ret;
760 761
761 if (unlikely(ehca_debug_level >= 2)) { 762 if (unlikely(ehca_debug_level >= 3)) {
762 if (count > 1) { 763 if (count > 1) {
763 u64 *kpage; 764 u64 *kpage;
764 int i; 765 int i;