Lines Matching refs:nfit_spa
703 struct nfit_spa *nfit_spa; in add_spa() local
708 list_for_each_entry(nfit_spa, &prev->spas, list) { in add_spa()
709 if (memcmp(nfit_spa->spa, spa, sizeof_spa(spa)) == 0) { in add_spa()
710 list_move_tail(&nfit_spa->list, &acpi_desc->spas); in add_spa()
715 nfit_spa = devm_kzalloc(dev, sizeof(*nfit_spa) + sizeof_spa(spa), in add_spa()
717 if (!nfit_spa) in add_spa()
719 INIT_LIST_HEAD(&nfit_spa->list); in add_spa()
720 memcpy(nfit_spa->spa, spa, sizeof_spa(spa)); in add_spa()
721 list_add_tail(&nfit_spa->list, &acpi_desc->spas); in add_spa()
1150 struct nfit_spa *nfit_spa; in nfit_mem_init() local
1162 list_for_each_entry(nfit_spa, &acpi_desc->spas, list) { in nfit_mem_init()
1163 rc = __nfit_mem_init(acpi_desc, nfit_spa->spa); in nfit_mem_init()
2173 struct nfit_spa *nfit_spa = nd_region_provider_data(nd_region); in range_index_show() local
2175 return sprintf(buf, "%d\n", nfit_spa->spa->range_index); in range_index_show()
2347 struct nd_cmd_ars_cap *cmd, struct nfit_spa *nfit_spa) in ars_get_cap() argument
2350 struct acpi_nfit_system_address *spa = nfit_spa->spa; in ars_get_cap()
2363 struct nfit_spa *nfit_spa, enum nfit_ars_state req_type) in ars_start() argument
2368 struct acpi_nfit_system_address *spa = nfit_spa->spa; in ars_start()
2427 struct nfit_spa *nfit_spa) in ars_complete() argument
2430 struct acpi_nfit_system_address *spa = nfit_spa->spa; in ars_complete()
2431 struct nd_region *nd_region = nfit_spa->nd_region; in ars_complete()
2440 if (acpi_desc->scrub_spa != nfit_spa) in ars_complete()
2557 struct nfit_spa *nfit_spa) in acpi_nfit_init_mapping() argument
2561 struct acpi_nfit_system_address *spa = nfit_spa->spa; in acpi_nfit_init_mapping()
2597 struct nfit_spa *nfit_spa) in acpi_nfit_register_region() argument
2600 struct acpi_nfit_system_address *spa = nfit_spa->spa; in acpi_nfit_register_region()
2607 if (nfit_spa->nd_region) in acpi_nfit_register_region()
2622 ndr_desc->provider_data = nfit_spa; in acpi_nfit_register_region()
2670 memdev, nfit_spa); in acpi_nfit_register_region()
2691 nfit_spa->nd_region = nvdimm_pmem_region_create(nvdimm_bus, in acpi_nfit_register_region()
2693 if (!nfit_spa->nd_region) in acpi_nfit_register_region()
2696 nfit_spa->nd_region = nvdimm_volatile_region_create(nvdimm_bus, in acpi_nfit_register_region()
2698 if (!nfit_spa->nd_region) in acpi_nfit_register_region()
2701 nfit_spa->nd_region = nvdimm_pmem_region_create(nvdimm_bus, in acpi_nfit_register_region()
2703 if (!nfit_spa->nd_region) in acpi_nfit_register_region()
2710 nfit_spa->spa->range_index); in acpi_nfit_register_region()
2750 struct nfit_spa *nfit_spa) in ars_register() argument
2754 if (test_bit(ARS_FAILED, &nfit_spa->ars_state)) in ars_register()
2755 return acpi_nfit_register_region(acpi_desc, nfit_spa); in ars_register()
2757 set_bit(ARS_REQ_SHORT, &nfit_spa->ars_state); in ars_register()
2759 set_bit(ARS_REQ_LONG, &nfit_spa->ars_state); in ars_register()
2765 rc = ars_start(acpi_desc, nfit_spa, ARS_REQ_SHORT); in ars_register()
2770 set_bit(ARS_FAILED, &nfit_spa->ars_state); in ars_register()
2773 clear_bit(ARS_REQ_SHORT, &nfit_spa->ars_state); in ars_register()
2777 acpi_desc->scrub_spa = nfit_spa; in ars_register()
2778 ars_complete(acpi_desc, nfit_spa); in ars_register()
2795 set_bit(ARS_FAILED, &nfit_spa->ars_state); in ars_register()
2799 return acpi_nfit_register_region(acpi_desc, nfit_spa); in ars_register()
2804 struct nfit_spa *nfit_spa; in ars_complete_all() local
2806 list_for_each_entry(nfit_spa, &acpi_desc->spas, list) { in ars_complete_all()
2807 if (test_bit(ARS_FAILED, &nfit_spa->ars_state)) in ars_complete_all()
2809 ars_complete(acpi_desc, nfit_spa); in ars_complete_all()
2818 struct nfit_spa *nfit_spa; in __acpi_nfit_scrub() local
2844 list_for_each_entry(nfit_spa, &acpi_desc->spas, list) { in __acpi_nfit_scrub()
2848 if (test_bit(ARS_FAILED, &nfit_spa->ars_state)) in __acpi_nfit_scrub()
2852 if (test_bit(ARS_REQ_SHORT, &nfit_spa->ars_state)) in __acpi_nfit_scrub()
2854 else if (test_bit(ARS_REQ_LONG, &nfit_spa->ars_state)) in __acpi_nfit_scrub()
2858 rc = ars_start(acpi_desc, nfit_spa, req_type); in __acpi_nfit_scrub()
2860 dev = nd_region_dev(nfit_spa->nd_region); in __acpi_nfit_scrub()
2862 nfit_spa->spa->range_index, in __acpi_nfit_scrub()
2875 clear_bit(req_type, &nfit_spa->ars_state); in __acpi_nfit_scrub()
2876 acpi_desc->scrub_spa = nfit_spa; in __acpi_nfit_scrub()
2881 list_move_tail(&nfit_spa->list, &acpi_desc->spas); in __acpi_nfit_scrub()
2886 nfit_spa->spa->range_index, rc); in __acpi_nfit_scrub()
2887 set_bit(ARS_FAILED, &nfit_spa->ars_state); in __acpi_nfit_scrub()
2938 struct nfit_spa *nfit_spa) in acpi_nfit_init_ars() argument
2940 int type = nfit_spa_type(nfit_spa->spa); in acpi_nfit_init_ars()
2944 set_bit(ARS_FAILED, &nfit_spa->ars_state); in acpi_nfit_init_ars()
2946 rc = ars_get_cap(acpi_desc, &ars_cap, nfit_spa); in acpi_nfit_init_ars()
2957 nfit_spa->max_ars = ars_cap.max_ars_out; in acpi_nfit_init_ars()
2958 nfit_spa->clear_err_unit = ars_cap.clear_err_unit; in acpi_nfit_init_ars()
2959 acpi_desc->max_ars = max(nfit_spa->max_ars, acpi_desc->max_ars); in acpi_nfit_init_ars()
2960 clear_bit(ARS_FAILED, &nfit_spa->ars_state); in acpi_nfit_init_ars()
2965 struct nfit_spa *nfit_spa; in acpi_nfit_register_regions() local
2969 list_for_each_entry(nfit_spa, &acpi_desc->spas, list) { in acpi_nfit_register_regions()
2970 switch (nfit_spa_type(nfit_spa->spa)) { in acpi_nfit_register_regions()
2973 acpi_nfit_init_ars(acpi_desc, nfit_spa); in acpi_nfit_register_regions()
2978 list_for_each_entry(nfit_spa, &acpi_desc->spas, list) { in acpi_nfit_register_regions()
2979 switch (nfit_spa_type(nfit_spa->spa)) { in acpi_nfit_register_regions()
2983 rc = ars_register(acpi_desc, nfit_spa); in acpi_nfit_register_regions()
2991 if (!test_bit(ARS_FAILED, &nfit_spa->ars_state)) in acpi_nfit_register_regions()
3003 rc = acpi_nfit_register_region(acpi_desc, nfit_spa); in acpi_nfit_register_regions()
3218 struct nfit_spa *nfit_spa; in acpi_nfit_ars_rescan() local
3226 list_for_each_entry(nfit_spa, &acpi_desc->spas, list) { in acpi_nfit_ars_rescan()
3227 int type = nfit_spa_type(nfit_spa->spa); in acpi_nfit_ars_rescan()
3231 if (test_bit(ARS_FAILED, &nfit_spa->ars_state)) in acpi_nfit_ars_rescan()
3234 if (test_and_set_bit(req_type, &nfit_spa->ars_state)) in acpi_nfit_ars_rescan()