aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/cacheinfo.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-01-02 14:56:51 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-01-02 14:56:51 +0100
commit8c9076b07c99c2a37a96b9f5265e4def47823c86 (patch)
tree368e59df54d7b7ea02d8a626ac85e751883f6836 /drivers/base/cacheinfo.c
parentcomponent: add debugfs support (diff)
parentLinux 4.15-rc6 (diff)
downloadlinux-dev-8c9076b07c99c2a37a96b9f5265e4def47823c86.tar.xz
linux-dev-8c9076b07c99c2a37a96b9f5265e4def47823c86.zip
Merge 4.15-rc6 into driver-core-next
We want the fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/base/cacheinfo.c')
-rw-r--r--drivers/base/cacheinfo.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/base/cacheinfo.c b/drivers/base/cacheinfo.c
index 6e1000bff481..edf726267282 100644
--- a/drivers/base/cacheinfo.c
+++ b/drivers/base/cacheinfo.c
@@ -175,6 +175,11 @@ static void cache_associativity(struct cacheinfo *this_leaf)
this_leaf->ways_of_associativity = (size / nr_sets) / line_size;
}
+static bool cache_node_is_unified(struct cacheinfo *this_leaf)
+{
+ return of_property_read_bool(this_leaf->of_node, "cache-unified");
+}
+
static void cache_of_override_properties(unsigned int cpu)
{
int index;
@@ -183,6 +188,14 @@ static void cache_of_override_properties(unsigned int cpu)
for (index = 0; index < cache_leaves(cpu); index++) {
this_leaf = this_cpu_ci->info_list + index;
+ /*
+ * init_cache_level must setup the cache level correctly
+ * overriding the architecturally specified levels, so
+ * if type is NONE at this stage, it should be unified
+ */
+ if (this_leaf->type == CACHE_TYPE_NOCACHE &&
+ cache_node_is_unified(this_leaf))
+ this_leaf->type = CACHE_TYPE_UNIFIED;
cache_size(this_leaf);
cache_get_line_size(this_leaf);
cache_nr_sets(this_leaf);