ARM: cache: Fix incorrect bitwise operation
PATCH 1/1 ARM: cache: Fix incorrect bitwise operation
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.
--- arch/arm/lib/cache-pl310.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/lib/cache-pl310.c +1 -1
@@ -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 (); }
Signature · 1 line
2.19.2
PATCH 1/1 ARM: cache: Fix incorrect bitwise operation
Quoted 7 lines · Marek Vasut
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.
Quoted 5 lines
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")
Quoted 19 lines
--- arch/arm/lib/cache-pl310.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/arm/lib/cache-pl310.c +1
-2@@ -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 (); } --2.19.2
PATCH 1/1 ARM: cache: Fix incorrect bitwise operation
In reply to Marek VasutQuoted 21 lines · Marek Vasut
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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/arm/lib/cache-pl310.c +0
-0
arch/arm/lib/cache-pl310.c static void pl310_background_op_all_ways(u32 *op_reg) · line 39
Quoted 8 lines
arch/arm/lib/cache-pl310.c +1
-1@@ -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 (); }
Thanks for fixing this!
Dinh
Quoted 6 lines · Marek Vasut
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.
Quoted 7 lines
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")Reviewed-by Simon Goldschmidt <[email protected]>Reviewed-by Dinh Nguyen <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190228/4725b923/attachment.sig>