Skip to content

Commit 94c0b01

Browse files
cpackham-atlnzmpe
authored andcommitted
powerpc/setup_64: Set cache-line-size based on cache-block-size
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 (5a61ef7 ("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: bd067f8 ("powerpc/64: Fix naming of cache block vs. cache line") Cc: [email protected] # v4.11+ Signed-off-by: Chris Packham <[email protected]> Reported-by: Qian Cai <[email protected]> [mpe: Add even more detail to change log] Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent ae83d0b commit 94c0b01

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

arch/powerpc/kernel/setup_64.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -534,6 +534,8 @@ static bool __init parse_cache_info(struct device_node *np,
534534
lsizep = of_get_property(np, propnames[3], NULL);
535535
if (bsizep == NULL)
536536
bsizep = lsizep;
537+
if (lsizep == NULL)
538+
lsizep = bsizep;
537539
if (lsizep != NULL)
538540
lsize = be32_to_cpu(*lsizep);
539541
if (bsizep != NULL)

0 commit comments

Comments
 (0)