Lines Matching full:target

103 	struct memory_target *target;  in find_mem_target()  local
105 list_for_each_entry(target, &targets, node) in find_mem_target()
106 if (target->memory_pxm == mem_pxm) in find_mem_target()
107 return target; in find_mem_target()
124 struct memory_target *target; in hmat_get_extended_linear_cache_size() local
128 target = find_mem_target(pxm); in hmat_get_extended_linear_cache_size()
129 if (!target) in hmat_get_extended_linear_cache_size()
132 list_for_each_entry(tcache, &target->caches, node) { in hmat_get_extended_linear_cache_size()
137 res = &target->memregions; in hmat_get_extended_linear_cache_size()
152 struct memory_target *target; in acpi_find_genport_target() local
156 list_for_each_entry(target, &targets, node) { in acpi_find_genport_target()
157 uid_ptr = target->gen_port_device_handle + 8; in acpi_find_genport_target()
160 return target; in acpi_find_genport_target()
179 struct memory_target *target; in acpi_get_genport_coordinates() local
182 target = acpi_find_genport_target(uid); in acpi_get_genport_coordinates()
183 if (!target) in acpi_get_genport_coordinates()
187 target->coord[NODE_ACCESS_CLASS_GENPORT_SINK_LOCAL]; in acpi_get_genport_coordinates()
189 target->coord[NODE_ACCESS_CLASS_GENPORT_SINK_CPU]; in acpi_get_genport_coordinates()
217 struct memory_target *target; in alloc_target() local
219 target = find_mem_target(mem_pxm); in alloc_target()
220 if (!target) { in alloc_target()
221 target = kzalloc(sizeof(*target), GFP_KERNEL); in alloc_target()
222 if (!target) in alloc_target()
224 target->memory_pxm = mem_pxm; in alloc_target()
225 target->processor_pxm = PXM_INVAL; in alloc_target()
226 target->memregions = (struct resource) { in alloc_target()
232 list_add_tail(&target->node, &targets); in alloc_target()
233 INIT_LIST_HEAD(&target->caches); in alloc_target()
236 return target; in alloc_target()
243 struct memory_target *target; in alloc_memory_target() local
245 target = alloc_target(mem_pxm); in alloc_memory_target()
246 if (!target) in alloc_memory_target()
251 * in the per-target memregions resource tree. in alloc_memory_target()
253 if (!__request_region(&target->memregions, start, len, "memory target", in alloc_memory_target()
261 struct memory_target *target; in alloc_genport_target() local
263 target = alloc_target(mem_pxm); in alloc_genport_target()
264 if (!target) in alloc_genport_target()
267 memcpy(target->gen_port_device_handle, handle, in alloc_genport_target()
342 static void hmat_update_target_access(struct memory_target *target, in hmat_update_target_access() argument
347 target->coord[access].read_latency = value; in hmat_update_target_access()
348 target->coord[access].write_latency = value; in hmat_update_target_access()
351 target->coord[access].read_latency = value; in hmat_update_target_access()
354 target->coord[access].write_latency = value; in hmat_update_target_access()
357 target->coord[access].read_bandwidth = value; in hmat_update_target_access()
358 target->coord[access].write_bandwidth = value; in hmat_update_target_access()
361 target->coord[access].read_bandwidth = value; in hmat_update_target_access()
364 target->coord[access].write_bandwidth = value; in hmat_update_target_access()
374 struct memory_target *target; in hmat_update_target_coordinates() local
382 target = find_mem_target(pxm); in hmat_update_target_coordinates()
383 if (!target) in hmat_update_target_coordinates()
386 hmat_update_target_access(target, ACPI_HMAT_READ_LATENCY, in hmat_update_target_coordinates()
388 hmat_update_target_access(target, ACPI_HMAT_WRITE_LATENCY, in hmat_update_target_coordinates()
390 hmat_update_target_access(target, ACPI_HMAT_READ_BANDWIDTH, in hmat_update_target_coordinates()
392 hmat_update_target_access(target, ACPI_HMAT_WRITE_BANDWIDTH, in hmat_update_target_coordinates()
394 target->ext_updated = true; in hmat_update_target_coordinates()
442 struct memory_target *target = find_mem_target(tgt_pxm); in hmat_update_target() local
447 if (target && target->processor_pxm == init_pxm) { in hmat_update_target()
448 hmat_update_target_access(target, type, value, in hmat_update_target()
452 hmat_update_target_access(target, type, value, in hmat_update_target()
484 pr_debug("Locality: Flags:%02x Type:%s Initiator Domains:%u Target Domains:%u Base:%lld\n", in hmat_parse_locality()
497 pr_debug(" Initiator-Target[%u-%u]:%u%s\n", in hmat_parse_locality()
516 struct memory_target *target; in hmat_parse_cache() local
531 target = find_mem_target(cache->memory_PD); in hmat_parse_cache()
532 if (!target) in hmat_parse_cache()
575 list_add_tail(&tcache->node, &target->caches); in hmat_parse_cache()
584 struct memory_target *target = NULL; in hmat_parse_proximity_domain() local
602 target = find_mem_target(p->memory_PD); in hmat_parse_proximity_domain()
603 if (!target) { in hmat_parse_proximity_domain()
608 if (target && p->flags & ACPI_HMAT_PROCESSOR_PD_VALID) { in hmat_parse_proximity_domain()
615 target->processor_pxm = p->processor_PD; in hmat_parse_proximity_domain()
675 static u32 hmat_initiator_perf(struct memory_target *target, in hmat_initiator_perf() argument
700 if (targs[i] == target->memory_pxm) { in hmat_initiator_perf()
767 static void hmat_update_target_attrs(struct memory_target *target, in hmat_update_target_attrs() argument
777 if (target->ext_updated) in hmat_update_target_attrs()
783 !(*(u16 *)target->gen_port_device_handle)) in hmat_update_target_attrs()
792 if (target->processor_pxm != PXM_INVAL) { in hmat_update_target_attrs()
793 cpu_nid = pxm_to_node(target->processor_pxm); in hmat_update_target_attrs()
796 set_bit(target->processor_pxm, p_nodes); in hmat_update_target_attrs()
832 value = hmat_initiator_perf(target, initiator, loc->hmat_loc); in hmat_update_target_attrs()
839 hmat_update_target_access(target, loc->hmat_loc->data_type, best, access); in hmat_update_target_attrs()
843 static void __hmat_register_target_initiators(struct memory_target *target, in __hmat_register_target_initiators() argument
850 mem_nid = pxm_to_node(target->memory_pxm); in __hmat_register_target_initiators()
851 hmat_update_target_attrs(target, p_nodes, access); in __hmat_register_target_initiators()
858 static void hmat_update_generic_target(struct memory_target *target) in hmat_update_generic_target() argument
862 hmat_update_target_attrs(target, p_nodes, in hmat_update_generic_target()
864 hmat_update_target_attrs(target, p_nodes, in hmat_update_generic_target()
868 static void hmat_register_target_initiators(struct memory_target *target) in hmat_register_target_initiators() argument
872 __hmat_register_target_initiators(target, p_nodes, in hmat_register_target_initiators()
874 __hmat_register_target_initiators(target, p_nodes, in hmat_register_target_initiators()
878 static void hmat_register_target_cache(struct memory_target *target) in hmat_register_target_cache() argument
880 unsigned mem_nid = pxm_to_node(target->memory_pxm); in hmat_register_target_cache()
883 list_for_each_entry(tcache, &target->caches, node) in hmat_register_target_cache()
887 static void hmat_register_target_perf(struct memory_target *target, int access) in hmat_register_target_perf() argument
889 unsigned mem_nid = pxm_to_node(target->memory_pxm); in hmat_register_target_perf()
890 node_set_perf_attrs(mem_nid, &target->coord[access], access); in hmat_register_target_perf()
893 static void hmat_register_target_devices(struct memory_target *target) in hmat_register_target_devices() argument
904 for (res = target->memregions.child; res; res = res->sibling) { in hmat_register_target_devices()
905 int target_nid = pxm_to_node(target->memory_pxm); in hmat_register_target_devices()
911 static void hmat_register_target(struct memory_target *target) in hmat_register_target() argument
913 int nid = pxm_to_node(target->memory_pxm); in hmat_register_target()
919 hmat_register_target_devices(target); in hmat_register_target()
926 if (*(u16 *)target->gen_port_device_handle) { in hmat_register_target()
927 hmat_update_generic_target(target); in hmat_register_target()
928 target->registered = true; in hmat_register_target()
943 if (!target->registered) { in hmat_register_target()
944 hmat_register_target_initiators(target); in hmat_register_target()
945 hmat_register_target_cache(target); in hmat_register_target()
946 hmat_register_target_perf(target, ACCESS_COORDINATE_LOCAL); in hmat_register_target()
947 hmat_register_target_perf(target, ACCESS_COORDINATE_CPU); in hmat_register_target()
948 target->registered = true; in hmat_register_target()
955 struct memory_target *target; in hmat_register_targets() local
957 list_for_each_entry(target, &targets, node) in hmat_register_targets()
958 hmat_register_target(target); in hmat_register_targets()
964 struct memory_target *target; in hmat_callback() local
972 target = find_mem_target(pxm); in hmat_callback()
973 if (!target) in hmat_callback()
976 hmat_register_target(target); in hmat_callback()
984 struct memory_target *target; in hmat_set_default_dram_perf() local
989 target = find_mem_target(pxm); in hmat_set_default_dram_perf()
990 if (!target) in hmat_set_default_dram_perf()
992 attrs = &target->coord[ACCESS_COORDINATE_CPU]; in hmat_set_default_dram_perf()
1005 struct memory_target *target; in hmat_calculate_adistance() local
1011 target = find_mem_target(pxm); in hmat_calculate_adistance()
1012 if (!target) in hmat_calculate_adistance()
1016 hmat_update_target_attrs(target, p_nodes, ACCESS_COORDINATE_CPU); in hmat_calculate_adistance()
1019 perf = &target->coord[ACCESS_COORDINATE_CPU]; in hmat_calculate_adistance()
1034 struct memory_target *target, *tnext; in hmat_free_structures() local
1039 list_for_each_entry_safe(target, tnext, &targets, node) { in hmat_free_structures()
1042 list_for_each_entry_safe(tcache, cnext, &target->caches, node) { in hmat_free_structures()
1047 list_del(&target->node); in hmat_free_structures()
1048 res = target->memregions.child; in hmat_free_structures()
1051 __release_region(&target->memregions, res->start, in hmat_free_structures()
1055 kfree(target); in hmat_free_structures()