Lines Matching +full:rx +full:- +full:eq

1 // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
10 struct gdma_resource *r = &hwc->inflight_msg_res; in mana_hwc_get_msg_index()
14 down(&hwc->sema); in mana_hwc_get_msg_index()
16 spin_lock_irqsave(&r->lock, flags); in mana_hwc_get_msg_index()
18 index = find_first_zero_bit(hwc->inflight_msg_res.map, in mana_hwc_get_msg_index()
19 hwc->inflight_msg_res.size); in mana_hwc_get_msg_index()
21 bitmap_set(hwc->inflight_msg_res.map, index, 1); in mana_hwc_get_msg_index()
23 spin_unlock_irqrestore(&r->lock, flags); in mana_hwc_get_msg_index()
32 struct gdma_resource *r = &hwc->inflight_msg_res; in mana_hwc_put_msg_index()
35 spin_lock_irqsave(&r->lock, flags); in mana_hwc_put_msg_index()
36 bitmap_clear(hwc->inflight_msg_res.map, msg_id, 1); in mana_hwc_put_msg_index()
37 spin_unlock_irqrestore(&r->lock, flags); in mana_hwc_put_msg_index()
39 up(&hwc->sema); in mana_hwc_put_msg_index()
47 return -EPROTO; in mana_hwc_verify_resp_msg()
49 if (resp_len > caller_ctx->output_buflen) in mana_hwc_verify_resp_msg()
50 return -EPROTO; in mana_hwc_verify_resp_msg()
58 struct device *dev = hwc_rxq->hwc->dev; in mana_hwc_post_rx_wqe()
62 sge = &req->sge; in mana_hwc_post_rx_wqe()
63 sge->address = (u64)req->buf_sge_addr; in mana_hwc_post_rx_wqe()
64 sge->mem_key = hwc_rxq->msg_buf->gpa_mkey; in mana_hwc_post_rx_wqe()
65 sge->size = req->buf_len; in mana_hwc_post_rx_wqe()
67 memset(&req->wqe_req, 0, sizeof(struct gdma_wqe_request)); in mana_hwc_post_rx_wqe()
68 req->wqe_req.sgl = sge; in mana_hwc_post_rx_wqe()
69 req->wqe_req.num_sge = 1; in mana_hwc_post_rx_wqe()
70 req->wqe_req.client_data_unit = 0; in mana_hwc_post_rx_wqe()
72 err = mana_gd_post_and_ring(hwc_rxq->gdma_wq, &req->wqe_req, NULL); in mana_hwc_post_rx_wqe()
81 const struct gdma_resp_hdr *resp_msg = rx_req->buf_va; in mana_hwc_handle_resp()
85 if (!test_bit(resp_msg->response.hwc_msg_id, in mana_hwc_handle_resp()
86 hwc->inflight_msg_res.map)) { in mana_hwc_handle_resp()
87 dev_err(hwc->dev, "hwc_rx: invalid msg_id = %u\n", in mana_hwc_handle_resp()
88 resp_msg->response.hwc_msg_id); in mana_hwc_handle_resp()
89 mana_hwc_post_rx_wqe(hwc->rxq, rx_req); in mana_hwc_handle_resp()
93 ctx = hwc->caller_ctx + resp_msg->response.hwc_msg_id; in mana_hwc_handle_resp()
98 ctx->status_code = resp_msg->status; in mana_hwc_handle_resp()
100 memcpy(ctx->output_buf, resp_msg, resp_len); in mana_hwc_handle_resp()
102 ctx->error = err; in mana_hwc_handle_resp()
104 /* Must post rx wqe before complete(), otherwise the next rx may in mana_hwc_handle_resp()
107 mana_hwc_post_rx_wqe(hwc->rxq, rx_req); in mana_hwc_handle_resp()
109 complete(&ctx->comp_event); in mana_hwc_handle_resp()
116 struct gdma_dev *gd = hwc->gdma_dev; in mana_hwc_init_event_handler()
121 switch (event->type) { in mana_hwc_init_event_handler()
123 eq_db.as_uint32 = event->details[0]; in mana_hwc_init_event_handler()
124 hwc->cq->gdma_eq->id = eq_db.eq_id; in mana_hwc_init_event_handler()
125 gd->doorbell = eq_db.doorbell; in mana_hwc_init_event_handler()
129 type_data.as_uint32 = event->details[0]; in mana_hwc_init_event_handler()
135 hwc->cq->gdma_cq->id = val; in mana_hwc_init_event_handler()
139 hwc->rxq->gdma_wq->id = val; in mana_hwc_init_event_handler()
143 hwc->txq->gdma_wq->id = val; in mana_hwc_init_event_handler()
147 hwc->hwc_init_q_depth_max = (u16)val; in mana_hwc_init_event_handler()
151 hwc->hwc_init_max_req_msg_size = val; in mana_hwc_init_event_handler()
155 hwc->hwc_init_max_resp_msg_size = val; in mana_hwc_init_event_handler()
159 gd->gdma_context->max_num_cqs = val; in mana_hwc_init_event_handler()
163 hwc->gdma_dev->pdid = val; in mana_hwc_init_event_handler()
167 hwc->rxq->msg_buf->gpa_mkey = val; in mana_hwc_init_event_handler()
168 hwc->txq->msg_buf->gpa_mkey = val; in mana_hwc_init_event_handler()
172 hwc->pf_dest_vrq_id = val; in mana_hwc_init_event_handler()
176 hwc->pf_dest_vrcq_id = val; in mana_hwc_init_event_handler()
183 complete(&hwc->hwc_init_eqe_comp); in mana_hwc_init_event_handler()
187 type_data.as_uint32 = event->details[0]; in mana_hwc_init_event_handler()
193 hwc->hwc_timeout = val; in mana_hwc_init_event_handler()
197 dev_warn(hwc->dev, "Received unknown reconfig type %u\n", type); in mana_hwc_init_event_handler()
204 dev_warn(hwc->dev, "Received unknown gdma event %u\n", event->type); in mana_hwc_init_event_handler()
214 struct hwc_wq *hwc_rxq = hwc->rxq; in mana_hwc_rx_event_handler()
224 if (WARN_ON_ONCE(hwc_rxq->gdma_wq->id != gdma_rxq_id)) in mana_hwc_rx_event_handler()
227 rq = hwc_rxq->gdma_wq; in mana_hwc_rx_event_handler()
228 wqe = mana_gd_get_wqe_ptr(rq, rx_oob->wqe_offset / GDMA_WQE_BU_SIZE); in mana_hwc_rx_event_handler()
231 sge = (struct gdma_sge *)(wqe + 8 + dma_oob->inline_oob_size_div4 * 4); in mana_hwc_rx_event_handler()
233 /* Select the RX work request for virtual address and for reposting. */ in mana_hwc_rx_event_handler()
234 rq_base_addr = hwc_rxq->msg_buf->mem_info.dma_handle; in mana_hwc_rx_event_handler()
235 rx_req_idx = (sge->address - rq_base_addr) / hwc->max_req_msg_size; in mana_hwc_rx_event_handler()
237 rx_req = &hwc_rxq->msg_buf->reqs[rx_req_idx]; in mana_hwc_rx_event_handler()
238 resp = (struct gdma_resp_hdr *)rx_req->buf_va; in mana_hwc_rx_event_handler()
240 if (resp->response.hwc_msg_id >= hwc->num_inflight_msg) { in mana_hwc_rx_event_handler()
241 dev_err(hwc->dev, "HWC RX: wrong msg_id=%u\n", in mana_hwc_rx_event_handler()
242 resp->response.hwc_msg_id); in mana_hwc_rx_event_handler()
246 mana_hwc_handle_resp(hwc, rx_oob->tx_oob_data_size, rx_req); in mana_hwc_rx_event_handler()
258 struct hwc_wq *hwc_txq = hwc->txq; in mana_hwc_tx_event_handler()
260 WARN_ON_ONCE(!hwc_txq || hwc_txq->gdma_wq->id != gdma_txq_id); in mana_hwc_tx_event_handler()
270 return -EINVAL; in mana_hwc_create_gdma_wq()
276 return mana_gd_create_hwc_queue(hwc->gdma_dev, &spec, queue); in mana_hwc_create_gdma_wq()
294 return mana_gd_create_hwc_queue(hwc->gdma_dev, &spec, queue); in mana_hwc_create_gdma_cq()
307 spec.eq.context = ctx; in mana_hwc_create_gdma_eq()
308 spec.eq.callback = cb; in mana_hwc_create_gdma_eq()
309 spec.eq.log2_throttle_limit = DEFAULT_LOG2_THROTTLING_FOR_ERROR_EQ; in mana_hwc_create_gdma_eq()
310 spec.eq.msix_index = 0; in mana_hwc_create_gdma_eq()
312 return mana_gd_create_hwc_queue(hwc->gdma_dev, &spec, queue); in mana_hwc_create_gdma_eq()
322 WARN_ON_ONCE(hwc_cq->gdma_cq != q_self); in mana_hwc_comp_event()
324 completions = hwc_cq->comp_buf; in mana_hwc_comp_event()
325 comp_read = mana_gd_poll_cq(q_self, completions, hwc_cq->queue_depth); in mana_hwc_comp_event()
326 WARN_ON_ONCE(comp_read <= 0 || comp_read > hwc_cq->queue_depth); in mana_hwc_comp_event()
332 hwc_cq->tx_event_handler(hwc_cq->tx_event_ctx, in mana_hwc_comp_event()
336 hwc_cq->rx_event_handler(hwc_cq->rx_event_ctx, in mana_hwc_comp_event()
346 kfree(hwc_cq->comp_buf); in mana_hwc_destroy_cq()
348 if (hwc_cq->gdma_cq) in mana_hwc_destroy_cq()
349 mana_gd_destroy_queue(gc, hwc_cq->gdma_cq); in mana_hwc_destroy_cq()
351 if (hwc_cq->gdma_eq) in mana_hwc_destroy_cq()
352 mana_gd_destroy_queue(gc, hwc_cq->gdma_eq); in mana_hwc_destroy_cq()
364 struct gdma_queue *eq, *cq; in mana_hwc_create_cq() local
380 return -ENOMEM; in mana_hwc_create_cq()
382 err = mana_hwc_create_gdma_eq(hwc, eq_size, ctx, callback, &eq); in mana_hwc_create_cq()
384 dev_err(hwc->dev, "Failed to create HWC EQ for RQ: %d\n", err); in mana_hwc_create_cq()
387 hwc_cq->gdma_eq = eq; in mana_hwc_create_cq()
390 eq, &cq); in mana_hwc_create_cq()
392 dev_err(hwc->dev, "Failed to create HWC CQ for RQ: %d\n", err); in mana_hwc_create_cq()
395 hwc_cq->gdma_cq = cq; in mana_hwc_create_cq()
399 err = -ENOMEM; in mana_hwc_create_cq()
403 hwc_cq->hwc = hwc; in mana_hwc_create_cq()
404 hwc_cq->comp_buf = comp_buf; in mana_hwc_create_cq()
405 hwc_cq->queue_depth = q_depth; in mana_hwc_create_cq()
406 hwc_cq->rx_event_handler = rx_ev_hdlr; in mana_hwc_create_cq()
407 hwc_cq->rx_event_ctx = rx_ev_ctx; in mana_hwc_create_cq()
408 hwc_cq->tx_event_handler = tx_ev_hdlr; in mana_hwc_create_cq()
409 hwc_cq->tx_event_ctx = tx_ev_ctx; in mana_hwc_create_cq()
414 mana_hwc_destroy_cq(hwc->gdma_dev->gdma_context, hwc_cq); in mana_hwc_create_cq()
422 struct gdma_context *gc = hwc->gdma_dev->gdma_context; in mana_hwc_alloc_dma_buf()
434 return -ENOMEM; in mana_hwc_alloc_dma_buf()
436 dma_buf->num_reqs = q_depth; in mana_hwc_alloc_dma_buf()
440 gmi = &dma_buf->mem_info; in mana_hwc_alloc_dma_buf()
443 dev_err(hwc->dev, "Failed to allocate DMA buffer: %d\n", err); in mana_hwc_alloc_dma_buf()
447 virt_addr = dma_buf->mem_info.virt_addr; in mana_hwc_alloc_dma_buf()
448 base_pa = (u8 *)dma_buf->mem_info.dma_handle; in mana_hwc_alloc_dma_buf()
451 hwc_wr = &dma_buf->reqs[i]; in mana_hwc_alloc_dma_buf()
453 hwc_wr->buf_va = virt_addr + i * max_msg_size; in mana_hwc_alloc_dma_buf()
454 hwc_wr->buf_sge_addr = base_pa + i * max_msg_size; in mana_hwc_alloc_dma_buf()
456 hwc_wr->buf_len = max_msg_size; in mana_hwc_alloc_dma_buf()
472 mana_gd_free_memory(&dma_buf->mem_info); in mana_hwc_dealloc_dma_buf()
480 mana_hwc_dealloc_dma_buf(hwc, hwc_wq->msg_buf); in mana_hwc_destroy_wq()
482 if (hwc_wq->gdma_wq) in mana_hwc_destroy_wq()
483 mana_gd_destroy_queue(hwc->gdma_dev->gdma_context, in mana_hwc_destroy_wq()
484 hwc_wq->gdma_wq); in mana_hwc_destroy_wq()
511 return -ENOMEM; in mana_hwc_create_wq()
517 hwc_wq->hwc = hwc; in mana_hwc_create_wq()
518 hwc_wq->gdma_wq = queue; in mana_hwc_create_wq()
519 hwc_wq->queue_depth = q_depth; in mana_hwc_create_wq()
520 hwc_wq->hwc_cq = hwc_cq; in mana_hwc_create_wq()
523 &hwc_wq->msg_buf); in mana_hwc_create_wq()
540 struct device *dev = hwc_txq->hwc->dev; in mana_hwc_post_tx_wqe()
545 if (req->msg_size == 0 || req->msg_size > req->buf_len) { in mana_hwc_post_tx_wqe()
547 req->msg_size, req->buf_len); in mana_hwc_post_tx_wqe()
548 return -EINVAL; in mana_hwc_post_tx_wqe()
551 tx_oob = &req->tx_oob; in mana_hwc_post_tx_wqe()
553 tx_oob->vrq_id = dest_virt_rq_id; in mana_hwc_post_tx_wqe()
554 tx_oob->dest_vfid = 0; in mana_hwc_post_tx_wqe()
555 tx_oob->vrcq_id = dest_virt_rcq_id; in mana_hwc_post_tx_wqe()
556 tx_oob->vscq_id = hwc_txq->hwc_cq->gdma_cq->id; in mana_hwc_post_tx_wqe()
557 tx_oob->loopback = false; in mana_hwc_post_tx_wqe()
558 tx_oob->lso_override = false; in mana_hwc_post_tx_wqe()
559 tx_oob->dest_pf = dest_pf; in mana_hwc_post_tx_wqe()
560 tx_oob->vsq_id = hwc_txq->gdma_wq->id; in mana_hwc_post_tx_wqe()
562 sge = &req->sge; in mana_hwc_post_tx_wqe()
563 sge->address = (u64)req->buf_sge_addr; in mana_hwc_post_tx_wqe()
564 sge->mem_key = hwc_txq->msg_buf->gpa_mkey; in mana_hwc_post_tx_wqe()
565 sge->size = req->msg_size; in mana_hwc_post_tx_wqe()
567 memset(&req->wqe_req, 0, sizeof(struct gdma_wqe_request)); in mana_hwc_post_tx_wqe()
568 req->wqe_req.sgl = sge; in mana_hwc_post_tx_wqe()
569 req->wqe_req.num_sge = 1; in mana_hwc_post_tx_wqe()
570 req->wqe_req.inline_oob_size = sizeof(struct hwc_tx_oob); in mana_hwc_post_tx_wqe()
571 req->wqe_req.inline_oob_data = tx_oob; in mana_hwc_post_tx_wqe()
572 req->wqe_req.client_data_unit = 0; in mana_hwc_post_tx_wqe()
574 err = mana_gd_post_and_ring(hwc_txq->gdma_wq, &req->wqe_req, NULL); in mana_hwc_post_tx_wqe()
585 sema_init(&hwc->sema, num_msg); in mana_hwc_init_inflight_msg()
587 err = mana_gd_alloc_res_map(num_msg, &hwc->inflight_msg_res); in mana_hwc_init_inflight_msg()
589 dev_err(hwc->dev, "Failed to init inflight_msg_res: %d\n", err); in mana_hwc_init_inflight_msg()
596 struct gdma_context *gc = hwc->gdma_dev->gdma_context; in mana_hwc_test_channel()
597 struct hwc_wq *hwc_rxq = hwc->rxq; in mana_hwc_test_channel()
605 req = &hwc_rxq->msg_buf->reqs[i]; in mana_hwc_test_channel()
613 return -ENOMEM; in mana_hwc_test_channel()
618 hwc->caller_ctx = ctx; in mana_hwc_test_channel()
620 return mana_gd_test_eq(gc, hwc->cq->gdma_eq); in mana_hwc_test_channel()
627 struct hw_channel_context *hwc = gc->hwc.driver_data; in mana_hwc_establish_channel()
628 struct gdma_queue *rq = hwc->rxq->gdma_wq; in mana_hwc_establish_channel()
629 struct gdma_queue *sq = hwc->txq->gdma_wq; in mana_hwc_establish_channel()
630 struct gdma_queue *eq = hwc->cq->gdma_eq; in mana_hwc_establish_channel() local
631 struct gdma_queue *cq = hwc->cq->gdma_cq; in mana_hwc_establish_channel()
634 init_completion(&hwc->hwc_init_eqe_comp); in mana_hwc_establish_channel()
636 err = mana_smc_setup_hwc(&gc->shm_channel, false, in mana_hwc_establish_channel()
637 eq->mem_info.dma_handle, in mana_hwc_establish_channel()
638 cq->mem_info.dma_handle, in mana_hwc_establish_channel()
639 rq->mem_info.dma_handle, in mana_hwc_establish_channel()
640 sq->mem_info.dma_handle, in mana_hwc_establish_channel()
641 eq->eq.msix_index); in mana_hwc_establish_channel()
645 if (!wait_for_completion_timeout(&hwc->hwc_init_eqe_comp, 60 * HZ)) in mana_hwc_establish_channel()
646 return -ETIMEDOUT; in mana_hwc_establish_channel()
648 *q_depth = hwc->hwc_init_q_depth_max; in mana_hwc_establish_channel()
649 *max_req_msg_size = hwc->hwc_init_max_req_msg_size; in mana_hwc_establish_channel()
650 *max_resp_msg_size = hwc->hwc_init_max_resp_msg_size; in mana_hwc_establish_channel()
653 if (WARN_ON(cq->id >= gc->max_num_cqs)) in mana_hwc_establish_channel()
654 return -EPROTO; in mana_hwc_establish_channel()
656 gc->cq_table = vcalloc(gc->max_num_cqs, sizeof(struct gdma_queue *)); in mana_hwc_establish_channel()
657 if (!gc->cq_table) in mana_hwc_establish_channel()
658 return -ENOMEM; in mana_hwc_establish_channel()
660 gc->cq_table[cq->id] = cq; in mana_hwc_establish_channel()
680 mana_hwc_tx_event_handler, hwc, &hwc->cq); in mana_hwc_init_queues()
682 dev_err(hwc->dev, "Failed to create HWC CQ: %d\n", err); in mana_hwc_init_queues()
687 hwc->cq, &hwc->rxq); in mana_hwc_init_queues()
689 dev_err(hwc->dev, "Failed to create HWC RQ: %d\n", err); in mana_hwc_init_queues()
694 hwc->cq, &hwc->txq); in mana_hwc_init_queues()
696 dev_err(hwc->dev, "Failed to create HWC SQ: %d\n", err); in mana_hwc_init_queues()
700 hwc->num_inflight_msg = q_depth; in mana_hwc_init_queues()
701 hwc->max_req_msg_size = max_req_msg_size; in mana_hwc_init_queues()
712 struct gdma_dev *gd = &gc->hwc; in mana_hwc_create_channel()
719 return -ENOMEM; in mana_hwc_create_channel()
721 gd->gdma_context = gc; in mana_hwc_create_channel()
722 gd->driver_data = hwc; in mana_hwc_create_channel()
723 hwc->gdma_dev = gd; in mana_hwc_create_channel()
724 hwc->dev = gc->dev; in mana_hwc_create_channel()
725 hwc->hwc_timeout = HW_CHANNEL_WAIT_RESOURCE_TIMEOUT_MS; in mana_hwc_create_channel()
728 gd->dev_id.as_uint32 = 0; in mana_hwc_create_channel()
729 gd->dev_id.type = GDMA_DEVICE_HWC; in mana_hwc_create_channel()
731 gd->pdid = INVALID_PDID; in mana_hwc_create_channel()
732 gd->doorbell = INVALID_DOORBELL; in mana_hwc_create_channel()
741 dev_err(hwc->dev, "Failed to initialize HWC: %d\n", err); in mana_hwc_create_channel()
748 dev_err(hwc->dev, "Failed to establish HWC: %d\n", err); in mana_hwc_create_channel()
752 err = mana_hwc_test_channel(gc->hwc.driver_data, in mana_hwc_create_channel()
756 dev_err(hwc->dev, "Failed to test HWC: %d\n", err); in mana_hwc_create_channel()
768 struct hw_channel_context *hwc = gc->hwc.driver_data; in mana_hwc_destroy_channel()
773 /* gc->max_num_cqs is set in mana_hwc_init_event_handler(). If it's in mana_hwc_destroy_channel()
774 * non-zero, the HWC worked and we should tear down the HWC here. in mana_hwc_destroy_channel()
776 if (gc->max_num_cqs > 0) { in mana_hwc_destroy_channel()
777 mana_smc_teardown_hwc(&gc->shm_channel, false); in mana_hwc_destroy_channel()
778 gc->max_num_cqs = 0; in mana_hwc_destroy_channel()
781 kfree(hwc->caller_ctx); in mana_hwc_destroy_channel()
782 hwc->caller_ctx = NULL; in mana_hwc_destroy_channel()
784 if (hwc->txq) in mana_hwc_destroy_channel()
785 mana_hwc_destroy_wq(hwc, hwc->txq); in mana_hwc_destroy_channel()
787 if (hwc->rxq) in mana_hwc_destroy_channel()
788 mana_hwc_destroy_wq(hwc, hwc->rxq); in mana_hwc_destroy_channel()
790 if (hwc->cq) in mana_hwc_destroy_channel()
791 mana_hwc_destroy_cq(hwc->gdma_dev->gdma_context, hwc->cq); in mana_hwc_destroy_channel()
793 mana_gd_free_res_map(&hwc->inflight_msg_res); in mana_hwc_destroy_channel()
795 hwc->num_inflight_msg = 0; in mana_hwc_destroy_channel()
797 hwc->gdma_dev->doorbell = INVALID_DOORBELL; in mana_hwc_destroy_channel()
798 hwc->gdma_dev->pdid = INVALID_PDID; in mana_hwc_destroy_channel()
800 hwc->hwc_timeout = 0; in mana_hwc_destroy_channel()
803 gc->hwc.driver_data = NULL; in mana_hwc_destroy_channel()
804 gc->hwc.gdma_context = NULL; in mana_hwc_destroy_channel()
806 vfree(gc->cq_table); in mana_hwc_destroy_channel()
807 gc->cq_table = NULL; in mana_hwc_destroy_channel()
813 struct gdma_context *gc = hwc->gdma_dev->gdma_context; in mana_hwc_send_request()
815 struct hwc_wq *txq = hwc->txq; in mana_hwc_send_request()
825 tx_wr = &txq->msg_buf->reqs[msg_id]; in mana_hwc_send_request()
827 if (req_len > tx_wr->buf_len) { in mana_hwc_send_request()
828 dev_err(hwc->dev, "HWC: req msg size: %d > %d\n", req_len, in mana_hwc_send_request()
829 tx_wr->buf_len); in mana_hwc_send_request()
830 err = -EINVAL; in mana_hwc_send_request()
834 ctx = hwc->caller_ctx + msg_id; in mana_hwc_send_request()
835 ctx->output_buf = resp; in mana_hwc_send_request()
836 ctx->output_buflen = resp_len; in mana_hwc_send_request()
838 req_msg = (struct gdma_req_hdr *)tx_wr->buf_va; in mana_hwc_send_request()
842 req_msg->req.hwc_msg_id = msg_id; in mana_hwc_send_request()
844 tx_wr->msg_size = req_len; in mana_hwc_send_request()
846 if (gc->is_pf) { in mana_hwc_send_request()
847 dest_vrq = hwc->pf_dest_vrq_id; in mana_hwc_send_request()
848 dest_vrcq = hwc->pf_dest_vrcq_id; in mana_hwc_send_request()
853 dev_err(hwc->dev, "HWC: Failed to post send WQE: %d\n", err); in mana_hwc_send_request()
857 if (!wait_for_completion_timeout(&ctx->comp_event, in mana_hwc_send_request()
858 (msecs_to_jiffies(hwc->hwc_timeout)))) { in mana_hwc_send_request()
859 dev_err(hwc->dev, "HWC: Request timed out!\n"); in mana_hwc_send_request()
860 err = -ETIMEDOUT; in mana_hwc_send_request()
864 if (ctx->error) { in mana_hwc_send_request()
865 err = ctx->error; in mana_hwc_send_request()
869 if (ctx->status_code && ctx->status_code != GDMA_STATUS_MORE_ENTRIES) { in mana_hwc_send_request()
870 dev_err(hwc->dev, "HWC: Failed hw_channel req: 0x%x\n", in mana_hwc_send_request()
871 ctx->status_code); in mana_hwc_send_request()
872 err = -EPROTO; in mana_hwc_send_request()