All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] ARM: cache: Fix incorrect bitwise operation
@ 2019-02-19  0:43 Marek Vasut
  2019-02-19  8:44 ` Simon Goldschmidt
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Marek Vasut @ 2019-02-19  0:43 UTC (permalink / raw)
  To: u-boot

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 <marex@denx.de>
Cc: Dalon Westergreen <dwesterg@gmail.com>
Cc: Dinh Nguyen <dinguyen@kernel.org>
Cc: Tom Rini <trini@konsulko.com>
Fixes: 93bc21930a1b ("armv7: add PL310 support to u-boot")
---
 arch/arm/lib/cache-pl310.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/lib/cache-pl310.c b/arch/arm/lib/cache-pl310.c
index 1296ba6efd..bbaaaa4157 100644
--- a/arch/arm/lib/cache-pl310.c
+++ b/arch/arm/lib/cache-pl310.c
@@ -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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH] ARM: cache: Fix incorrect bitwise operation
  2019-02-19  0:43 [U-Boot] [PATCH] ARM: cache: Fix incorrect bitwise operation Marek Vasut
@ 2019-02-19  8:44 ` Simon Goldschmidt
  2019-02-25 16:33 ` Dinh Nguyen
  2019-02-28 23:56 ` [U-Boot] " Tom Rini
  2 siblings, 0 replies; 4+ messages in thread
From: Simon Goldschmidt @ 2019-02-19  8:44 UTC (permalink / raw)
  To: u-boot

On Tue, Feb 19, 2019 at 1:44 AM Marek Vasut <marex@denx.de> wrote:
>
> 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 <marex@denx.de>
> Cc: Dalon Westergreen <dwesterg@gmail.com>
> Cc: Dinh Nguyen <dinguyen@kernel.org>
> Cc: Tom Rini <trini@konsulko.com>
> Fixes: 93bc21930a1b ("armv7: add PL310 support to u-boot")

Reviewed-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

> ---
>  arch/arm/lib/cache-pl310.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/arm/lib/cache-pl310.c b/arch/arm/lib/cache-pl310.c
> index 1296ba6efd..bbaaaa4157 100644
> --- a/arch/arm/lib/cache-pl310.c
> +++ b/arch/arm/lib/cache-pl310.c
> @@ -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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH] ARM: cache: Fix incorrect bitwise operation
  2019-02-19  0:43 [U-Boot] [PATCH] ARM: cache: Fix incorrect bitwise operation Marek Vasut
  2019-02-19  8:44 ` Simon Goldschmidt
@ 2019-02-25 16:33 ` Dinh Nguyen
  2019-02-28 23:56 ` [U-Boot] " Tom Rini
  2 siblings, 0 replies; 4+ messages in thread
From: Dinh Nguyen @ 2019-02-25 16:33 UTC (permalink / raw)
  To: u-boot



On 2/18/19 6:43 PM, Marek Vasut wrote:
> 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 <marex@denx.de>
> Cc: Dalon Westergreen <dwesterg@gmail.com>
> Cc: Dinh Nguyen <dinguyen@kernel.org>
> Cc: Tom Rini <trini@konsulko.com>
> Fixes: 93bc21930a1b ("armv7: add PL310 support to u-boot")
> ---
>  arch/arm/lib/cache-pl310.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm/lib/cache-pl310.c b/arch/arm/lib/cache-pl310.c
> index 1296ba6efd..bbaaaa4157 100644
> --- a/arch/arm/lib/cache-pl310.c
> +++ b/arch/arm/lib/cache-pl310.c
> @@ -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!

Reviewed-by: Dinh Nguyen <dinguyen@kernel.org>

Dinh

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot] ARM: cache: Fix incorrect bitwise operation
  2019-02-19  0:43 [U-Boot] [PATCH] ARM: cache: Fix incorrect bitwise operation Marek Vasut
  2019-02-19  8:44 ` Simon Goldschmidt
  2019-02-25 16:33 ` Dinh Nguyen
@ 2019-02-28 23:56 ` Tom Rini
  2 siblings, 0 replies; 4+ messages in thread
From: Tom Rini @ 2019-02-28 23:56 UTC (permalink / raw)
  To: u-boot

On Tue, Feb 19, 2019 at 01:43:51AM +0100, Marek Vasut wrote:

> 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 <marex@denx.de>
> Cc: Dalon Westergreen <dwesterg@gmail.com>
> Cc: Dinh Nguyen <dinguyen@kernel.org>
> Cc: Tom Rini <trini@konsulko.com>
> Fixes: 93bc21930a1b ("armv7: add PL310 support to u-boot")
> Reviewed-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
> Reviewed-by: Dinh Nguyen <dinguyen@kernel.org>

Applied to u-boot/master, thanks!

-- 
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>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-02-28 23:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-19  0:43 [U-Boot] [PATCH] ARM: cache: Fix incorrect bitwise operation Marek Vasut
2019-02-19  8:44 ` Simon Goldschmidt
2019-02-25 16:33 ` Dinh Nguyen
2019-02-28 23:56 ` [U-Boot] " Tom Rini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.