Lines Matching refs:this_leaf
35 static inline bool cache_leaves_are_shared(struct cacheinfo *this_leaf, in cache_leaves_are_shared() argument
38 return sib_leaf->fw_token == this_leaf->fw_token; in cache_leaves_are_shared()
74 static void cache_size(struct cacheinfo *this_leaf, struct device_node *np) in cache_size() argument
79 ct_idx = get_cacheinfo_idx(this_leaf->type); in cache_size()
82 of_property_read_u32(np, propname, &this_leaf->size); in cache_size()
86 static void cache_get_line_size(struct cacheinfo *this_leaf, in cache_get_line_size() argument
91 ct_idx = get_cacheinfo_idx(this_leaf->type); in cache_get_line_size()
102 this_leaf->coherency_line_size = line_size; in cache_get_line_size()
108 static void cache_nr_sets(struct cacheinfo *this_leaf, struct device_node *np) in cache_nr_sets() argument
113 ct_idx = get_cacheinfo_idx(this_leaf->type); in cache_nr_sets()
116 of_property_read_u32(np, propname, &this_leaf->number_of_sets); in cache_nr_sets()
119 static void cache_associativity(struct cacheinfo *this_leaf) in cache_associativity() argument
121 unsigned int line_size = this_leaf->coherency_line_size; in cache_associativity()
122 unsigned int nr_sets = this_leaf->number_of_sets; in cache_associativity()
123 unsigned int size = this_leaf->size; in cache_associativity()
130 this_leaf->ways_of_associativity = (size / nr_sets) / line_size; in cache_associativity()
133 static bool cache_node_is_unified(struct cacheinfo *this_leaf, in cache_node_is_unified() argument
139 static void cache_of_set_props(struct cacheinfo *this_leaf, in cache_of_set_props() argument
147 if (this_leaf->type == CACHE_TYPE_NOCACHE && in cache_of_set_props()
148 cache_node_is_unified(this_leaf, np)) in cache_of_set_props()
149 this_leaf->type = CACHE_TYPE_UNIFIED; in cache_of_set_props()
150 cache_size(this_leaf, np); in cache_of_set_props()
151 cache_get_line_size(this_leaf, np); in cache_of_set_props()
152 cache_nr_sets(this_leaf, np); in cache_of_set_props()
153 cache_associativity(this_leaf); in cache_of_set_props()
159 struct cacheinfo *this_leaf; in cache_setup_of_node() local
180 this_leaf = this_cpu_ci->info_list + index; in cache_setup_of_node()
181 if (this_leaf->level != 1) in cache_setup_of_node()
187 cache_of_set_props(this_leaf, np); in cache_setup_of_node()
188 this_leaf->fw_token = np; in cache_setup_of_node()
199 static inline bool cache_leaves_are_shared(struct cacheinfo *this_leaf, in cache_leaves_are_shared() argument
207 return !(this_leaf->level == 1); in cache_leaves_are_shared()
221 struct cacheinfo *this_leaf, *sib_leaf; in cache_shared_cpu_map_setup() local
239 this_leaf = this_cpu_ci->info_list + index; in cache_shared_cpu_map_setup()
241 if (!cpumask_empty(&this_leaf->shared_cpu_map)) in cache_shared_cpu_map_setup()
244 cpumask_set_cpu(cpu, &this_leaf->shared_cpu_map); in cache_shared_cpu_map_setup()
251 if (cache_leaves_are_shared(this_leaf, sib_leaf)) { in cache_shared_cpu_map_setup()
253 cpumask_set_cpu(i, &this_leaf->shared_cpu_map); in cache_shared_cpu_map_setup()
257 if (this_leaf->coherency_line_size > coherency_max_size) in cache_shared_cpu_map_setup()
258 coherency_max_size = this_leaf->coherency_line_size; in cache_shared_cpu_map_setup()
267 struct cacheinfo *this_leaf, *sib_leaf; in cache_shared_cpu_map_remove() local
271 this_leaf = this_cpu_ci->info_list + index; in cache_shared_cpu_map_remove()
272 for_each_cpu(sibling, &this_leaf->shared_cpu_map) { in cache_shared_cpu_map_remove()
284 cpumask_clear_cpu(sibling, &this_leaf->shared_cpu_map); in cache_shared_cpu_map_remove()
287 of_node_put(this_leaf->fw_token); in cache_shared_cpu_map_remove()
364 struct cacheinfo *this_leaf = dev_get_drvdata(dev); \
365 return sysfs_emit(buf, "%u\n", this_leaf->object); \
378 struct cacheinfo *this_leaf = dev_get_drvdata(dev); in size_show() local
380 return sysfs_emit(buf, "%uK\n", this_leaf->size >> 10); in size_show()
386 struct cacheinfo *this_leaf = dev_get_drvdata(dev); in shared_cpu_map_show() local
387 const struct cpumask *mask = &this_leaf->shared_cpu_map; in shared_cpu_map_show()
395 struct cacheinfo *this_leaf = dev_get_drvdata(dev); in shared_cpu_list_show() local
396 const struct cpumask *mask = &this_leaf->shared_cpu_map; in shared_cpu_list_show()
404 struct cacheinfo *this_leaf = dev_get_drvdata(dev); in type_show() local
407 switch (this_leaf->type) { in type_show()
427 struct cacheinfo *this_leaf = dev_get_drvdata(dev); in allocation_policy_show() local
428 unsigned int ci_attr = this_leaf->attributes; in allocation_policy_show()
446 struct cacheinfo *this_leaf = dev_get_drvdata(dev); in write_policy_show() local
447 unsigned int ci_attr = this_leaf->attributes; in write_policy_show()
491 struct cacheinfo *this_leaf = dev_get_drvdata(dev); in cache_default_attrs_is_visible() local
492 const struct cpumask *mask = &this_leaf->shared_cpu_map; in cache_default_attrs_is_visible()
495 if ((attr == &dev_attr_id.attr) && (this_leaf->attributes & CACHE_ID)) in cache_default_attrs_is_visible()
497 if ((attr == &dev_attr_type.attr) && this_leaf->type) in cache_default_attrs_is_visible()
499 if ((attr == &dev_attr_level.attr) && this_leaf->level) in cache_default_attrs_is_visible()
506 this_leaf->coherency_line_size) in cache_default_attrs_is_visible()
509 this_leaf->size) /* allow 0 = full associativity */ in cache_default_attrs_is_visible()
512 this_leaf->number_of_sets) in cache_default_attrs_is_visible()
514 if ((attr == &dev_attr_size.attr) && this_leaf->size) in cache_default_attrs_is_visible()
517 (this_leaf->attributes & CACHE_WRITE_POLICY_MASK)) in cache_default_attrs_is_visible()
520 (this_leaf->attributes & CACHE_ALLOCATE_POLICY_MASK)) in cache_default_attrs_is_visible()
523 this_leaf->physical_line_partition) in cache_default_attrs_is_visible()
546 __weak cache_get_priv_group(struct cacheinfo *this_leaf) in cache_get_priv_group() argument
552 cache_get_attribute_groups(struct cacheinfo *this_leaf) in cache_get_attribute_groups() argument
555 cache_get_priv_group(this_leaf); in cache_get_attribute_groups()
615 struct cacheinfo *this_leaf; in cache_add_dev() local
625 this_leaf = this_cpu_ci->info_list + i; in cache_add_dev()
626 if (this_leaf->disable_sysfs) in cache_add_dev()
628 if (this_leaf->type == CACHE_TYPE_NOCACHE) in cache_add_dev()
630 cache_groups = cache_get_attribute_groups(this_leaf); in cache_add_dev()
631 ci_dev = cpu_device_create(parent, this_leaf, cache_groups, in cache_add_dev()