Lines Matching defs:spa

679 int nfit_spa_type(struct acpi_nfit_system_address *spa)
684 import_guid(&guid, spa->range_guid);
691 static size_t sizeof_spa(struct acpi_nfit_system_address *spa)
693 if (spa->flags & ACPI_NFIT_LOCATION_COOKIE_VALID)
694 return sizeof(*spa);
695 return sizeof(*spa) - 8;
700 struct acpi_nfit_system_address *spa)
705 if (spa->header.length != sizeof_spa(spa))
709 if (memcmp(nfit_spa->spa, spa, sizeof_spa(spa)) == 0) {
715 nfit_spa = devm_kzalloc(dev, sizeof(*nfit_spa) + sizeof_spa(spa),
720 memcpy(nfit_spa->spa, spa, sizeof_spa(spa));
722 dev_dbg(dev, "spa index: %d type: %s\n",
723 spa->range_index,
724 spa_type_name(nfit_spa_type(spa)));
751 dev_dbg(dev, "memdev handle: %#x spa: %d dcr: %d flags: %#x\n",
1003 struct acpi_nfit_system_address *spa)
1007 int type = spa ? nfit_spa_type(spa) : 0;
1014 if (spa)
1023 * dimms without spa associations.
1031 if (spa && nfit_memdev->memdev->range_index != spa->range_index)
1033 if (!spa && nfit_memdev->memdev->range_index)
1100 spa->range_index, dcr);
1109 nfit_mem->spa_dcr = spa;
1163 rc = __nfit_mem_init(acpi_desc, nfit_spa->spa);
2174 return sysfs_emit(buf, "%d\n", nfit_spa->spa->range_index);
2242 /* Retrieve the nth entry referencing this spa */
2257 struct acpi_nfit_system_address *spa)
2274 import_guid(&nd_set->type_guid, spa->range_guid);
2283 memdev_from_spa(acpi_desc, spa->range_index, i);
2344 struct acpi_nfit_system_address *spa = nfit_spa->spa;
2347 cmd->address = spa->address;
2348 cmd->length = spa->length;
2362 struct acpi_nfit_system_address *spa = nfit_spa->spa;
2366 ars_start.address = spa->address;
2367 ars_start.length = spa->length;
2370 if (nfit_spa_type(spa) == NFIT_SPA_PM)
2372 else if (nfit_spa_type(spa) == NFIT_SPA_VOLATILE)
2424 struct acpi_nfit_system_address *spa = nfit_spa->spa;
2437 if ((ars_status->address >= spa->address && ars_status->address
2438 < spa->address + spa->length)
2439 || (ars_status->address < spa->address)) {
2445 * Otherwise, if the scrub covers the spa range, mark
2449 >= spa->address + spa->length)
2462 dev_dbg(dev, "ARS: range %d complete\n", spa->range_index);
2555 struct acpi_nfit_system_address *spa = nfit_spa->spa;
2558 dev_err(acpi_desc->dev, "spa%d dimm: %#x not found\n",
2559 spa->range_index, memdev->device_handle);
2564 switch (nfit_spa_type(spa)) {
2575 static bool nfit_spa_is_virtual(struct acpi_nfit_system_address *spa)
2577 return (nfit_spa_type(spa) == NFIT_SPA_VDISK ||
2578 nfit_spa_type(spa) == NFIT_SPA_VCD ||
2579 nfit_spa_type(spa) == NFIT_SPA_PDISK ||
2580 nfit_spa_type(spa) == NFIT_SPA_PCD);
2583 static bool nfit_spa_is_volatile(struct acpi_nfit_system_address *spa)
2585 return (nfit_spa_type(spa) == NFIT_SPA_VDISK ||
2586 nfit_spa_type(spa) == NFIT_SPA_VCD ||
2587 nfit_spa_type(spa) == NFIT_SPA_VOLATILE);
2594 struct acpi_nfit_system_address *spa = nfit_spa->spa;
2604 if (spa->range_index == 0 && !nfit_spa_is_virtual(spa)) {
2605 dev_dbg(acpi_desc->dev, "detected invalid spa index\n");
2612 res.start = spa->address;
2613 res.end = res.start + spa->length - 1;
2618 if (spa->flags & ACPI_NFIT_PROXIMITY_VALID) {
2619 ndr_desc->numa_node = pxm_to_online_node(spa->proximity_domain);
2620 ndr_desc->target_node = pxm_to_node(spa->proximity_domain);
2628 ndr_desc->numa_node = memory_add_physaddr_to_nid(spa->address);
2633 ndr_desc->target_node = phys_to_target_node(spa->address);
2653 if (memdev->range_index == 0 || spa->range_index == 0)
2655 if (memdev->range_index != spa->range_index)
2658 dev_err(acpi_desc->dev, "spa%d exceeds max mappings %d\n",
2659 spa->range_index, ND_MAX_MAPPINGS);
2671 rc = acpi_nfit_init_interleave_set(acpi_desc, ndr_desc, spa);
2676 if (nfit_spa_type(spa) == NFIT_SPA_PM) {
2689 } else if (nfit_spa_is_volatile(spa)) {
2694 } else if (nfit_spa_is_virtual(spa)) {
2703 dev_err(acpi_desc->dev, "failed to register spa range %d\n",
2704 nfit_spa->spa->range_index);
2856 nfit_spa->spa->range_index,
2868 acpi_desc->scrub_spa->spa->range_index);
2872 * Consider this spa last for future scrub
2880 nfit_spa->spa->range_index, rc);
2934 int type = nfit_spa_type(nfit_spa->spa);
2943 /* check that the supported scrub types match the spa type */
2964 switch (nfit_spa_type(nfit_spa->spa)) {
2973 switch (nfit_spa_type(nfit_spa->spa)) {
3221 int type = nfit_spa_type(nfit_spa->spa);