On 08.09.22 16:06, Marek Behún wrote:
From: Pali Rohár <p...@kernel.org>

Commit 3308933d2fe9 ("arm: mvebu: Avoid reading MVEBU_REG_PCIE_DEVID
register too many times") broke support for caches on all Armada SoCs.

Before that commit there was code:

     if (mvebu_soc_family() != MVEBU_SOC_A375) {
         dcache_enable();
     }

And after that commit there is code:

     if (IS_ENABLED(CONFIG_ARMADA_375)) {
         dcache_enable();
     }

Comment above this code says that d-cache should be disabled on Armada 375.
But new code inverted logic and broke Armada 375 and slowed down all other
Armada SoCs (including A38x).

Fix this issue by changing logic to:

     if (!IS_ENABLED(CONFIG_ARMADA_375)) {
         dcache_enable();
     }

Which matches behavior prior that commit.

Fixes: 3308933d2fe9 ("arm: mvebu: Avoid reading MVEBU_REG_PCIE_DEVID register too 
many times")
Signed-off-by: Pali Rohár <p...@kernel.org>
Signed-off-by: Marek Behún <ka...@kernel.org>

Reviewed-by: Stefan Roese <s...@denx.de>

Thanks,
Stefan

---
  arch/arm/mach-mvebu/cpu.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-mvebu/cpu.c b/arch/arm/mach-mvebu/cpu.c
index 1457af1d6a..b512ccc501 100644
--- a/arch/arm/mach-mvebu/cpu.c
+++ b/arch/arm/mach-mvebu/cpu.c
@@ -663,7 +663,7 @@ void enable_caches(void)
         * ethernet driver (mvpp2). So lets keep the d-cache disabled
         * until this is solved.
         */
-       if (IS_ENABLED(CONFIG_ARMADA_375)) {
+       if (!IS_ENABLED(CONFIG_ARMADA_375)) {
                /* Enable D-cache. I-cache is already enabled in start.S */
                dcache_enable();
        }

Viele Grüße,
Stefan Roese

--
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: s...@denx.de

Reply via email to