diff mbox

[U-Boot,2/2] Fix cache misalignment after network load operations

Message ID 20160830011529.13988-2-Peter.Chubb@data61.csiro.au
State Rejected
Delegated to: Joe Hershberger
Headers show

Commit Message

Chubb, Peter (Data61, Eveleigh) Aug. 30, 2016, 1:15 a.m. UTC
After any operation that downloads a file (e.g., pxe get, or dhcp), the
buffer containing the downloaded data is flushed.  This patch rounds
up the flushed size to a cacheline boundary, preventing a cache
misalignment message from u-boot.

Signed-off-by: Peter Chubb <peter.chubb@data61.csiro.au>
---
 cmd/net.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Joe Hershberger Sept. 2, 2016, 1:03 p.m. UTC | #1
Hi Peter,

On Mon, Aug 29, 2016 at 8:15 PM,  <Peter.Chubb@data61.csiro.au> wrote:
> After any operation that downloads a file (e.g., pxe get, or dhcp), the
> buffer containing the downloaded data is flushed.  This patch rounds
> up the flushed size to a cacheline boundary, preventing a cache
> misalignment message from u-boot.
>
> Signed-off-by: Peter Chubb <peter.chubb@data61.csiro.au>
> ---
>  cmd/net.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/cmd/net.c b/cmd/net.c
> index b2f3c7b..540daeb 100644
> --- a/cmd/net.c
> +++ b/cmd/net.c
> @@ -244,7 +244,7 @@ static int netboot_common(enum proto_t proto, cmd_tbl_t *cmdtp, int argc,
>         }
>
>         /* flush cache */
> -       flush_cache(load_addr, size);
> +       flush_cache(load_addr, ALIGN(size, CONFIG_SYS_CACHELINE_SIZE));

I think we would be better off just removing the flush.

Thanks,
-Joe
diff mbox

Patch

diff --git a/cmd/net.c b/cmd/net.c
index b2f3c7b..540daeb 100644
--- a/cmd/net.c
+++ b/cmd/net.c
@@ -244,7 +244,7 @@  static int netboot_common(enum proto_t proto, cmd_tbl_t *cmdtp, int argc,
 	}
 
 	/* flush cache */
-	flush_cache(load_addr, size);
+	flush_cache(load_addr, ALIGN(size, CONFIG_SYS_CACHELINE_SIZE));
 
 	bootstage_mark(BOOTSTAGE_ID_NET_LOADED);