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()
206 struct cacheinfo *this_leaf; in cache_setup_of_node() local
223 this_leaf = per_cpu_cacheinfo_idx(cpu, index); in cache_setup_of_node()
224 if (this_leaf->level != 1) { in cache_setup_of_node()
231 cache_of_set_props(this_leaf, np); in cache_setup_of_node()
232 this_leaf->fw_token = np; in cache_setup_of_node()
360 struct cacheinfo *this_leaf, *sib_leaf; in cache_shared_cpu_map_setup() local
381 this_leaf = per_cpu_cacheinfo_idx(cpu, index); in cache_shared_cpu_map_setup()
383 cpumask_set_cpu(cpu, &this_leaf->shared_cpu_map); in cache_shared_cpu_map_setup()
397 if (sib_leaf->level != this_leaf->level || in cache_shared_cpu_map_setup()
398 sib_leaf->type != this_leaf->type) in cache_shared_cpu_map_setup()
401 if (cache_leaves_are_shared(this_leaf, sib_leaf)) { in cache_shared_cpu_map_setup()
403 cpumask_set_cpu(i, &this_leaf->shared_cpu_map); in cache_shared_cpu_map_setup()
409 if (this_leaf->coherency_line_size > coherency_max_size) in cache_shared_cpu_map_setup()
410 coherency_max_size = this_leaf->coherency_line_size; in cache_shared_cpu_map_setup()
421 struct cacheinfo *this_leaf, *sib_leaf; in cache_shared_cpu_map_remove() local
425 this_leaf = per_cpu_cacheinfo_idx(cpu, index); in cache_shared_cpu_map_remove()
426 for_each_cpu(sibling, &this_leaf->shared_cpu_map) { in cache_shared_cpu_map_remove()
441 if (sib_leaf->level != this_leaf->level || in cache_shared_cpu_map_remove()
442 sib_leaf->type != this_leaf->type) in cache_shared_cpu_map_remove()
445 if (cache_leaves_are_shared(this_leaf, sib_leaf)) { in cache_shared_cpu_map_remove()
447 cpumask_clear_cpu(sibling, &this_leaf->shared_cpu_map); in cache_shared_cpu_map_remove()
619 struct cacheinfo *this_leaf = dev_get_drvdata(dev); \
620 return sysfs_emit(buf, "%u\n", this_leaf->object); \
633 struct cacheinfo *this_leaf = dev_get_drvdata(dev); in size_show() local
635 return sysfs_emit(buf, "%uK\n", this_leaf->size >> 10); in size_show()
641 struct cacheinfo *this_leaf = dev_get_drvdata(dev); in shared_cpu_map_show() local
642 const struct cpumask *mask = &this_leaf->shared_cpu_map; in shared_cpu_map_show()
650 struct cacheinfo *this_leaf = dev_get_drvdata(dev); in shared_cpu_list_show() local
651 const struct cpumask *mask = &this_leaf->shared_cpu_map; in shared_cpu_list_show()
659 struct cacheinfo *this_leaf = dev_get_drvdata(dev); in type_show() local
662 switch (this_leaf->type) { in type_show()
682 struct cacheinfo *this_leaf = dev_get_drvdata(dev); in allocation_policy_show() local
683 unsigned int ci_attr = this_leaf->attributes; in allocation_policy_show()
701 struct cacheinfo *this_leaf = dev_get_drvdata(dev); in write_policy_show() local
702 unsigned int ci_attr = this_leaf->attributes; in write_policy_show()
746 struct cacheinfo *this_leaf = dev_get_drvdata(dev); in cache_default_attrs_is_visible() local
747 const struct cpumask *mask = &this_leaf->shared_cpu_map; in cache_default_attrs_is_visible()
750 if ((attr == &dev_attr_id.attr) && (this_leaf->attributes & CACHE_ID)) in cache_default_attrs_is_visible()
752 if ((attr == &dev_attr_type.attr) && this_leaf->type) in cache_default_attrs_is_visible()
754 if ((attr == &dev_attr_level.attr) && this_leaf->level) in cache_default_attrs_is_visible()
761 this_leaf->coherency_line_size) in cache_default_attrs_is_visible()
764 this_leaf->size) /* allow 0 = full associativity */ in cache_default_attrs_is_visible()
767 this_leaf->number_of_sets) in cache_default_attrs_is_visible()
769 if ((attr == &dev_attr_size.attr) && this_leaf->size) in cache_default_attrs_is_visible()
772 (this_leaf->attributes & CACHE_WRITE_POLICY_MASK)) in cache_default_attrs_is_visible()
775 (this_leaf->attributes & CACHE_ALLOCATE_POLICY_MASK)) in cache_default_attrs_is_visible()
778 this_leaf->physical_line_partition) in cache_default_attrs_is_visible()
801 __weak cache_get_priv_group(struct cacheinfo *this_leaf) in cache_get_priv_group() argument
807 cache_get_attribute_groups(struct cacheinfo *this_leaf) in cache_get_attribute_groups() argument
810 cache_get_priv_group(this_leaf); in cache_get_attribute_groups()
870 struct cacheinfo *this_leaf; in cache_add_dev() local
879 this_leaf = per_cpu_cacheinfo_idx(cpu, i); in cache_add_dev()
880 if (this_leaf->disable_sysfs) in cache_add_dev()
882 if (this_leaf->type == CACHE_TYPE_NOCACHE) in cache_add_dev()
884 cache_groups = cache_get_attribute_groups(this_leaf); in cache_add_dev()
885 ci_dev = cpu_device_create(parent, this_leaf, cache_groups, in cache_add_dev()