Lines Matching refs:qidev

99 int caam_qi_enqueue(struct device *qidev, struct caam_drv_req *req)  in caam_qi_enqueue()  argument
109 addr = dma_map_single(qidev, req->fd_sgt, sizeof(req->fd_sgt), in caam_qi_enqueue()
111 if (dma_mapping_error(qidev, addr)) { in caam_qi_enqueue()
112 dev_err(qidev, "DMA mapping error for QI enqueue request\n"); in caam_qi_enqueue()
129 dev_err(qidev, "qman_enqueue failed: %d\n", ret); in caam_qi_enqueue()
140 struct device *qidev = &(raw_cpu_ptr(&pcpu_qipriv)->net_dev.dev); in caam_fq_ern_cb() local
141 struct caam_drv_private *priv = dev_get_drvdata(qidev); in caam_fq_ern_cb()
147 dev_err(qidev, in caam_fq_ern_cb()
155 dev_err(qidev, "Non-compound FD from CAAM\n"); in caam_fq_ern_cb()
159 dma_unmap_single(drv_req->drv_ctx->qidev, qm_fd_addr(fd), in caam_fq_ern_cb()
168 static struct qman_fq *create_caam_req_fq(struct device *qidev, in create_caam_req_fq() argument
187 dev_err(qidev, "Failed to create session req FQ\n"); in create_caam_req_fq()
203 dev_err(qidev, "Failed to init session req FQ\n"); in create_caam_req_fq()
207 dev_dbg(qidev, "Allocated request FQ %u for CPU %u\n", req_fq->fqid, in create_caam_req_fq()
218 static int empty_retired_fq(struct device *qidev, struct qman_fq *fq) in empty_retired_fq() argument
227 dev_err(qidev, "Volatile dequeue fail for FQ: %u\n", fq->fqid); in empty_retired_fq()
241 static int kill_fq(struct device *qidev, struct qman_fq *fq) in kill_fq() argument
248 dev_err(qidev, "qman_retire_fq failed: %d\n", ret); in kill_fq()
268 ret = empty_retired_fq(qidev, fq); in kill_fq()
270 dev_err(qidev, "empty_retired_fq fail for FQ: %u\n", in kill_fq()
278 dev_err(qidev, "OOS of FQID: %u failed\n", fq->fqid); in kill_fq()
313 dev_warn_once(drv_ctx->qidev, "%d frames from FQID %u still pending in CAAM\n", in empty_caam_fq()
324 struct device *qidev = drv_ctx->qidev; in caam_drv_ctx_update() local
328 dev_err(qidev, "Invalid descriptor len: %d words\n", num_words); in caam_drv_ctx_update()
336 new_fq = create_caam_req_fq(drv_ctx->qidev, drv_ctx->rsp_fq, in caam_drv_ctx_update()
339 dev_err(qidev, "FQ allocation for shdesc update failed\n"); in caam_drv_ctx_update()
349 dev_err(qidev, "Old CAAM FQ empty failed: %d\n", ret); in caam_drv_ctx_update()
354 if (kill_fq(qidev, new_fq)) in caam_drv_ctx_update()
355 dev_warn(qidev, "New CAAM FQ kill failed\n"); in caam_drv_ctx_update()
368 dma_sync_single_for_device(qidev, drv_ctx->context_a, in caam_drv_ctx_update()
376 dev_err(qidev, "Fail to sched new CAAM FQ, ecode = %d\n", ret); in caam_drv_ctx_update()
385 if (kill_fq(qidev, new_fq)) in caam_drv_ctx_update()
386 dev_warn(qidev, "New CAAM FQ kill failed\n"); in caam_drv_ctx_update()
387 } else if (kill_fq(qidev, old_fq)) { in caam_drv_ctx_update()
388 dev_warn(qidev, "Old CAAM FQ kill failed\n"); in caam_drv_ctx_update()
395 struct caam_drv_ctx *caam_drv_ctx_init(struct device *qidev, in caam_drv_ctx_init() argument
407 dev_err(qidev, "Invalid descriptor len: %d words\n", in caam_drv_ctx_init()
425 hwdesc = dma_map_single(qidev, drv_ctx->prehdr, size, in caam_drv_ctx_init()
427 if (dma_mapping_error(qidev, hwdesc)) { in caam_drv_ctx_init()
428 dev_err(qidev, "DMA map error for preheader + shdesc\n"); in caam_drv_ctx_init()
451 drv_ctx->req_fq = create_caam_req_fq(qidev, drv_ctx->rsp_fq, hwdesc, in caam_drv_ctx_init()
454 dev_err(qidev, "create_caam_req_fq failed\n"); in caam_drv_ctx_init()
455 dma_unmap_single(qidev, hwdesc, size, DMA_BIDIRECTIONAL); in caam_drv_ctx_init()
463 drv_ctx->qidev = qidev; in caam_drv_ctx_init()
500 if (kill_fq(drv_ctx->qidev, drv_ctx->req_fq)) in caam_drv_ctx_rel()
501 dev_err(drv_ctx->qidev, "Crypto session req FQ kill failed\n"); in caam_drv_ctx_rel()
503 dma_unmap_single(drv_ctx->qidev, drv_ctx->context_a, in caam_drv_ctx_rel()
513 struct device *qidev = data; in caam_qi_shutdown() local
524 if (kill_fq(qidev, per_cpu(pcpu_qipriv.rsp_fq, i))) in caam_qi_shutdown()
525 dev_err(qidev, "Rsp FQ kill failed, cpu: %d\n", i); in caam_qi_shutdown()
569 struct device *qidev = &(raw_cpu_ptr(&pcpu_qipriv)->net_dev.dev); in caam_rsp_fq_dqrr_cb() local
570 struct caam_drv_private *priv = dev_get_drvdata(qidev); in caam_rsp_fq_dqrr_cb()
580 dev_err(qidev, in caam_rsp_fq_dqrr_cb()
594 dev_err_ratelimited(qidev, in caam_rsp_fq_dqrr_cb()
600 dev_err(qidev, "Non-compound FD from CAAM\n"); in caam_rsp_fq_dqrr_cb()
604 dma_unmap_single(drv_req->drv_ctx->qidev, qm_fd_addr(fd), in caam_rsp_fq_dqrr_cb()
611 static int alloc_rsp_fq_cpu(struct device *qidev, unsigned int cpu) in alloc_rsp_fq_cpu() argument
626 dev_err(qidev, "Rsp FQ create failed\n"); in alloc_rsp_fq_cpu()
645 dev_err(qidev, "Rsp FQ init failed\n"); in alloc_rsp_fq_cpu()
652 dev_dbg(qidev, "Allocated response FQ %u for CPU %u", fq->fqid, cpu); in alloc_rsp_fq_cpu()
656 static int init_cgr(struct device *qidev) in init_cgr() argument
665 dev_err(qidev, "CGR alloc failed for rsp FQs: %d\n", ret); in init_cgr()
679 dev_err(qidev, "Error %d creating CAAM CGRID: %u\n", ret, in init_cgr()
684 dev_dbg(qidev, "Congestion threshold set to %llu\n", val); in init_cgr()
688 static int alloc_rsp_fqs(struct device *qidev) in alloc_rsp_fqs() argument
695 ret = alloc_rsp_fq_cpu(qidev, i); in alloc_rsp_fqs()
697 dev_err(qidev, "CAAM rsp FQ alloc failed, cpu: %u", i); in alloc_rsp_fqs()
717 struct device *ctrldev = &caam_pdev->dev, *qidev; in caam_qi_init() local
722 qidev = ctrldev; in caam_qi_init()
725 err = init_cgr(qidev); in caam_qi_init()
727 dev_err(qidev, "CGR initialization failed: %d\n", err); in caam_qi_init()
732 err = alloc_rsp_fqs(qidev); in caam_qi_init()
734 dev_err(qidev, "Can't allocate CAAM response FQs: %d\n", err); in caam_qi_init()
749 net_dev->dev = *qidev; in caam_qi_init()
761 dev_err(qidev, "Can't allocate CAAM cache\n"); in caam_qi_init()
768 err = devm_add_action_or_reset(qidev, caam_qi_shutdown, ctrlpriv); in caam_qi_init()
772 dev_info(qidev, "Linux CAAM Queue I/F driver initialised\n"); in caam_qi_init()