aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/cacheinfo.c
diff options
context:
space:
mode:
authorSudeep Holla <sudeep.holla@arm.com>2016-10-28 04:45:29 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-11-10 11:30:53 -0500
commit55877ef45fbd7f975d078426866b7d1a2435dcc3 (patch)
treec791d36d55f1559863bee0c42518360c2cdf2b75 /drivers/base/cacheinfo.c
parentfac51482577d5e05bbb0efa8d602a3c2111098bf (diff)
drivers: base: cacheinfo: fix boot error message when acpi is enabled
ARM64 enables both CONFIG_OF and CONFIG_ACPI and the firmware can pass both ACPI tables and the device tree. Based on the kernel parameter, one of the two will be chosen. If acpi is enabled, then device tree is not unflattened. Currently ARM64 platforms report: " Failed to find cpu0 device node Unable to detect cache hierarchy from DT for CPU 0 " which is incorrect when booting with ACPI. Also latest ACPI v6.1 has no support for cache properties/hierarchy. This patch adds check for unflattened device tree and also returns as "not supported" if ACPI is runtime enabled. It also removes the reference to DT from the error message as the cache hierarchy can be detected from the firmware(OF/DT/ACPI) Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/base/cacheinfo.c')
-rw-r--r--drivers/base/cacheinfo.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/base/cacheinfo.c b/drivers/base/cacheinfo.c
index ecde8957835a..70e13cf06ed0 100644
--- a/drivers/base/cacheinfo.c
+++ b/drivers/base/cacheinfo.c
@@ -16,6 +16,7 @@
16 * You should have received a copy of the GNU General Public License 16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>. 17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */ 18 */
19#include <linux/acpi.h>
19#include <linux/bitops.h> 20#include <linux/bitops.h>
20#include <linux/cacheinfo.h> 21#include <linux/cacheinfo.h>
21#include <linux/compiler.h> 22#include <linux/compiler.h>
@@ -104,12 +105,16 @@ static int cache_shared_cpu_map_setup(unsigned int cpu)
104 struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu); 105 struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu);
105 struct cacheinfo *this_leaf, *sib_leaf; 106 struct cacheinfo *this_leaf, *sib_leaf;
106 unsigned int index; 107 unsigned int index;
107 int ret; 108 int ret = 0;
108 109
109 if (this_cpu_ci->cpu_map_populated) 110 if (this_cpu_ci->cpu_map_populated)
110 return 0; 111 return 0;
111 112
112 ret = cache_setup_of_node(cpu); 113 if (of_have_populated_dt())
114 ret = cache_setup_of_node(cpu);
115 else if (!acpi_disabled)
116 /* No cache property/hierarchy support yet in ACPI */
117 ret = -ENOTSUPP;
113 if (ret) 118 if (ret)
114 return ret; 119 return ret;
115 120
@@ -206,8 +211,7 @@ static int detect_cache_attributes(unsigned int cpu)
206 */ 211 */
207 ret = cache_shared_cpu_map_setup(cpu); 212 ret = cache_shared_cpu_map_setup(cpu);
208 if (ret) { 213 if (ret) {
209 pr_warn("Unable to detect cache hierarchy from DT for CPU %d\n", 214 pr_warn("Unable to detect cache hierarchy for CPU %d\n", cpu);
210 cpu);
211 goto free_ci; 215 goto free_ci;
212 } 216 }
213 return 0; 217 return 0;