aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Packham <chris.packham@alliedtelesis.co.nz>2020-04-17 10:19:08 +1200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-04-29 16:33:20 +0200
commitdba6465408b8bf58d29beb3ac74a2c9fe93c2737 (patch)
tree7f9e8f257b7b3b9c6a07430e4755b51022f8fe1a
parent921b7b175605f04d3ca9acfdd110505cbcbd0b14 (diff)
downloadlinux-yocto-dba6465408b8bf58d29beb3ac74a2c9fe93c2737.tar.gz
linux-yocto-dba6465408b8bf58d29beb3ac74a2c9fe93c2737.tar.bz2
linux-yocto-dba6465408b8bf58d29beb3ac74a2c9fe93c2737.zip
powerpc/setup_64: Set cache-line-size based on cache-block-size
commit 94c0b013c98583614e1ad911e8795ca36da34a85 upstream. If {i,d}-cache-block-size is set and {i,d}-cache-line-size is not, use the block-size value for both. Per the devicetree spec cache-line-size is only needed if it differs from the block size. Originally the code would fallback from block size to line size. An error message was printed if both properties were missing. Later the code was refactored to use clearer names and logic but it inadvertently made line size a required property, meaning on systems without a line size property we fall back to the default from the cputable. On powernv (OPAL) platforms, since the introduction of device tree CPU features (5a61ef74f269 ("powerpc/64s: Support new device tree binding for discovering CPU features")), that has led to the wrong value being used, as the fallback value is incorrect for Power8/Power9 CPUs. The incorrect values flow through to the VDSO and also to the sysconf values, SC_LEVEL1_ICACHE_LINESIZE etc. Fixes: bd067f83b084 ("powerpc/64: Fix naming of cache block vs. cache line") Cc: stable@vger.kernel.org # v4.11+ Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz> Reported-by: Qian Cai <cai@lca.pw> [mpe: Add even more detail to change log] Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20200416221908.7886-1-chris.packham@alliedtelesis.co.nz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--arch/powerpc/kernel/setup_64.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index d7ff21316cfa..e50fbed36651 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -541,6 +541,8 @@ static bool __init parse_cache_info(struct device_node *np,
lsizep = of_get_property(np, propnames[3], NULL);
if (bsizep == NULL)
bsizep = lsizep;
+ if (lsizep == NULL)
+ lsizep = bsizep;
if (lsizep != NULL)
lsize = be32_to_cpu(*lsizep);
if (bsizep != NULL)