Lines Matching refs:eng_grps

91 static int dev_supports_eng_type(struct otx_cpt_eng_grps *eng_grps,  in dev_supports_eng_type()  argument
94 return is_eng_type(eng_grps->eng_types_supported, eng_type); in dev_supports_eng_type()
599 struct otx_cpt_eng_grps *eng_grps) in print_dbg_info() argument
611 eng_grps->avail.max_se_cnt, eng_grps->avail.max_ae_cnt); in print_dbg_info()
612 pr_debug("free SE %d\n", eng_grps->avail.se_cnt); in print_dbg_info()
613 pr_debug("free AE %d\n", eng_grps->avail.ae_cnt); in print_dbg_info()
616 grp = &eng_grps->grp[i]; in print_dbg_info()
620 mirrored_grp = &eng_grps->grp[grp->mirror.idx]; in print_dbg_info()
637 eng_grps->engs_num); in print_dbg_info()
1037 struct otx_cpt_eng_grps *eng_grps = grp->g; in find_mirrored_eng_grp() local
1041 if (!eng_grps->grp[i].is_enabled) in find_mirrored_eng_grp()
1043 if (eng_grps->grp[i].ucode[0].type) in find_mirrored_eng_grp()
1047 if (!strncasecmp(eng_grps->grp[i].ucode[0].ver_str, in find_mirrored_eng_grp()
1050 return &eng_grps->grp[i]; in find_mirrored_eng_grp()
1057 struct otx_cpt_eng_grps *eng_grps) in find_unused_eng_grp() argument
1062 if (!eng_grps->grp[i].is_enabled) in find_unused_eng_grp()
1063 return &eng_grps->grp[i]; in find_unused_eng_grp()
1215 struct otx_cpt_eng_grps *eng_grps, in create_engine_group() argument
1230 if (!dev_supports_eng_type(eng_grps, engs[i].type)) { in create_engine_group()
1237 eng_grp = find_unused_eng_grp(eng_grps); in create_engine_group()
1294 ret = enable_eng_grp(eng_grp, eng_grps->obj); in create_engine_group()
1333 struct otx_cpt_eng_grps *eng_grps; in ucode_load_store() local
1342 eng_grps = container_of(attr, struct otx_cpt_eng_grps, ucode_load_attr); in ucode_load_store()
1429 if (!eng_grps->grp[del_grp_idx].is_enabled) { in ucode_load_store()
1440 mutex_lock(&eng_grps->lock); in ucode_load_store()
1442 if (eng_grps->is_rdonly) { in ucode_load_store()
1450 ret = create_engine_group(dev, eng_grps, engs, grp_idx, in ucode_load_store()
1455 ret = delete_engine_group(dev, &eng_grps->grp[del_grp_idx]); in ucode_load_store()
1459 print_dbg_info(dev, eng_grps); in ucode_load_store()
1461 mutex_unlock(&eng_grps->lock); in ucode_load_store()
1470 struct otx_cpt_eng_grps *eng_grps, in otx_cpt_try_create_default_eng_grps() argument
1479 mutex_lock(&eng_grps->lock); in otx_cpt_try_create_default_eng_grps()
1485 if (eng_grps->is_first_try) in otx_cpt_try_create_default_eng_grps()
1487 eng_grps->is_first_try = true; in otx_cpt_try_create_default_eng_grps()
1491 if (eng_grps->grp[i].is_enabled) in otx_cpt_try_create_default_eng_grps()
1517 dev_supports_eng_type(eng_grps, OTX_CPT_SE_TYPES)) { in otx_cpt_try_create_default_eng_grps()
1520 engs[0].count = eng_grps->avail.max_se_cnt; in otx_cpt_try_create_default_eng_grps()
1522 ret = create_engine_group(&pdev->dev, eng_grps, engs, 1, in otx_cpt_try_create_default_eng_grps()
1534 dev_supports_eng_type(eng_grps, OTX_CPT_AE_TYPES)) { in otx_cpt_try_create_default_eng_grps()
1537 engs[0].count = eng_grps->avail.max_ae_cnt; in otx_cpt_try_create_default_eng_grps()
1539 ret = create_engine_group(&pdev->dev, eng_grps, engs, 1, in otx_cpt_try_create_default_eng_grps()
1545 print_dbg_info(&pdev->dev, eng_grps); in otx_cpt_try_create_default_eng_grps()
1549 mutex_unlock(&eng_grps->lock); in otx_cpt_try_create_default_eng_grps()
1553 void otx_cpt_set_eng_grps_is_rdonly(struct otx_cpt_eng_grps *eng_grps, in otx_cpt_set_eng_grps_is_rdonly() argument
1556 mutex_lock(&eng_grps->lock); in otx_cpt_set_eng_grps_is_rdonly()
1558 eng_grps->is_rdonly = is_rdonly; in otx_cpt_set_eng_grps_is_rdonly()
1560 mutex_unlock(&eng_grps->lock); in otx_cpt_set_eng_grps_is_rdonly()
1589 struct otx_cpt_eng_grps *eng_grps) in otx_cpt_cleanup_eng_grps() argument
1594 mutex_lock(&eng_grps->lock); in otx_cpt_cleanup_eng_grps()
1595 if (eng_grps->is_ucode_load_created) { in otx_cpt_cleanup_eng_grps()
1597 &eng_grps->ucode_load_attr); in otx_cpt_cleanup_eng_grps()
1598 eng_grps->is_ucode_load_created = false; in otx_cpt_cleanup_eng_grps()
1603 if (eng_grps->grp[i].mirror.is_ena) in otx_cpt_cleanup_eng_grps()
1604 delete_engine_group(&pdev->dev, &eng_grps->grp[i]); in otx_cpt_cleanup_eng_grps()
1608 delete_engine_group(&pdev->dev, &eng_grps->grp[i]); in otx_cpt_cleanup_eng_grps()
1612 grp = &eng_grps->grp[i]; in otx_cpt_cleanup_eng_grps()
1619 mutex_unlock(&eng_grps->lock); in otx_cpt_cleanup_eng_grps()
1623 struct otx_cpt_eng_grps *eng_grps, int pf_type) in otx_cpt_init_eng_grps() argument
1628 mutex_init(&eng_grps->lock); in otx_cpt_init_eng_grps()
1629 eng_grps->obj = pci_get_drvdata(pdev); in otx_cpt_init_eng_grps()
1630 eng_grps->avail.se_cnt = eng_grps->avail.max_se_cnt; in otx_cpt_init_eng_grps()
1631 eng_grps->avail.ae_cnt = eng_grps->avail.max_ae_cnt; in otx_cpt_init_eng_grps()
1633 eng_grps->engs_num = eng_grps->avail.max_se_cnt + in otx_cpt_init_eng_grps()
1634 eng_grps->avail.max_ae_cnt; in otx_cpt_init_eng_grps()
1635 if (eng_grps->engs_num > OTX_CPT_MAX_ENGINES) { in otx_cpt_init_eng_grps()
1638 eng_grps->engs_num, OTX_CPT_MAX_ENGINES); in otx_cpt_init_eng_grps()
1644 grp = &eng_grps->grp[i]; in otx_cpt_init_eng_grps()
1645 grp->g = eng_grps; in otx_cpt_init_eng_grps()
1652 kcalloc(BITS_TO_LONGS(eng_grps->engs_num), in otx_cpt_init_eng_grps()
1664 eng_grps->eng_types_supported = 1 << OTX_CPT_SE_TYPES; in otx_cpt_init_eng_grps()
1669 eng_grps->eng_types_supported = 1 << OTX_CPT_AE_TYPES; in otx_cpt_init_eng_grps()
1678 eng_grps->ucode_load_attr.show = NULL; in otx_cpt_init_eng_grps()
1679 eng_grps->ucode_load_attr.store = ucode_load_store; in otx_cpt_init_eng_grps()
1680 eng_grps->ucode_load_attr.attr.name = "ucode_load"; in otx_cpt_init_eng_grps()
1681 eng_grps->ucode_load_attr.attr.mode = 0220; in otx_cpt_init_eng_grps()
1682 sysfs_attr_init(&eng_grps->ucode_load_attr.attr); in otx_cpt_init_eng_grps()
1684 &eng_grps->ucode_load_attr); in otx_cpt_init_eng_grps()
1687 eng_grps->is_ucode_load_created = true; in otx_cpt_init_eng_grps()
1689 print_dbg_info(&pdev->dev, eng_grps); in otx_cpt_init_eng_grps()
1692 otx_cpt_cleanup_eng_grps(pdev, eng_grps); in otx_cpt_init_eng_grps()