Lines Matching refs:this_leaf

39 static inline bool cache_leaves_are_shared(struct cacheinfo *this_leaf,  in cache_leaves_are_shared()  argument
48 return (this_leaf->level != 1) && (sib_leaf->level != 1); in cache_leaves_are_shared()
51 (this_leaf->attributes & CACHE_ID)) in cache_leaves_are_shared()
52 return sib_leaf->id == this_leaf->id; in cache_leaves_are_shared()
54 return sib_leaf->fw_token == this_leaf->fw_token; in cache_leaves_are_shared()
121 static void cache_size(struct cacheinfo *this_leaf, struct device_node *np) in cache_size() argument
126 ct_idx = get_cacheinfo_idx(this_leaf->type); in cache_size()
129 of_property_read_u32(np, propname, &this_leaf->size); in cache_size()
133 static void cache_get_line_size(struct cacheinfo *this_leaf, in cache_get_line_size() argument
138 ct_idx = get_cacheinfo_idx(this_leaf->type); in cache_get_line_size()
149 this_leaf->coherency_line_size = line_size; in cache_get_line_size()
155 static void cache_nr_sets(struct cacheinfo *this_leaf, struct device_node *np) in cache_nr_sets() argument
160 ct_idx = get_cacheinfo_idx(this_leaf->type); in cache_nr_sets()
163 of_property_read_u32(np, propname, &this_leaf->number_of_sets); in cache_nr_sets()
166 static void cache_associativity(struct cacheinfo *this_leaf) in cache_associativity() argument
168 unsigned int line_size = this_leaf->coherency_line_size; in cache_associativity()
169 unsigned int nr_sets = this_leaf->number_of_sets; in cache_associativity()
170 unsigned int size = this_leaf->size; in cache_associativity()
177 this_leaf->ways_of_associativity = (size / nr_sets) / line_size; in cache_associativity()
180 static bool cache_node_is_unified(struct cacheinfo *this_leaf, in cache_node_is_unified() argument
186 static void cache_of_set_props(struct cacheinfo *this_leaf, in cache_of_set_props() argument
194 if (this_leaf->type == CACHE_TYPE_NOCACHE && in cache_of_set_props()
195 cache_node_is_unified(this_leaf, np)) in cache_of_set_props()
196 this_leaf->type = CACHE_TYPE_UNIFIED; in cache_of_set_props()
197 cache_size(this_leaf, np); in cache_of_set_props()
198 cache_get_line_size(this_leaf, np); in cache_of_set_props()
199 cache_nr_sets(this_leaf, np); in cache_of_set_props()
200 cache_associativity(this_leaf); in cache_of_set_props()
205 struct cacheinfo *this_leaf; in cache_setup_of_node() local
219 this_leaf = per_cpu_cacheinfo_idx(cpu, index); in cache_setup_of_node()
220 if (this_leaf->level != 1) { in cache_setup_of_node()
226 cache_of_set_props(this_leaf, np); in cache_setup_of_node()
227 this_leaf->fw_token = np; in cache_setup_of_node()
345 struct cacheinfo *this_leaf, *sib_leaf; in cache_shared_cpu_map_setup() local
366 this_leaf = per_cpu_cacheinfo_idx(cpu, index); in cache_shared_cpu_map_setup()
368 cpumask_set_cpu(cpu, &this_leaf->shared_cpu_map); in cache_shared_cpu_map_setup()
382 if (sib_leaf->level != this_leaf->level || in cache_shared_cpu_map_setup()
383 sib_leaf->type != this_leaf->type) in cache_shared_cpu_map_setup()
386 if (cache_leaves_are_shared(this_leaf, sib_leaf)) { in cache_shared_cpu_map_setup()
388 cpumask_set_cpu(i, &this_leaf->shared_cpu_map); in cache_shared_cpu_map_setup()
394 if (this_leaf->coherency_line_size > coherency_max_size) in cache_shared_cpu_map_setup()
395 coherency_max_size = this_leaf->coherency_line_size; in cache_shared_cpu_map_setup()
406 struct cacheinfo *this_leaf, *sib_leaf; in cache_shared_cpu_map_remove() local
410 this_leaf = per_cpu_cacheinfo_idx(cpu, index); in cache_shared_cpu_map_remove()
411 for_each_cpu(sibling, &this_leaf->shared_cpu_map) { in cache_shared_cpu_map_remove()
426 if (sib_leaf->level != this_leaf->level || in cache_shared_cpu_map_remove()
427 sib_leaf->type != this_leaf->type) in cache_shared_cpu_map_remove()
430 if (cache_leaves_are_shared(this_leaf, sib_leaf)) { in cache_shared_cpu_map_remove()
432 cpumask_clear_cpu(sibling, &this_leaf->shared_cpu_map); in cache_shared_cpu_map_remove()
604 struct cacheinfo *this_leaf = dev_get_drvdata(dev); \
605 return sysfs_emit(buf, "%u\n", this_leaf->object); \
618 struct cacheinfo *this_leaf = dev_get_drvdata(dev); in size_show() local
620 return sysfs_emit(buf, "%uK\n", this_leaf->size >> 10); in size_show()
626 struct cacheinfo *this_leaf = dev_get_drvdata(dev); in shared_cpu_map_show() local
627 const struct cpumask *mask = &this_leaf->shared_cpu_map; in shared_cpu_map_show()
635 struct cacheinfo *this_leaf = dev_get_drvdata(dev); in shared_cpu_list_show() local
636 const struct cpumask *mask = &this_leaf->shared_cpu_map; in shared_cpu_list_show()
644 struct cacheinfo *this_leaf = dev_get_drvdata(dev); in type_show() local
647 switch (this_leaf->type) { in type_show()
667 struct cacheinfo *this_leaf = dev_get_drvdata(dev); in allocation_policy_show() local
668 unsigned int ci_attr = this_leaf->attributes; in allocation_policy_show()
686 struct cacheinfo *this_leaf = dev_get_drvdata(dev); in write_policy_show() local
687 unsigned int ci_attr = this_leaf->attributes; in write_policy_show()
731 struct cacheinfo *this_leaf = dev_get_drvdata(dev); in cache_default_attrs_is_visible() local
732 const struct cpumask *mask = &this_leaf->shared_cpu_map; in cache_default_attrs_is_visible()
735 if ((attr == &dev_attr_id.attr) && (this_leaf->attributes & CACHE_ID)) in cache_default_attrs_is_visible()
737 if ((attr == &dev_attr_type.attr) && this_leaf->type) in cache_default_attrs_is_visible()
739 if ((attr == &dev_attr_level.attr) && this_leaf->level) in cache_default_attrs_is_visible()
746 this_leaf->coherency_line_size) in cache_default_attrs_is_visible()
749 this_leaf->size) /* allow 0 = full associativity */ in cache_default_attrs_is_visible()
752 this_leaf->number_of_sets) in cache_default_attrs_is_visible()
754 if ((attr == &dev_attr_size.attr) && this_leaf->size) in cache_default_attrs_is_visible()
757 (this_leaf->attributes & CACHE_WRITE_POLICY_MASK)) in cache_default_attrs_is_visible()
760 (this_leaf->attributes & CACHE_ALLOCATE_POLICY_MASK)) in cache_default_attrs_is_visible()
763 this_leaf->physical_line_partition) in cache_default_attrs_is_visible()
786 __weak cache_get_priv_group(struct cacheinfo *this_leaf) in cache_get_priv_group() argument
792 cache_get_attribute_groups(struct cacheinfo *this_leaf) in cache_get_attribute_groups() argument
795 cache_get_priv_group(this_leaf); in cache_get_attribute_groups()
855 struct cacheinfo *this_leaf; in cache_add_dev() local
864 this_leaf = per_cpu_cacheinfo_idx(cpu, i); in cache_add_dev()
865 if (this_leaf->disable_sysfs) in cache_add_dev()
867 if (this_leaf->type == CACHE_TYPE_NOCACHE) in cache_add_dev()
869 cache_groups = cache_get_attribute_groups(this_leaf); in cache_add_dev()
870 ci_dev = cpu_device_create(parent, this_leaf, cache_groups, in cache_add_dev()