OSDN Git Service

riscv: errata: thead: only set cbom size & noncoherent during boot
authorJisheng Zhang <jszhang@kernel.org>
Wed, 14 Jun 2023 16:55:02 +0000 (00:55 +0800)
committerPalmer Dabbelt <palmer@rivosinc.com>
Thu, 6 Jul 2023 17:32:03 +0000 (10:32 -0700)
The CBOM size and whether the HW is noncoherent is known and
determined during booting and won't change after that.

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://lore.kernel.org/r/20230614165504.532-2-jszhang@kernel.org
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
arch/riscv/errata/thead/errata.c

index c259dc9..be84b14 100644 (file)
@@ -45,8 +45,11 @@ static bool errata_probe_cmo(unsigned int stage,
        if (stage == RISCV_ALTERNATIVES_EARLY_BOOT)
                return false;
 
-       riscv_cbom_block_size = L1_CACHE_BYTES;
-       riscv_noncoherent_supported();
+       if (stage == RISCV_ALTERNATIVES_BOOT) {
+               riscv_cbom_block_size = L1_CACHE_BYTES;
+               riscv_noncoherent_supported();
+       }
+
        return true;
 }