Home Home > GIT Browse > stable
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2019-02-12 22:18:26 +0100
committerJiri Slaby <jslaby@suse.cz>2019-02-12 22:21:33 +0100
commit4cde04542bb0f907eb800883835f3ae35289c68e (patch)
tree55fa15746a79b3106548e9b207e736a20fc675b5
parent64a8c99980431c72c42795e7bbb7055369763d47 (diff)
cacheinfo: Keep the old value if of_property_read_u32 fails
-rw-r--r--patches.kernel.org/4.20.8-342-cacheinfo-Keep-the-old-value-if-of_property_re.patch52
-rw-r--r--series.conf1
2 files changed, 53 insertions, 0 deletions
diff --git a/patches.kernel.org/4.20.8-342-cacheinfo-Keep-the-old-value-if-of_property_re.patch b/patches.kernel.org/4.20.8-342-cacheinfo-Keep-the-old-value-if-of_property_re.patch
new file mode 100644
index 0000000000..0d97acdfc2
--- /dev/null
+++ b/patches.kernel.org/4.20.8-342-cacheinfo-Keep-the-old-value-if-of_property_re.patch
@@ -0,0 +1,52 @@
+From: Huacai Chen <chenhc@lemote.com>
+Date: Wed, 19 Dec 2018 16:16:03 +0800
+Subject: [PATCH] cacheinfo: Keep the old value if of_property_read_u32 fails
+References: bnc#1012628
+Patch-mainline: 4.20.8
+Git-commit: 3a34c986324c07dde32903f7bb262e6138e77c2a
+
+commit 3a34c986324c07dde32903f7bb262e6138e77c2a upstream.
+
+Commit 448a5a552f336bd7b847b1951 ("drivers: base: cacheinfo: use OF
+property_read_u32 instead of get_property,read_number") makes cache
+size and number_of_sets be 0 if DT doesn't provide there values. I
+think this is unreasonable so make them keep the old values, which is
+the same as old kernels.
+
+Fixes: 448a5a552f33 ("drivers: base: cacheinfo: use OF property_read_u32 instead of get_property,read_number")
+Cc: stable@vger.kernel.org
+Signed-off-by: Huacai Chen <chenhc@lemote.com>
+Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
+---
+ drivers/base/cacheinfo.c | 6 ++----
+ 1 file changed, 2 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/base/cacheinfo.c b/drivers/base/cacheinfo.c
+index cf78fa6d470d..a7359535caf5 100644
+--- a/drivers/base/cacheinfo.c
++++ b/drivers/base/cacheinfo.c
+@@ -79,8 +79,7 @@ static void cache_size(struct cacheinfo *this_leaf, struct device_node *np)
+ ct_idx = get_cacheinfo_idx(this_leaf->type);
+ propname = cache_type_info[ct_idx].size_prop;
+
+- if (of_property_read_u32(np, propname, &this_leaf->size))
+- this_leaf->size = 0;
++ of_property_read_u32(np, propname, &this_leaf->size);
+ }
+
+ /* not cache_line_size() because that's a macro in include/linux/cache.h */
+@@ -114,8 +113,7 @@ static void cache_nr_sets(struct cacheinfo *this_leaf, struct device_node *np)
+ ct_idx = get_cacheinfo_idx(this_leaf->type);
+ propname = cache_type_info[ct_idx].nr_sets_prop;
+
+- if (of_property_read_u32(np, propname, &this_leaf->number_of_sets))
+- this_leaf->number_of_sets = 0;
++ of_property_read_u32(np, propname, &this_leaf->number_of_sets);
+ }
+
+ static void cache_associativity(struct cacheinfo *this_leaf)
+--
+2.20.1
+
diff --git a/series.conf b/series.conf
index 395738c716..9289fd71e1 100644
--- a/series.conf
+++ b/series.conf
@@ -1078,6 +1078,7 @@
patches.kernel.org/4.20.8-339-serial-fix-race-between-flush_to_ldisc-and-tty.patch
patches.kernel.org/4.20.8-340-serial-8250_pci-Make-PCI-class-test-non-fatal.patch
patches.kernel.org/4.20.8-341-serial-sh-sci-Do-not-free-irqs-that-have-alrea.patch
+ patches.kernel.org/4.20.8-342-cacheinfo-Keep-the-old-value-if-of_property_re.patch
########################################################
# Build fixes that apply to the vanilla kernel too.