Skip to content

Commit 9b97387

Browse files
jlintonarmctmarinas
authored andcommitted
cacheinfo: rename of_node to fw_token
Rename and change the type of of_node to indicate it is a generic pointer which is generally only used for comparison purposes. In a later patch we will put an ACPI/PPTT token pointer in fw_token so that the code which builds the shared cpu masks can be reused. Tested-by: Ard Biesheuvel <[email protected]> Tested-by: Vijaya Kumar K <[email protected]> Tested-by: Xiongfeng Wang <[email protected]> Tested-by: Tomasz Nowicki <[email protected]> Acked-by: Sudeep Holla <[email protected]> Acked-by: Ard Biesheuvel <[email protected]> Acked-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Jeremy Linton <[email protected]> Signed-off-by: Catalin Marinas <[email protected]>
1 parent 2ff075c commit 9b97387

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

drivers/base/cacheinfo.c

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ struct cpu_cacheinfo *get_cpu_cacheinfo(unsigned int cpu)
3535
static inline bool cache_leaves_are_shared(struct cacheinfo *this_leaf,
3636
struct cacheinfo *sib_leaf)
3737
{
38-
return sib_leaf->of_node == this_leaf->of_node;
38+
return sib_leaf->fw_token == this_leaf->fw_token;
3939
}
4040

4141
/* OF properties to query for a given cache type */
@@ -167,9 +167,10 @@ static int cache_setup_of_node(unsigned int cpu)
167167
struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu);
168168
unsigned int index = 0;
169169

170-
/* skip if of_node is already populated */
171-
if (this_cpu_ci->info_list->of_node)
170+
/* skip if fw_token is already populated */
171+
if (this_cpu_ci->info_list->fw_token) {
172172
return 0;
173+
}
173174

174175
if (!cpu_dev) {
175176
pr_err("No cpu device for CPU %d\n", cpu);
@@ -190,7 +191,7 @@ static int cache_setup_of_node(unsigned int cpu)
190191
if (!np)
191192
break;
192193
cache_of_set_props(this_leaf, np);
193-
this_leaf->of_node = np;
194+
this_leaf->fw_token = np;
194195
index++;
195196
}
196197

@@ -278,7 +279,7 @@ static void cache_shared_cpu_map_remove(unsigned int cpu)
278279
cpumask_clear_cpu(cpu, &sib_leaf->shared_cpu_map);
279280
cpumask_clear_cpu(sibling, &this_leaf->shared_cpu_map);
280281
}
281-
of_node_put(this_leaf->of_node);
282+
of_node_put(this_leaf->fw_token);
282283
}
283284
}
284285

@@ -323,8 +324,9 @@ static int detect_cache_attributes(unsigned int cpu)
323324
if (ret)
324325
goto free_ci;
325326
/*
326-
* For systems using DT for cache hierarchy, of_node and shared_cpu_map
327-
* will be set up here only if they are not populated already
327+
* For systems using DT for cache hierarchy, fw_token
328+
* and shared_cpu_map will be set up here only if they are
329+
* not populated already
328330
*/
329331
ret = cache_shared_cpu_map_setup(cpu);
330332
if (ret) {

include/linux/cacheinfo.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,8 @@ enum cache_type {
3434
* @shared_cpu_map: logical cpumask representing all the cpus sharing
3535
* this cache node
3636
* @attributes: bitfield representing various cache attributes
37-
* @of_node: if devicetree is used, this represents either the cpu node in
38-
* case there's no explicit cache node or the cache node itself in the
39-
* device tree
37+
* @fw_token: Unique value used to determine if different cacheinfo
38+
* structures represent a single hardware cache instance.
4039
* @disable_sysfs: indicates whether this node is visible to the user via
4140
* sysfs or not
4241
* @priv: pointer to any private data structure specific to particular
@@ -65,8 +64,7 @@ struct cacheinfo {
6564
#define CACHE_ALLOCATE_POLICY_MASK \
6665
(CACHE_READ_ALLOCATE | CACHE_WRITE_ALLOCATE)
6766
#define CACHE_ID BIT(4)
68-
69-
struct device_node *of_node;
67+
void *fw_token;
7068
bool disable_sysfs;
7169
void *priv;
7270
};

0 commit comments

Comments
 (0)