diff mbox

[U-Boot,v1,02/41] net: mvpp2: Round up top tx buffer boundaries for dcache ops

Message ID 20170321142802.24276-3-sr@denx.de
State Accepted
Commit f811e04ad76019fccb79c8ac2c84a4e84ebef5fd
Delegated to: Stefan Roese
Headers show

Commit Message

Stefan Roese March 21, 2017, 2:27 p.m. UTC
check_cache_range() warns that the top boundaries are not properly
aligned when flushing or invalidating the buffers and make these
operations fail.

This gets rid of the warnings:
CACHE: Misaligned operation at range ...

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Joe Hershberger <joe.hershberger@ni.com>
---

 drivers/net/mvpp2.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Joe Hershberger March 21, 2017, 4:55 p.m. UTC | #1
On Tue, Mar 21, 2017 at 9:27 AM, Stefan Roese <sr@denx.de> wrote:
> check_cache_range() warns that the top boundaries are not properly
> aligned when flushing or invalidating the buffers and make these
> operations fail.
>
> This gets rid of the warnings:
> CACHE: Misaligned operation at range ...
>
> Signed-off-by: Stefan Roese <sr@denx.de>
> Cc: Joe Hershberger <joe.hershberger@ni.com>

Acked-by: Joe Hershberger <joe.hershberger@ni.com>
diff mbox

Patch

diff --git a/drivers/net/mvpp2.c b/drivers/net/mvpp2.c
index 88e88b903b..93eb1f2dd4 100644
--- a/drivers/net/mvpp2.c
+++ b/drivers/net/mvpp2.c
@@ -3972,7 +3972,8 @@  static int mvpp2_send(struct udevice *dev, void *packet, int length)
 		| MVPP2_TXD_F_DESC | MVPP2_TXD_L_DESC;
 
 	/* Flush tx data */
-	flush_dcache_range((u32)packet, (u32)packet + length);
+	flush_dcache_range((unsigned long)packet,
+			   (unsigned long)packet + ALIGN(length, PKTALIGN));
 
 	/* Enable transmit */
 	mb();