Lines Matching refs:qidev
106 int caam_qi_enqueue(struct device *qidev, struct caam_drv_req *req) in caam_qi_enqueue() argument
116 addr = dma_map_single(qidev, req->fd_sgt, sizeof(req->fd_sgt), in caam_qi_enqueue()
118 if (dma_mapping_error(qidev, addr)) { in caam_qi_enqueue()
119 dev_err(qidev, "DMA mapping error for QI enqueue request\n"); in caam_qi_enqueue()
136 dev_err(qidev, "qman_enqueue failed: %d\n", ret); in caam_qi_enqueue()
147 struct device *qidev = &(raw_cpu_ptr(&pcpu_qipriv)->net_dev->dev); in caam_fq_ern_cb() local
148 struct caam_drv_private *priv = dev_get_drvdata(qidev); in caam_fq_ern_cb()
154 dev_err(qidev, in caam_fq_ern_cb()
162 dev_err(qidev, "Non-compound FD from CAAM\n"); in caam_fq_ern_cb()
166 dma_unmap_single(drv_req->drv_ctx->qidev, qm_fd_addr(fd), in caam_fq_ern_cb()
175 static struct qman_fq *create_caam_req_fq(struct device *qidev, in create_caam_req_fq() argument
194 dev_err(qidev, "Failed to create session req FQ\n"); in create_caam_req_fq()
210 dev_err(qidev, "Failed to init session req FQ\n"); in create_caam_req_fq()
214 dev_dbg(qidev, "Allocated request FQ %u for CPU %u\n", req_fq->fqid, in create_caam_req_fq()
225 static int empty_retired_fq(struct device *qidev, struct qman_fq *fq) in empty_retired_fq() argument
234 dev_err(qidev, "Volatile dequeue fail for FQ: %u\n", fq->fqid); in empty_retired_fq()
248 static int kill_fq(struct device *qidev, struct qman_fq *fq) in kill_fq() argument
255 dev_err(qidev, "qman_retire_fq failed: %d\n", ret); in kill_fq()
275 ret = empty_retired_fq(qidev, fq); in kill_fq()
277 dev_err(qidev, "empty_retired_fq fail for FQ: %u\n", in kill_fq()
285 dev_err(qidev, "OOS of FQID: %u failed\n", fq->fqid); in kill_fq()
320 dev_warn_once(drv_ctx->qidev, "%d frames from FQID %u still pending in CAAM\n", in empty_caam_fq()
331 struct device *qidev = drv_ctx->qidev; in caam_drv_ctx_update() local
335 dev_err(qidev, "Invalid descriptor len: %d words\n", num_words); in caam_drv_ctx_update()
343 new_fq = create_caam_req_fq(drv_ctx->qidev, drv_ctx->rsp_fq, in caam_drv_ctx_update()
346 dev_err(qidev, "FQ allocation for shdesc update failed\n"); in caam_drv_ctx_update()
356 dev_err(qidev, "Old CAAM FQ empty failed: %d\n", ret); in caam_drv_ctx_update()
361 if (kill_fq(qidev, new_fq)) in caam_drv_ctx_update()
362 dev_warn(qidev, "New CAAM FQ kill failed\n"); in caam_drv_ctx_update()
375 dma_sync_single_for_device(qidev, drv_ctx->context_a, in caam_drv_ctx_update()
383 dev_err(qidev, "Fail to sched new CAAM FQ, ecode = %d\n", ret); in caam_drv_ctx_update()
392 if (kill_fq(qidev, new_fq)) in caam_drv_ctx_update()
393 dev_warn(qidev, "New CAAM FQ kill failed\n"); in caam_drv_ctx_update()
394 } else if (kill_fq(qidev, old_fq)) { in caam_drv_ctx_update()
395 dev_warn(qidev, "Old CAAM FQ kill failed\n"); in caam_drv_ctx_update()
402 struct caam_drv_ctx *caam_drv_ctx_init(struct device *qidev, in caam_drv_ctx_init() argument
414 dev_err(qidev, "Invalid descriptor len: %d words\n", in caam_drv_ctx_init()
432 hwdesc = dma_map_single(qidev, drv_ctx->prehdr, size, in caam_drv_ctx_init()
434 if (dma_mapping_error(qidev, hwdesc)) { in caam_drv_ctx_init()
435 dev_err(qidev, "DMA map error for preheader + shdesc\n"); in caam_drv_ctx_init()
458 drv_ctx->req_fq = create_caam_req_fq(qidev, drv_ctx->rsp_fq, hwdesc, in caam_drv_ctx_init()
461 dev_err(qidev, "create_caam_req_fq failed\n"); in caam_drv_ctx_init()
462 dma_unmap_single(qidev, hwdesc, size, DMA_BIDIRECTIONAL); in caam_drv_ctx_init()
470 drv_ctx->qidev = qidev; in caam_drv_ctx_init()
507 if (kill_fq(drv_ctx->qidev, drv_ctx->req_fq)) in caam_drv_ctx_rel()
508 dev_err(drv_ctx->qidev, "Crypto session req FQ kill failed\n"); in caam_drv_ctx_rel()
510 dma_unmap_single(drv_ctx->qidev, drv_ctx->context_a, in caam_drv_ctx_rel()
520 struct device *qidev = data; in caam_qi_shutdown() local
531 if (kill_fq(qidev, per_cpu(pcpu_qipriv.rsp_fq, i))) in caam_qi_shutdown()
532 dev_err(qidev, "Rsp FQ kill failed, cpu: %d\n", i); in caam_qi_shutdown()
577 struct device *qidev = &(raw_cpu_ptr(&pcpu_qipriv)->net_dev->dev); in caam_rsp_fq_dqrr_cb() local
578 struct caam_drv_private *priv = dev_get_drvdata(qidev); in caam_rsp_fq_dqrr_cb()
588 dev_err(qidev, in caam_rsp_fq_dqrr_cb()
602 dev_err_ratelimited(qidev, in caam_rsp_fq_dqrr_cb()
608 dev_err(qidev, "Non-compound FD from CAAM\n"); in caam_rsp_fq_dqrr_cb()
612 dma_unmap_single(drv_req->drv_ctx->qidev, qm_fd_addr(fd), in caam_rsp_fq_dqrr_cb()
619 static int alloc_rsp_fq_cpu(struct device *qidev, unsigned int cpu) in alloc_rsp_fq_cpu() argument
634 dev_err(qidev, "Rsp FQ create failed\n"); in alloc_rsp_fq_cpu()
653 dev_err(qidev, "Rsp FQ init failed\n"); in alloc_rsp_fq_cpu()
660 dev_dbg(qidev, "Allocated response FQ %u for CPU %u", fq->fqid, cpu); in alloc_rsp_fq_cpu()
664 static int init_cgr(struct device *qidev) in init_cgr() argument
673 dev_err(qidev, "CGR alloc failed for rsp FQs: %d\n", ret); in init_cgr()
687 dev_err(qidev, "Error %d creating CAAM CGRID: %u\n", ret, in init_cgr()
692 dev_dbg(qidev, "Congestion threshold set to %llu\n", val); in init_cgr()
696 static int alloc_rsp_fqs(struct device *qidev) in alloc_rsp_fqs() argument
703 ret = alloc_rsp_fq_cpu(qidev, i); in alloc_rsp_fqs()
705 dev_err(qidev, "CAAM rsp FQ alloc failed, cpu: %u", i); in alloc_rsp_fqs()
736 struct device *ctrldev = &caam_pdev->dev, *qidev; in caam_qi_init() local
746 qidev = ctrldev; in caam_qi_init()
749 err = init_cgr(qidev); in caam_qi_init()
751 dev_err(qidev, "CGR initialization failed: %d\n", err); in caam_qi_init()
756 err = alloc_rsp_fqs(qidev); in caam_qi_init()
758 dev_err(qidev, "Can't allocate CAAM response FQs: %d\n", err); in caam_qi_init()
779 net_dev->dev = *qidev; in caam_qi_init()
790 dev_err(qidev, "Can't allocate CAAM cache\n"); in caam_qi_init()
797 err = devm_add_action_or_reset(qidev, caam_qi_shutdown, ctrlpriv); in caam_qi_init()
801 dev_info(qidev, "Linux CAAM Queue I/F driver initialised\n"); in caam_qi_init()