]> Git Repo - u-boot.git/commitdiff
ARM: cache: Fix incorrect bitwise operation
authorMarek Vasut <[email protected]>
Wed, 13 Feb 2019 20:50:25 +0000 (21:50 +0100)
committerMarek Vasut <[email protected]>
Mon, 25 Feb 2019 15:07:36 +0000 (16:07 +0100)
The loop implemented in the code is supposed to check whether the
PL310 operation register has any bit from the mask set. Currently,
the code checks whether the PL310 operation register has any bit
set AND whether the mask is non-zero, which is incorrect. Fix the
conditional.

Signed-off-by: Marek Vasut <[email protected]>
Cc: Dalon Westergreen <[email protected]>
Cc: Dinh Nguyen <[email protected]>
Cc: Tom Rini <[email protected]>
Fixes: 93bc21930a1b ("armv7: add PL310 support to u-boot")
arch/arm/lib/cache-pl310.c

index 1296ba6efda0b7480af39a2ef69384b42e50afaf..bbaaaa4157a5e79b07766ecf4970ebb4395e9c96 100644 (file)
@@ -33,7 +33,7 @@ static void pl310_background_op_all_ways(u32 *op_reg)
        /* Invalidate all ways */
        writel(way_mask, op_reg);
        /* Wait for all ways to be invalidated */
-       while (readl(op_reg) && way_mask)
+       while (readl(op_reg) & way_mask)
                ;
        pl310_cache_sync();
 }
This page took 0.035185 seconds and 4 git commands to generate.