Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2019-07-21 10:23:21 +0200
committerJiri Slaby <jslaby@suse.cz>2019-07-21 10:23:24 +0200
commitb116993c524a71e80e4ad558a1c8f4c1ac9d54b6 (patch)
tree8427dae360c62683c6ab8a02c55507c707bd5c4d
parent1f9e3fe00d2f7d99ae5fe8f6380fccadfc22d6ed (diff)
drivers: base: cacheinfo: Ensure cpu hotplug work is done
before Intel RDT (bnc#1012628).
-rw-r--r--patches.kernel.org/5.2.2-005-drivers-base-cacheinfo-Ensure-cpu-hotplug-work-.patch68
-rw-r--r--series.conf1
2 files changed, 69 insertions, 0 deletions
diff --git a/patches.kernel.org/5.2.2-005-drivers-base-cacheinfo-Ensure-cpu-hotplug-work-.patch b/patches.kernel.org/5.2.2-005-drivers-base-cacheinfo-Ensure-cpu-hotplug-work-.patch
new file mode 100644
index 0000000000..a06f613c91
--- /dev/null
+++ b/patches.kernel.org/5.2.2-005-drivers-base-cacheinfo-Ensure-cpu-hotplug-work-.patch
@@ -0,0 +1,68 @@
+From: James Morse <james.morse@arm.com>
+Date: Mon, 24 Jun 2019 18:36:56 +0100
+Subject: [PATCH] drivers: base: cacheinfo: Ensure cpu hotplug work is done
+ before Intel RDT
+References: bnc#1012628
+Patch-mainline: 5.2.2
+Git-commit: 83b44fe343b5abfcb1b2261289bd0cfcfcfd60a8
+
+commit 83b44fe343b5abfcb1b2261289bd0cfcfcfd60a8 upstream.
+
+The cacheinfo structures are alloced/freed by cpu online/offline
+callbacks. Originally these were only used by sysfs to expose the
+cache topology to user space. Without any in-kernel dependencies
+CPUHP_AP_ONLINE_DYN was an appropriate choice.
+
+resctrl has started using these structures to identify CPUs that
+share a cache. It updates its 'domain' structures from cpu
+online/offline callbacks. These depend on the cacheinfo structures
+(resctrl_online_cpu()->domain_add_cpu()->get_cache_id()->
+ get_cpu_cacheinfo()).
+These also run as CPUHP_AP_ONLINE_DYN.
+
+Now that there is an in-kernel dependency, move the cacheinfo
+work earlier so we know its done before resctrl's CPUHP_AP_ONLINE_DYN
+work runs.
+
+Fixes: 2264d9c74dda1 ("x86/intel_rdt: Build structures for each resource based on cache topology")
+Cc: <stable@vger.kernel.org>
+Cc: Fenghua Yu <fenghua.yu@intel.com>
+Cc: Reinette Chatre <reinette.chatre@intel.com>
+Signed-off-by: James Morse <james.morse@arm.com>
+Link: https://lore.kernel.org/r/20190624173656.202407-1-james.morse@arm.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
+---
+ drivers/base/cacheinfo.c | 3 ++-
+ include/linux/cpuhotplug.h | 1 +
+ 2 files changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/base/cacheinfo.c b/drivers/base/cacheinfo.c
+index a7359535caf5..b444f89a2041 100644
+--- a/drivers/base/cacheinfo.c
++++ b/drivers/base/cacheinfo.c
+@@ -655,7 +655,8 @@ static int cacheinfo_cpu_pre_down(unsigned int cpu)
+
+ static int __init cacheinfo_sysfs_init(void)
+ {
+- return cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, "base/cacheinfo:online",
++ return cpuhp_setup_state(CPUHP_AP_BASE_CACHEINFO_ONLINE,
++ "base/cacheinfo:online",
+ cacheinfo_cpu_online, cacheinfo_cpu_pre_down);
+ }
+ device_initcall(cacheinfo_sysfs_init);
+diff --git a/include/linux/cpuhotplug.h b/include/linux/cpuhotplug.h
+index 5c6062206760..52ec0d9fa1f7 100644
+--- a/include/linux/cpuhotplug.h
++++ b/include/linux/cpuhotplug.h
+@@ -176,6 +176,7 @@ enum cpuhp_state {
+ CPUHP_AP_WATCHDOG_ONLINE,
+ CPUHP_AP_WORKQUEUE_ONLINE,
+ CPUHP_AP_RCUTREE_ONLINE,
++ CPUHP_AP_BASE_CACHEINFO_ONLINE,
+ CPUHP_AP_ONLINE_DYN,
+ CPUHP_AP_ONLINE_DYN_END = CPUHP_AP_ONLINE_DYN + 30,
+ CPUHP_AP_X86_HPET_ONLINE,
+--
+2.22.0
+
diff --git a/series.conf b/series.conf
index 695ac95caa..962d3e6a7d 100644
--- a/series.conf
+++ b/series.conf
@@ -92,6 +92,7 @@
patches.kernel.org/5.2.2-002-e1000e-start-network-tx-queue-only-when-link-is.patch
patches.kernel.org/5.2.2-003-Input-synaptics-enable-SMBUS-on-T480-thinkpad-t.patch
patches.kernel.org/5.2.2-004-nilfs2-do-not-use-unexported-cpu_to_le32-le32_t.patch
+ patches.kernel.org/5.2.2-005-drivers-base-cacheinfo-Ensure-cpu-hotplug-work-.patch
########################################################
# Build fixes that apply to the vanilla kernel too.