Lines Matching refs:lf

11 static void cptlf_do_set_done_time_wait(struct otx2_cptlf_info *lf,  in cptlf_do_set_done_time_wait()  argument
16 done_wait.u = otx2_cpt_read64(lf->lfs->reg_base, BLKADDR_CPT0, lf->slot, in cptlf_do_set_done_time_wait()
19 otx2_cpt_write64(lf->lfs->reg_base, BLKADDR_CPT0, lf->slot, in cptlf_do_set_done_time_wait()
23 static void cptlf_do_set_done_num_wait(struct otx2_cptlf_info *lf, int num_wait) in cptlf_do_set_done_num_wait() argument
27 done_wait.u = otx2_cpt_read64(lf->lfs->reg_base, BLKADDR_CPT0, lf->slot, in cptlf_do_set_done_num_wait()
30 otx2_cpt_write64(lf->lfs->reg_base, BLKADDR_CPT0, lf->slot, in cptlf_do_set_done_num_wait()
40 cptlf_do_set_done_time_wait(&lfs->lf[slot], time_wait); in cptlf_set_done_time_wait()
48 cptlf_do_set_done_num_wait(&lfs->lf[slot], num_wait); in cptlf_set_done_num_wait()
51 static int cptlf_set_pri(struct otx2_cptlf_info *lf, int pri) in cptlf_set_pri() argument
53 struct otx2_cptlfs_info *lfs = lf->lfs; in cptlf_set_pri()
58 CPT_AF_LFX_CTL(lf->slot), in cptlf_set_pri()
66 CPT_AF_LFX_CTL(lf->slot), in cptlf_set_pri()
71 static int cptlf_set_eng_grps_mask(struct otx2_cptlf_info *lf, in cptlf_set_eng_grps_mask() argument
74 struct otx2_cptlfs_info *lfs = lf->lfs; in cptlf_set_eng_grps_mask()
79 CPT_AF_LFX_CTL(lf->slot), in cptlf_set_eng_grps_mask()
87 CPT_AF_LFX_CTL(lf->slot), in cptlf_set_eng_grps_mask()
98 ret = cptlf_set_pri(&lfs->lf[slot], pri); in cptlf_set_grp_and_pri()
102 ret = cptlf_set_eng_grps_mask(&lfs->lf[slot], eng_grp_mask); in cptlf_set_grp_and_pri()
176 static inline int cptlf_read_done_cnt(struct otx2_cptlf_info *lf) in cptlf_read_done_cnt() argument
180 irq_cnt.u = otx2_cpt_read64(lf->lfs->reg_base, BLKADDR_CPT0, lf->slot, in cptlf_read_done_cnt()
188 struct otx2_cptlf_info *lf = arg; in cptlf_misc_intr_handler() local
191 dev = &lf->lfs->pdev->dev; in cptlf_misc_intr_handler()
192 irq_misc.u = otx2_cpt_read64(lf->lfs->reg_base, BLKADDR_CPT0, lf->slot, in cptlf_misc_intr_handler()
198 lf->slot); in cptlf_misc_intr_handler()
203 lf->slot); in cptlf_misc_intr_handler()
208 lf->slot); in cptlf_misc_intr_handler()
220 dev_err(dev, "Unhandled interrupt in CPT LF %d\n", lf->slot); in cptlf_misc_intr_handler()
225 otx2_cpt_write64(lf->lfs->reg_base, BLKADDR_CPT0, lf->slot, in cptlf_misc_intr_handler()
234 struct otx2_cptlf_info *lf = arg; in cptlf_done_intr_handler() local
238 irq_cnt = cptlf_read_done_cnt(lf); in cptlf_done_intr_handler()
240 done_wait.u = otx2_cpt_read64(lf->lfs->reg_base, BLKADDR_CPT0, in cptlf_done_intr_handler()
241 lf->slot, OTX2_CPT_LF_DONE_WAIT); in cptlf_done_intr_handler()
243 otx2_cpt_write64(lf->lfs->reg_base, BLKADDR_CPT0, lf->slot, in cptlf_done_intr_handler()
246 otx2_cpt_write64(lf->lfs->reg_base, BLKADDR_CPT0, lf->slot, in cptlf_done_intr_handler()
248 if (unlikely(!lf->wqe)) { in cptlf_done_intr_handler()
249 dev_err(&lf->lfs->pdev->dev, "No work for LF %d\n", in cptlf_done_intr_handler()
250 lf->slot); in cptlf_done_intr_handler()
255 tasklet_hi_schedule(&lf->wqe->work); in cptlf_done_intr_handler()
266 if (!lfs->lf[i].is_irq_reg[offs]) in otx2_cptlf_unregister_interrupts()
270 lfs->lf[i].msix_offset + offs); in otx2_cptlf_unregister_interrupts()
271 free_irq(vector, &lfs->lf[i]); in otx2_cptlf_unregister_interrupts()
272 lfs->lf[i].is_irq_reg[offs] = false; in otx2_cptlf_unregister_interrupts()
284 vector = pci_irq_vector(lfs->pdev, lfs->lf[lf_num].msix_offset + in cptlf_do_register_interrrupts()
287 lfs->lf[lf_num].irq_name[irq_offset], in cptlf_do_register_interrrupts()
288 &lfs->lf[lf_num]); in cptlf_do_register_interrrupts()
292 lfs->lf[lf_num].is_irq_reg[irq_offset] = true; in cptlf_do_register_interrrupts()
303 snprintf(lfs->lf[i].irq_name[irq_offs], 32, "CPTLF Misc%d", i); in otx2_cptlf_register_interrupts()
310 snprintf(lfs->lf[i].irq_name[irq_offs], 32, "OTX2_CPTLF Done%d", in otx2_cptlf_register_interrupts()
332 lfs->lf[slot].msix_offset + in otx2_cptlf_free_irqs_affinity()
334 free_cpumask_var(lfs->lf[slot].affinity_mask); in otx2_cptlf_free_irqs_affinity()
340 struct otx2_cptlf_info *lf = lfs->lf; in otx2_cptlf_set_irqs_affinity() local
344 if (!zalloc_cpumask_var(&lf[slot].affinity_mask, GFP_KERNEL)) { in otx2_cptlf_set_irqs_affinity()
353 lf[slot].affinity_mask); in otx2_cptlf_set_irqs_affinity()
357 lf[slot].msix_offset + offs), in otx2_cptlf_set_irqs_affinity()
358 lf[slot].affinity_mask); in otx2_cptlf_set_irqs_affinity()
380 lfs->lf[slot].lfs = lfs; in otx2_cptlf_init()
381 lfs->lf[slot].slot = slot; in otx2_cptlf_init()
383 lfs->lf[slot].lmtline = lfs->lmt_base + in otx2_cptlf_init()
386 lfs->lf[slot].lmtline = lfs->reg_base + in otx2_cptlf_init()
390 lfs->lf[slot].ioreg = lfs->reg_base + in otx2_cptlf_init()