Lines Matching refs:nfit_spa

703 	struct nfit_spa *nfit_spa;
708 list_for_each_entry(nfit_spa, &prev->spas, list) {
709 if (memcmp(nfit_spa->spa, spa, sizeof_spa(spa)) == 0) {
710 list_move_tail(&nfit_spa->list, &acpi_desc->spas);
715 nfit_spa = devm_kzalloc(dev, sizeof(*nfit_spa) + sizeof_spa(spa),
717 if (!nfit_spa)
719 INIT_LIST_HEAD(&nfit_spa->list);
720 memcpy(nfit_spa->spa, spa, sizeof_spa(spa));
721 list_add_tail(&nfit_spa->list, &acpi_desc->spas);
1150 struct nfit_spa *nfit_spa;
1162 list_for_each_entry(nfit_spa, &acpi_desc->spas, list) {
1163 rc = __nfit_mem_init(acpi_desc, nfit_spa->spa);
2172 struct nfit_spa *nfit_spa = nd_region_provider_data(nd_region);
2174 return sysfs_emit(buf, "%d\n", nfit_spa->spa->range_index);
2341 struct nd_cmd_ars_cap *cmd, struct nfit_spa *nfit_spa)
2344 struct acpi_nfit_system_address *spa = nfit_spa->spa;
2357 struct nfit_spa *nfit_spa, enum nfit_ars_state req_type)
2362 struct acpi_nfit_system_address *spa = nfit_spa->spa;
2421 struct nfit_spa *nfit_spa)
2424 struct acpi_nfit_system_address *spa = nfit_spa->spa;
2425 struct nd_region *nd_region = nfit_spa->nd_region;
2434 if (acpi_desc->scrub_spa != nfit_spa)
2442 * start of nfit_spa that we are in the continuation
2551 struct nfit_spa *nfit_spa)
2555 struct acpi_nfit_system_address *spa = nfit_spa->spa;
2591 struct nfit_spa *nfit_spa)
2594 struct acpi_nfit_system_address *spa = nfit_spa->spa;
2601 if (nfit_spa->nd_region)
2616 ndr_desc->provider_data = nfit_spa;
2664 memdev, nfit_spa);
2685 nfit_spa->nd_region = nvdimm_pmem_region_create(nvdimm_bus,
2687 if (!nfit_spa->nd_region)
2690 nfit_spa->nd_region = nvdimm_volatile_region_create(nvdimm_bus,
2692 if (!nfit_spa->nd_region)
2695 nfit_spa->nd_region = nvdimm_pmem_region_create(nvdimm_bus,
2697 if (!nfit_spa->nd_region)
2704 nfit_spa->spa->range_index);
2744 struct nfit_spa *nfit_spa)
2748 if (test_bit(ARS_FAILED, &nfit_spa->ars_state))
2749 return acpi_nfit_register_region(acpi_desc, nfit_spa);
2751 set_bit(ARS_REQ_SHORT, &nfit_spa->ars_state);
2753 set_bit(ARS_REQ_LONG, &nfit_spa->ars_state);
2759 rc = ars_start(acpi_desc, nfit_spa, ARS_REQ_SHORT);
2764 set_bit(ARS_FAILED, &nfit_spa->ars_state);
2767 clear_bit(ARS_REQ_SHORT, &nfit_spa->ars_state);
2771 acpi_desc->scrub_spa = nfit_spa;
2772 ars_complete(acpi_desc, nfit_spa);
2789 set_bit(ARS_FAILED, &nfit_spa->ars_state);
2793 return acpi_nfit_register_region(acpi_desc, nfit_spa);
2798 struct nfit_spa *nfit_spa;
2800 list_for_each_entry(nfit_spa, &acpi_desc->spas, list) {
2801 if (test_bit(ARS_FAILED, &nfit_spa->ars_state))
2803 ars_complete(acpi_desc, nfit_spa);
2812 struct nfit_spa *nfit_spa;
2838 list_for_each_entry(nfit_spa, &acpi_desc->spas, list) {
2842 if (test_bit(ARS_FAILED, &nfit_spa->ars_state))
2846 if (test_bit(ARS_REQ_SHORT, &nfit_spa->ars_state))
2848 else if (test_bit(ARS_REQ_LONG, &nfit_spa->ars_state))
2852 rc = ars_start(acpi_desc, nfit_spa, req_type);
2854 dev = nd_region_dev(nfit_spa->nd_region);
2856 nfit_spa->spa->range_index,
2869 clear_bit(req_type, &nfit_spa->ars_state);
2870 acpi_desc->scrub_spa = nfit_spa;
2875 list_move_tail(&nfit_spa->list, &acpi_desc->spas);
2880 nfit_spa->spa->range_index, rc);
2881 set_bit(ARS_FAILED, &nfit_spa->ars_state);
2932 struct nfit_spa *nfit_spa)
2934 int type = nfit_spa_type(nfit_spa->spa);
2938 set_bit(ARS_FAILED, &nfit_spa->ars_state);
2940 rc = ars_get_cap(acpi_desc, &ars_cap, nfit_spa);
2951 nfit_spa->max_ars = ars_cap.max_ars_out;
2952 nfit_spa->clear_err_unit = ars_cap.clear_err_unit;
2953 acpi_desc->max_ars = max(nfit_spa->max_ars, acpi_desc->max_ars);
2954 clear_bit(ARS_FAILED, &nfit_spa->ars_state);
2959 struct nfit_spa *nfit_spa;
2963 list_for_each_entry(nfit_spa, &acpi_desc->spas, list) {
2964 switch (nfit_spa_type(nfit_spa->spa)) {
2967 acpi_nfit_init_ars(acpi_desc, nfit_spa);
2972 list_for_each_entry(nfit_spa, &acpi_desc->spas, list) {
2973 switch (nfit_spa_type(nfit_spa->spa)) {
2977 rc = ars_register(acpi_desc, nfit_spa);
2985 if (!test_bit(ARS_FAILED, &nfit_spa->ars_state))
2997 rc = acpi_nfit_register_region(acpi_desc, nfit_spa);
3212 struct nfit_spa *nfit_spa;
3220 list_for_each_entry(nfit_spa, &acpi_desc->spas, list) {
3221 int type = nfit_spa_type(nfit_spa->spa);
3225 if (test_bit(ARS_FAILED, &nfit_spa->ars_state))
3228 if (test_and_set_bit(req_type, &nfit_spa->ars_state))