Lines Matching refs:this_leaf
40 static inline bool cache_leaves_are_shared(struct cacheinfo *this_leaf, in cache_leaves_are_shared() argument
49 return (this_leaf->level != 1) && (sib_leaf->level != 1); in cache_leaves_are_shared()
52 (this_leaf->attributes & CACHE_ID)) in cache_leaves_are_shared()
53 return sib_leaf->id == this_leaf->id; in cache_leaves_are_shared()
55 return sib_leaf->fw_token == this_leaf->fw_token; in cache_leaves_are_shared()
122 static void cache_size(struct cacheinfo *this_leaf, struct device_node *np) in cache_size() argument
127 ct_idx = get_cacheinfo_idx(this_leaf->type); in cache_size()
130 of_property_read_u32(np, propname, &this_leaf->size); in cache_size()
134 static void cache_get_line_size(struct cacheinfo *this_leaf, in cache_get_line_size() argument
139 ct_idx = get_cacheinfo_idx(this_leaf->type); in cache_get_line_size()
150 this_leaf->coherency_line_size = line_size; in cache_get_line_size()
156 static void cache_nr_sets(struct cacheinfo *this_leaf, struct device_node *np) in cache_nr_sets() argument
161 ct_idx = get_cacheinfo_idx(this_leaf->type); in cache_nr_sets()
164 of_property_read_u32(np, propname, &this_leaf->number_of_sets); in cache_nr_sets()
167 static void cache_associativity(struct cacheinfo *this_leaf) in cache_associativity() argument
169 unsigned int line_size = this_leaf->coherency_line_size; in cache_associativity()
170 unsigned int nr_sets = this_leaf->number_of_sets; in cache_associativity()
171 unsigned int size = this_leaf->size; in cache_associativity()
178 this_leaf->ways_of_associativity = (size / nr_sets) / line_size; in cache_associativity()
181 static bool cache_node_is_unified(struct cacheinfo *this_leaf, in cache_node_is_unified() argument
210 static void cache_of_set_id(struct cacheinfo *this_leaf, in cache_of_set_id() argument
230 this_leaf->id = min_id; in cache_of_set_id()
231 this_leaf->attributes |= CACHE_ID; in cache_of_set_id()
235 static void cache_of_set_props(struct cacheinfo *this_leaf, in cache_of_set_props() argument
243 if (this_leaf->type == CACHE_TYPE_NOCACHE && in cache_of_set_props()
244 cache_node_is_unified(this_leaf, np)) in cache_of_set_props()
245 this_leaf->type = CACHE_TYPE_UNIFIED; in cache_of_set_props()
246 cache_size(this_leaf, np); in cache_of_set_props()
247 cache_get_line_size(this_leaf, np); in cache_of_set_props()
248 cache_nr_sets(this_leaf, np); in cache_of_set_props()
249 cache_associativity(this_leaf); in cache_of_set_props()
250 cache_of_set_id(this_leaf, np); in cache_of_set_props()
255 struct cacheinfo *this_leaf; in cache_setup_of_node() local
269 this_leaf = per_cpu_cacheinfo_idx(cpu, index); in cache_setup_of_node()
270 if (this_leaf->level != 1) { in cache_setup_of_node()
276 cache_of_set_props(this_leaf, np); in cache_setup_of_node()
277 this_leaf->fw_token = np; in cache_setup_of_node()
395 struct cacheinfo *this_leaf, *sib_leaf; in cache_shared_cpu_map_setup() local
416 this_leaf = per_cpu_cacheinfo_idx(cpu, index); in cache_shared_cpu_map_setup()
418 cpumask_set_cpu(cpu, &this_leaf->shared_cpu_map); in cache_shared_cpu_map_setup()
430 if (sib_leaf->level != this_leaf->level || in cache_shared_cpu_map_setup()
431 sib_leaf->type != this_leaf->type) in cache_shared_cpu_map_setup()
434 if (cache_leaves_are_shared(this_leaf, sib_leaf)) { in cache_shared_cpu_map_setup()
436 cpumask_set_cpu(i, &this_leaf->shared_cpu_map); in cache_shared_cpu_map_setup()
442 if (this_leaf->coherency_line_size > coherency_max_size) in cache_shared_cpu_map_setup()
443 coherency_max_size = this_leaf->coherency_line_size; in cache_shared_cpu_map_setup()
454 struct cacheinfo *this_leaf, *sib_leaf; in cache_shared_cpu_map_remove() local
458 this_leaf = per_cpu_cacheinfo_idx(cpu, index); in cache_shared_cpu_map_remove()
459 for_each_cpu(sibling, &this_leaf->shared_cpu_map) { in cache_shared_cpu_map_remove()
471 if (sib_leaf->level != this_leaf->level || in cache_shared_cpu_map_remove()
472 sib_leaf->type != this_leaf->type) in cache_shared_cpu_map_remove()
475 if (cache_leaves_are_shared(this_leaf, sib_leaf)) { in cache_shared_cpu_map_remove()
477 cpumask_clear_cpu(sibling, &this_leaf->shared_cpu_map); in cache_shared_cpu_map_remove()
651 struct cacheinfo *this_leaf = dev_get_drvdata(dev); \
652 return sysfs_emit(buf, "%u\n", this_leaf->object); \
665 struct cacheinfo *this_leaf = dev_get_drvdata(dev); in size_show() local
667 return sysfs_emit(buf, "%uK\n", this_leaf->size >> 10); in size_show()
673 struct cacheinfo *this_leaf = dev_get_drvdata(dev); in shared_cpu_map_show() local
674 const struct cpumask *mask = &this_leaf->shared_cpu_map; in shared_cpu_map_show()
682 struct cacheinfo *this_leaf = dev_get_drvdata(dev); in shared_cpu_list_show() local
683 const struct cpumask *mask = &this_leaf->shared_cpu_map; in shared_cpu_list_show()
691 struct cacheinfo *this_leaf = dev_get_drvdata(dev); in type_show() local
694 switch (this_leaf->type) { in type_show()
714 struct cacheinfo *this_leaf = dev_get_drvdata(dev); in allocation_policy_show() local
715 unsigned int ci_attr = this_leaf->attributes; in allocation_policy_show()
733 struct cacheinfo *this_leaf = dev_get_drvdata(dev); in write_policy_show() local
734 unsigned int ci_attr = this_leaf->attributes; in write_policy_show()
778 struct cacheinfo *this_leaf = dev_get_drvdata(dev); in cache_default_attrs_is_visible() local
779 const struct cpumask *mask = &this_leaf->shared_cpu_map; in cache_default_attrs_is_visible()
782 if ((attr == &dev_attr_id.attr) && (this_leaf->attributes & CACHE_ID)) in cache_default_attrs_is_visible()
784 if ((attr == &dev_attr_type.attr) && this_leaf->type) in cache_default_attrs_is_visible()
786 if ((attr == &dev_attr_level.attr) && this_leaf->level) in cache_default_attrs_is_visible()
793 this_leaf->coherency_line_size) in cache_default_attrs_is_visible()
796 this_leaf->size) /* allow 0 = full associativity */ in cache_default_attrs_is_visible()
799 this_leaf->number_of_sets) in cache_default_attrs_is_visible()
801 if ((attr == &dev_attr_size.attr) && this_leaf->size) in cache_default_attrs_is_visible()
804 (this_leaf->attributes & CACHE_WRITE_POLICY_MASK)) in cache_default_attrs_is_visible()
807 (this_leaf->attributes & CACHE_ALLOCATE_POLICY_MASK)) in cache_default_attrs_is_visible()
810 this_leaf->physical_line_partition) in cache_default_attrs_is_visible()
833 __weak cache_get_priv_group(struct cacheinfo *this_leaf) in cache_get_priv_group() argument
839 cache_get_attribute_groups(struct cacheinfo *this_leaf) in cache_get_attribute_groups() argument
842 cache_get_priv_group(this_leaf); in cache_get_attribute_groups()
902 struct cacheinfo *this_leaf; in cache_add_dev() local
911 this_leaf = per_cpu_cacheinfo_idx(cpu, i); in cache_add_dev()
912 if (this_leaf->disable_sysfs) in cache_add_dev()
914 if (this_leaf->type == CACHE_TYPE_NOCACHE) in cache_add_dev()
916 cache_groups = cache_get_attribute_groups(this_leaf); in cache_add_dev()
917 ci_dev = cpu_device_create(parent, this_leaf, cache_groups, in cache_add_dev()