Lines Matching refs:nfit_spa
682 struct nfit_spa *nfit_spa; in add_spa() local
687 list_for_each_entry(nfit_spa, &prev->spas, list) { in add_spa()
688 if (memcmp(nfit_spa->spa, spa, sizeof(*spa)) == 0) { in add_spa()
689 list_move_tail(&nfit_spa->list, &acpi_desc->spas); in add_spa()
694 nfit_spa = devm_kzalloc(dev, sizeof(*nfit_spa) + sizeof(*spa), in add_spa()
696 if (!nfit_spa) in add_spa()
698 INIT_LIST_HEAD(&nfit_spa->list); in add_spa()
699 memcpy(nfit_spa->spa, spa, sizeof(*spa)); in add_spa()
700 list_add_tail(&nfit_spa->list, &acpi_desc->spas); in add_spa()
986 struct nfit_spa *nfit_spa; in nfit_mem_find_spa_bdw() local
988 list_for_each_entry(nfit_spa, &acpi_desc->spas, list) { in nfit_mem_find_spa_bdw()
989 u16 range_index = nfit_spa->spa->range_index; in nfit_mem_find_spa_bdw()
990 int type = nfit_spa_type(nfit_spa->spa); in nfit_mem_find_spa_bdw()
1004 nfit_mem->spa_bdw = nfit_spa->spa; in nfit_mem_find_spa_bdw()
1203 struct nfit_spa *nfit_spa; in nfit_mem_init() local
1215 list_for_each_entry(nfit_spa, &acpi_desc->spas, list) { in nfit_mem_init()
1216 rc = __nfit_mem_init(acpi_desc, nfit_spa->spa); in nfit_mem_init()
2183 struct nfit_spa *nfit_spa = nd_region_provider_data(nd_region); in range_index_show() local
2185 return sprintf(buf, "%d\n", nfit_spa->spa->range_index); in range_index_show()
2646 struct nd_cmd_ars_cap *cmd, struct nfit_spa *nfit_spa) in ars_get_cap() argument
2649 struct acpi_nfit_system_address *spa = nfit_spa->spa; in ars_get_cap()
2662 struct nfit_spa *nfit_spa, enum nfit_ars_state req_type) in ars_start() argument
2667 struct acpi_nfit_system_address *spa = nfit_spa->spa; in ars_start()
2726 struct nfit_spa *nfit_spa) in ars_complete() argument
2729 struct acpi_nfit_system_address *spa = nfit_spa->spa; in ars_complete()
2730 struct nd_region *nd_region = nfit_spa->nd_region; in ars_complete()
2739 if (acpi_desc->scrub_spa != nfit_spa) in ars_complete()
2856 struct nfit_spa *nfit_spa) in acpi_nfit_init_mapping() argument
2860 struct acpi_nfit_system_address *spa = nfit_spa->spa; in acpi_nfit_init_mapping()
2897 nfit_spa->nd_region = nvdimm_blk_region_create(acpi_desc->nvdimm_bus, in acpi_nfit_init_mapping()
2899 if (!nfit_spa->nd_region) in acpi_nfit_init_mapping()
2923 struct nfit_spa *nfit_spa) in acpi_nfit_register_region() argument
2926 struct acpi_nfit_system_address *spa = nfit_spa->spa; in acpi_nfit_register_region()
2934 if (nfit_spa->nd_region) in acpi_nfit_register_region()
2949 ndr_desc->provider_data = nfit_spa; in acpi_nfit_register_region()
2984 memdev, nfit_spa); in acpi_nfit_register_region()
3005 nfit_spa->nd_region = nvdimm_pmem_region_create(nvdimm_bus, in acpi_nfit_register_region()
3007 if (!nfit_spa->nd_region) in acpi_nfit_register_region()
3010 nfit_spa->nd_region = nvdimm_volatile_region_create(nvdimm_bus, in acpi_nfit_register_region()
3012 if (!nfit_spa->nd_region) in acpi_nfit_register_region()
3015 nfit_spa->nd_region = nvdimm_pmem_region_create(nvdimm_bus, in acpi_nfit_register_region()
3017 if (!nfit_spa->nd_region) in acpi_nfit_register_region()
3024 nfit_spa->spa->range_index); in acpi_nfit_register_region()
3064 struct nfit_spa *nfit_spa) in ars_register() argument
3068 if (test_bit(ARS_FAILED, &nfit_spa->ars_state)) in ars_register()
3069 return acpi_nfit_register_region(acpi_desc, nfit_spa); in ars_register()
3071 set_bit(ARS_REQ_SHORT, &nfit_spa->ars_state); in ars_register()
3073 set_bit(ARS_REQ_LONG, &nfit_spa->ars_state); in ars_register()
3079 rc = ars_start(acpi_desc, nfit_spa, ARS_REQ_SHORT); in ars_register()
3084 set_bit(ARS_FAILED, &nfit_spa->ars_state); in ars_register()
3087 clear_bit(ARS_REQ_SHORT, &nfit_spa->ars_state); in ars_register()
3091 acpi_desc->scrub_spa = nfit_spa; in ars_register()
3092 ars_complete(acpi_desc, nfit_spa); in ars_register()
3109 set_bit(ARS_FAILED, &nfit_spa->ars_state); in ars_register()
3113 return acpi_nfit_register_region(acpi_desc, nfit_spa); in ars_register()
3118 struct nfit_spa *nfit_spa; in ars_complete_all() local
3120 list_for_each_entry(nfit_spa, &acpi_desc->spas, list) { in ars_complete_all()
3121 if (test_bit(ARS_FAILED, &nfit_spa->ars_state)) in ars_complete_all()
3123 ars_complete(acpi_desc, nfit_spa); in ars_complete_all()
3132 struct nfit_spa *nfit_spa; in __acpi_nfit_scrub() local
3158 list_for_each_entry(nfit_spa, &acpi_desc->spas, list) { in __acpi_nfit_scrub()
3162 if (test_bit(ARS_FAILED, &nfit_spa->ars_state)) in __acpi_nfit_scrub()
3166 if (test_bit(ARS_REQ_SHORT, &nfit_spa->ars_state)) in __acpi_nfit_scrub()
3168 else if (test_bit(ARS_REQ_LONG, &nfit_spa->ars_state)) in __acpi_nfit_scrub()
3172 rc = ars_start(acpi_desc, nfit_spa, req_type); in __acpi_nfit_scrub()
3174 dev = nd_region_dev(nfit_spa->nd_region); in __acpi_nfit_scrub()
3176 nfit_spa->spa->range_index, in __acpi_nfit_scrub()
3189 clear_bit(req_type, &nfit_spa->ars_state); in __acpi_nfit_scrub()
3190 acpi_desc->scrub_spa = nfit_spa; in __acpi_nfit_scrub()
3195 list_move_tail(&nfit_spa->list, &acpi_desc->spas); in __acpi_nfit_scrub()
3200 nfit_spa->spa->range_index, rc); in __acpi_nfit_scrub()
3201 set_bit(ARS_FAILED, &nfit_spa->ars_state); in __acpi_nfit_scrub()
3252 struct nfit_spa *nfit_spa) in acpi_nfit_init_ars() argument
3254 int type = nfit_spa_type(nfit_spa->spa); in acpi_nfit_init_ars()
3258 set_bit(ARS_FAILED, &nfit_spa->ars_state); in acpi_nfit_init_ars()
3260 rc = ars_get_cap(acpi_desc, &ars_cap, nfit_spa); in acpi_nfit_init_ars()
3271 nfit_spa->max_ars = ars_cap.max_ars_out; in acpi_nfit_init_ars()
3272 nfit_spa->clear_err_unit = ars_cap.clear_err_unit; in acpi_nfit_init_ars()
3273 acpi_desc->max_ars = max(nfit_spa->max_ars, acpi_desc->max_ars); in acpi_nfit_init_ars()
3274 clear_bit(ARS_FAILED, &nfit_spa->ars_state); in acpi_nfit_init_ars()
3279 struct nfit_spa *nfit_spa; in acpi_nfit_register_regions() local
3283 list_for_each_entry(nfit_spa, &acpi_desc->spas, list) { in acpi_nfit_register_regions()
3284 switch (nfit_spa_type(nfit_spa->spa)) { in acpi_nfit_register_regions()
3287 acpi_nfit_init_ars(acpi_desc, nfit_spa); in acpi_nfit_register_regions()
3292 list_for_each_entry(nfit_spa, &acpi_desc->spas, list) in acpi_nfit_register_regions()
3293 switch (nfit_spa_type(nfit_spa->spa)) { in acpi_nfit_register_regions()
3297 rc = ars_register(acpi_desc, nfit_spa); in acpi_nfit_register_regions()
3310 rc = acpi_nfit_register_region(acpi_desc, nfit_spa); in acpi_nfit_register_regions()
3514 struct nfit_spa *nfit_spa; in acpi_nfit_ars_rescan() local
3522 list_for_each_entry(nfit_spa, &acpi_desc->spas, list) { in acpi_nfit_ars_rescan()
3523 int type = nfit_spa_type(nfit_spa->spa); in acpi_nfit_ars_rescan()
3527 if (test_bit(ARS_FAILED, &nfit_spa->ars_state)) in acpi_nfit_ars_rescan()
3530 if (test_and_set_bit(req_type, &nfit_spa->ars_state)) in acpi_nfit_ars_rescan()