summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandru Avadanii <Alexandru.Avadanii@enea.com>2021-07-07 07:58:38 +0200
committerAlexandru Avadanii <Alexandru.Avadanii@enea.com>2021-07-07 08:42:39 +0200
commit347e8b9d3feaddfdc37505b5d4eccfb216307e64 (patch)
tree08f75125ff288857a30af4783d2c604b3e6352c0
parentf86788bac0c8aaa0903aa2ef3b98ec0327a56d5b (diff)
downloadenea-kernel-cache-347e8b9d3feaddfdc37505b5d4eccfb216307e64.tar.gz
features/cpulist_abbrev: Fix "last" usage
Adding support for "63" as an alias for "last", although working with "63", broke support for "last". Note: "last" and "63" cannot be used at the same time in an expression. Fixes: f86788bac0c8aaa0903aa2ef3b98ec0327a56d5b Change-Id: I865b7a9589e9aaf601a2c317201a4b3771db4cd2 Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
-rw-r--r--features/cpulist_abbrev/0001-cpumask-Add-63-alias-for-last-in-cpu-list.patch20
1 files changed, 13 insertions, 7 deletions
diff --git a/features/cpulist_abbrev/0001-cpumask-Add-63-alias-for-last-in-cpu-list.patch b/features/cpulist_abbrev/0001-cpumask-Add-63-alias-for-last-in-cpu-list.patch
index 3ba61df..f77e2fb 100644
--- a/features/cpulist_abbrev/0001-cpumask-Add-63-alias-for-last-in-cpu-list.patch
+++ b/features/cpulist_abbrev/0001-cpumask-Add-63-alias-for-last-in-cpu-list.patch
@@ -1,4 +1,4 @@
1From c52f05fb623b0e12c2c91aec6d02c7bd6f6cab0b Mon Sep 17 00:00:00 2001 1From eae01ebd0607f0ae29604508b27d177e0d01799b Mon Sep 17 00:00:00 2001
2From: Alexandru Avadanii <Alexandru.Avadanii@enea.com> 2From: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
3Date: Tue, 6 Jul 2021 10:39:05 +0000 3Date: Tue, 6 Jul 2021 10:39:05 +0000
4Subject: [PATCH] cpumask: Add "63" alias for "last" in cpu list 4Subject: [PATCH] cpumask: Add "63" alias for "last" in cpu list
@@ -20,6 +20,9 @@ Edge upgrade/downgrade via OSTree deployments and should be
20removed as soon as the proper mechanism for generating kernel args 20removed as soon as the proper mechanism for generating kernel args
21is in place. 21is in place.
22 22
23Note: "last" and "63" (as an alias for "last") cannot be used at
24the same time.
25
23Upstream-Status: Inappropiate [Enea specific] 26Upstream-Status: Inappropiate [Enea specific]
24 27
25[1] https://github.com/torvalds/linux/commit/e22cdc3f 28[1] https://github.com/torvalds/linux/commit/e22cdc3f
@@ -27,14 +30,14 @@ Upstream-Status: Inappropiate [Enea specific]
27 30
28Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com> 31Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
29--- 32---
30 lib/cpumask.c | 9 +++++++++ 33 lib/cpumask.c | 13 ++++++++++++-
31 1 file changed, 9 insertions(+) 34 1 file changed, 12 insertions(+), 1 deletion(-)
32 35
33diff --git a/lib/cpumask.c b/lib/cpumask.c 36diff --git a/lib/cpumask.c b/lib/cpumask.c
34index e4b8a8c252c7..6739a93b4c8d 100644 37index e4b8a8c252c7..1357c10e5b67 100644
35--- a/lib/cpumask.c 38--- a/lib/cpumask.c
36+++ b/lib/cpumask.c 39+++ b/lib/cpumask.c
37@@ -211,9 +211,18 @@ int __ref cpulist_parse(const char *buf, struct cpumask *dstp) 40@@ -211,9 +211,20 @@ int __ref cpulist_parse(const char *buf, struct cpumask *dstp)
38 /* 41 /*
39 * bitmap_parselist has no concept of "last" CPU, so we have to 42 * bitmap_parselist has no concept of "last" CPU, so we have to
40 * replace "last" with a real number in dest copy of the string. 43 * replace "last" with a real number in dest copy of the string.
@@ -48,8 +51,11 @@ index e4b8a8c252c7..6739a93b4c8d 100644
48+ * ENEA_end 51+ * ENEA_end
49 */ 52 */
50 sprintf(last_cpu, "%d", cpumask_last(cpu_present_mask)); 53 sprintf(last_cpu, "%d", cpumask_last(cpu_present_mask));
51 cpulist_replace_token(cpulist, buf, "last", last_cpu); 54- cpulist_replace_token(cpulist, buf, "last", last_cpu);
52+ cpulist_replace_token(cpulist, buf, "63", last_cpu); 55+ if (cpumask_find_token(buf, "last"))
56+ cpulist_replace_token(cpulist, buf, "last", last_cpu);
57+ else
58+ cpulist_replace_token(cpulist, buf, "63", last_cpu);
53 59
54 r = bitmap_parselist(cpulist, cpumask_bits(dstp), nr_cpumask_bits); 60 r = bitmap_parselist(cpulist, cpumask_bits(dstp), nr_cpumask_bits);
55 61