Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1510966 > unrolled thread

[PATCH 0/4] drivers: base: cacheinfo: fixes/updates

Started bySudeep Holla <sudeep.holla@arm.com>
First post2016-10-28 10:50 +0200
Last post2016-10-28 10:50 +0200
Articles 2 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH 0/4] drivers: base: cacheinfo: fixes/updates Sudeep Holla <sudeep.holla@arm.com> - 2016-10-28 10:50 +0200
    [PATCH 1/4] drivers: base: cacheinfo: fix x86 with CONFIG_OF enabled Sudeep Holla <sudeep.holla@arm.com> - 2016-10-28 10:50 +0200

#1510966 — [PATCH 0/4] drivers: base: cacheinfo: fixes/updates

FromSudeep Holla <sudeep.holla@arm.com>
Date2016-10-28 10:50 +0200
Subject[PATCH 0/4] drivers: base: cacheinfo: fixes/updates
Message-ID<sxb1o-5Wd-13@gated-at.bofh.it>
Hi Greg,

Since the couple of fixes here are not too severe, I am considering as
updates only.

Now the x86 allow CONFIG_OF to be enabled and ACPI on arm64, we have
couple of minor bugs in those configurations. The first 2 patches fixes
them. The 3rd patch is cosmetic update to help identify the logs easily.

The last patch adds the basic support for overriding cache properties
using the device tree.

Regards,
Sudeep

Sudeep Holla (4):
  drivers: base: cacheinfo: fix x86 with CONFIG_OF enabled
  drivers: base: cacheinfo: fix boot error message when acpi is enabled
  drivers: base: cacheinfo: add pr_fmt logging
  drivers: base: cacheinfo: support DT overrides for cache properties

 arch/x86/kernel/cpu/intel_cacheinfo.c |   2 +
 drivers/base/cacheinfo.c              | 138 +++++++++++++++++++++++++++++++++-
 include/linux/cacheinfo.h             |   1 +
 3 files changed, 137 insertions(+), 4 deletions(-)

-- 
2.7.4

[toc] | [next] | [standalone]


#1510967 — [PATCH 1/4] drivers: base: cacheinfo: fix x86 with CONFIG_OF enabled

FromSudeep Holla <sudeep.holla@arm.com>
Date2016-10-28 10:50 +0200
Subject[PATCH 1/4] drivers: base: cacheinfo: fix x86 with CONFIG_OF enabled
Message-ID<sxb1o-5Wd-23@gated-at.bofh.it>
In reply to#1510966
With CONFIG_OF enabled on x86, we get the following error on boot:
"
	Failed to find cpu0 device node
 	Unable to detect cache hierarchy from DT for CPU 0
"
and the cacheinfo fails to get populated in the corresponding sysfs
entries. This is because cache_setup_of_node looks for of_node for
setting up the shared cpu_map without checking that it's already
populated in the architecture specific callback.

In order to indicate that the shared cpu_map is already populated, this
patch introduces a boolean `cpu_map_populated` in struct cpu_cacheinfo
that can be used by the generic code to skip cache_shared_cpu_map_setup.

This patch also sets that boolean for x86.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
---
 arch/x86/kernel/cpu/intel_cacheinfo.c | 2 ++
 drivers/base/cacheinfo.c              | 3 +++
 include/linux/cacheinfo.h             | 1 +
 3 files changed, 6 insertions(+)

diff --git a/arch/x86/kernel/cpu/intel_cacheinfo.c b/arch/x86/kernel/cpu/intel_cacheinfo.c
index de6626c18e42..be6337156502 100644
--- a/arch/x86/kernel/cpu/intel_cacheinfo.c
+++ b/arch/x86/kernel/cpu/intel_cacheinfo.c
@@ -934,6 +934,8 @@ static int __populate_cache_leaves(unsigned int cpu)
 		ci_leaf_init(this_leaf++, &id4_regs);
 		__cache_cpumap_setup(cpu, idx, &id4_regs);
 	}
+	this_cpu_ci->cpu_map_populated = true;
+
 	return 0;
 }
 
diff --git a/drivers/base/cacheinfo.c b/drivers/base/cacheinfo.c
index e9fd32e91668..ecde8957835a 100644
--- a/drivers/base/cacheinfo.c
+++ b/drivers/base/cacheinfo.c
@@ -106,6 +106,9 @@ static int cache_shared_cpu_map_setup(unsigned int cpu)
 	unsigned int index;
 	int ret;
 
+	if (this_cpu_ci->cpu_map_populated)
+		return 0;
+
 	ret = cache_setup_of_node(cpu);
 	if (ret)
 		return ret;
diff --git a/include/linux/cacheinfo.h b/include/linux/cacheinfo.h
index 2189935075b4..a951fd10aaaa 100644
--- a/include/linux/cacheinfo.h
+++ b/include/linux/cacheinfo.h
@@ -71,6 +71,7 @@ struct cpu_cacheinfo {
 	struct cacheinfo *info_list;
 	unsigned int num_levels;
 	unsigned int num_leaves;
+	bool cpu_map_populated;
 };
 
 /*
-- 
2.7.4

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web