aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/ehca
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/infiniband/hw/ehca')
-rw-r--r--drivers/infiniband/hw/ehca/ehca_irq.c9
-rw-r--r--drivers/infiniband/hw/ehca/ehca_main.c1
-rw-r--r--drivers/infiniband/hw/ehca/ehca_reqs.c14
-rw-r--r--drivers/infiniband/hw/ehca/hcp_if.c10
-rw-r--r--drivers/infiniband/hw/ehca/hcp_if.h1
5 files changed, 30 insertions, 5 deletions
diff --git a/drivers/infiniband/hw/ehca/ehca_irq.c b/drivers/infiniband/hw/ehca/ehca_irq.c
index ce1ab0571be3..0792d930c481 100644
--- a/drivers/infiniband/hw/ehca/ehca_irq.c
+++ b/drivers/infiniband/hw/ehca/ehca_irq.c
@@ -531,7 +531,7 @@ void ehca_process_eq(struct ehca_shca *shca, int is_irq)
531{ 531{
532 struct ehca_eq *eq = &shca->eq; 532 struct ehca_eq *eq = &shca->eq;
533 struct ehca_eqe_cache_entry *eqe_cache = eq->eqe_cache; 533 struct ehca_eqe_cache_entry *eqe_cache = eq->eqe_cache;
534 u64 eqe_value; 534 u64 eqe_value, ret;
535 unsigned long flags; 535 unsigned long flags;
536 int eqe_cnt, i; 536 int eqe_cnt, i;
537 int eq_empty = 0; 537 int eq_empty = 0;
@@ -583,8 +583,13 @@ void ehca_process_eq(struct ehca_shca *shca, int is_irq)
583 ehca_dbg(&shca->ib_device, 583 ehca_dbg(&shca->ib_device,
584 "No eqe found for irq event"); 584 "No eqe found for irq event");
585 goto unlock_irq_spinlock; 585 goto unlock_irq_spinlock;
586 } else if (!is_irq) 586 } else if (!is_irq) {
587 ret = hipz_h_eoi(eq->ist);
588 if (ret != H_SUCCESS)
589 ehca_err(&shca->ib_device,
590 "bad return code EOI -rc = %ld\n", ret);
587 ehca_dbg(&shca->ib_device, "deadman found %x eqe", eqe_cnt); 591 ehca_dbg(&shca->ib_device, "deadman found %x eqe", eqe_cnt);
592 }
588 if (unlikely(eqe_cnt == EHCA_EQE_CACHE_SIZE)) 593 if (unlikely(eqe_cnt == EHCA_EQE_CACHE_SIZE))
589 ehca_dbg(&shca->ib_device, "too many eqes for one irq event"); 594 ehca_dbg(&shca->ib_device, "too many eqes for one irq event");
590 /* enable irq for new packets */ 595 /* enable irq for new packets */
diff --git a/drivers/infiniband/hw/ehca/ehca_main.c b/drivers/infiniband/hw/ehca/ehca_main.c
index 482103eb6eac..598844d2edc9 100644
--- a/drivers/infiniband/hw/ehca/ehca_main.c
+++ b/drivers/infiniband/hw/ehca/ehca_main.c
@@ -923,6 +923,7 @@ static struct of_device_id ehca_device_table[] =
923 }, 923 },
924 {}, 924 {},
925}; 925};
926MODULE_DEVICE_TABLE(of, ehca_device_table);
926 927
927static struct of_platform_driver ehca_driver = { 928static struct of_platform_driver ehca_driver = {
928 .name = "ehca", 929 .name = "ehca",
diff --git a/drivers/infiniband/hw/ehca/ehca_reqs.c b/drivers/infiniband/hw/ehca/ehca_reqs.c
index f093b0033daf..dd9bc68f1c7b 100644
--- a/drivers/infiniband/hw/ehca/ehca_reqs.c
+++ b/drivers/infiniband/hw/ehca/ehca_reqs.c
@@ -544,8 +544,16 @@ int ehca_post_recv(struct ib_qp *qp,
544 struct ib_recv_wr *recv_wr, 544 struct ib_recv_wr *recv_wr,
545 struct ib_recv_wr **bad_recv_wr) 545 struct ib_recv_wr **bad_recv_wr)
546{ 546{
547 return internal_post_recv(container_of(qp, struct ehca_qp, ib_qp), 547 struct ehca_qp *my_qp = container_of(qp, struct ehca_qp, ib_qp);
548 qp->device, recv_wr, bad_recv_wr); 548
549 /* Reject WR if QP is in RESET state */
550 if (unlikely(my_qp->state == IB_QPS_RESET)) {
551 ehca_err(qp->device, "Invalid QP state qp_state=%d qpn=%x",
552 my_qp->state, qp->qp_num);
553 return -EINVAL;
554 }
555
556 return internal_post_recv(my_qp, qp->device, recv_wr, bad_recv_wr);
549} 557}
550 558
551int ehca_post_srq_recv(struct ib_srq *srq, 559int ehca_post_srq_recv(struct ib_srq *srq,
@@ -681,7 +689,7 @@ poll_cq_one_read_cqe:
681 wc->dlid_path_bits = cqe->dlid; 689 wc->dlid_path_bits = cqe->dlid;
682 wc->src_qp = cqe->remote_qp_number; 690 wc->src_qp = cqe->remote_qp_number;
683 wc->wc_flags = cqe->w_completion_flags; 691 wc->wc_flags = cqe->w_completion_flags;
684 wc->imm_data = cpu_to_be32(cqe->immediate_data); 692 wc->ex.imm_data = cpu_to_be32(cqe->immediate_data);
685 wc->sl = cqe->service_level; 693 wc->sl = cqe->service_level;
686 694
687poll_cq_one_exit0: 695poll_cq_one_exit0:
diff --git a/drivers/infiniband/hw/ehca/hcp_if.c b/drivers/infiniband/hw/ehca/hcp_if.c
index 5245e13c3a30..415d3a465de6 100644
--- a/drivers/infiniband/hw/ehca/hcp_if.c
+++ b/drivers/infiniband/hw/ehca/hcp_if.c
@@ -933,3 +933,13 @@ u64 hipz_h_error_data(const struct ipz_adapter_handle adapter_handle,
933 r_cb, 933 r_cb,
934 0, 0, 0, 0); 934 0, 0, 0, 0);
935} 935}
936
937u64 hipz_h_eoi(int irq)
938{
939 unsigned long xirr;
940
941 iosync();
942 xirr = (0xffULL << 24) | irq;
943
944 return plpar_hcall_norets(H_EOI, xirr);
945}
diff --git a/drivers/infiniband/hw/ehca/hcp_if.h b/drivers/infiniband/hw/ehca/hcp_if.h
index 60ce02b70663..2c3c6e0ea5c2 100644
--- a/drivers/infiniband/hw/ehca/hcp_if.h
+++ b/drivers/infiniband/hw/ehca/hcp_if.h
@@ -260,5 +260,6 @@ u64 hipz_h_error_data(const struct ipz_adapter_handle adapter_handle,
260 const u64 ressource_handle, 260 const u64 ressource_handle,
261 void *rblock, 261 void *rblock,
262 unsigned long *byte_count); 262 unsigned long *byte_count);
263u64 hipz_h_eoi(int irq);
263 264
264#endif /* __HCP_IF_H__ */ 265#endif /* __HCP_IF_H__ */