aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/cacheinfo.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/base/cacheinfo.c b/drivers/base/cacheinfo.c
index 6e64563361f0..9c2ba1c97c42 100644
--- a/drivers/base/cacheinfo.c
+++ b/drivers/base/cacheinfo.c
@@ -62,15 +62,21 @@ static int cache_setup_of_node(unsigned int cpu)
62 return -ENOENT; 62 return -ENOENT;
63 } 63 }
64 64
65 while (np && index < cache_leaves(cpu)) { 65 while (index < cache_leaves(cpu)) {
66 this_leaf = this_cpu_ci->info_list + index; 66 this_leaf = this_cpu_ci->info_list + index;
67 if (this_leaf->level != 1) 67 if (this_leaf->level != 1)
68 np = of_find_next_cache_node(np); 68 np = of_find_next_cache_node(np);
69 else 69 else
70 np = of_node_get(np);/* cpu node itself */ 70 np = of_node_get(np);/* cpu node itself */
71 if (!np)
72 break;
71 this_leaf->of_node = np; 73 this_leaf->of_node = np;
72 index++; 74 index++;
73 } 75 }
76
77 if (index != cache_leaves(cpu)) /* not all OF nodes populated */
78 return -ENOENT;
79
74 return 0; 80 return 0;
75} 81}
76 82
@@ -189,8 +195,11 @@ static int detect_cache_attributes(unsigned int cpu)
189 * will be set up here only if they are not populated already 195 * will be set up here only if they are not populated already
190 */ 196 */
191 ret = cache_shared_cpu_map_setup(cpu); 197 ret = cache_shared_cpu_map_setup(cpu);
192 if (ret) 198 if (ret) {
199 pr_warn("Unable to detect cache hierarcy from DT for CPU %d\n",
200 cpu);
193 goto free_ci; 201 goto free_ci;
202 }
194 return 0; 203 return 0;
195 204
196free_ci: 205free_ci: