Skip to contentSkip to conversation

net: mvneta: Round up top tx buffer boundaries for dcache ops

PATCH New Stefan Roese 2 participants 2 messages Aug 25, 2016 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: mvneta: Round up top tx buffer boundaries for dcache ops

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

Cc Joe Hershberger <[email protected]>
---
 drivers/net/mvneta.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/mvneta.c +2 -1
index fa20f54..c23fe9a 100644
@@ -1506,7 +1506,8 @@ static int mvneta_send(struct udevice *dev, void *packet, int length)
 
 	tx_desc->buf_phys_addr = (u32)packet;
 	tx_desc->data_size = length;
-	flush_dcache_range((u32)packet, (u32)packet + length);
+	flush_dcache_range((u32)packet,
+			   (u32)packet + ALIGN(length, PKTALIGN));
 
 	/* First and Last descriptor */
 	tx_desc->command = MVNETA_TX_L4_CSUM_NOT | MVNETA_TXD_FLZ_DESC;
Signature · 1 line
2.9.3
#1 lore raw

PATCH 1/1 net: mvneta: Round up top tx buffer boundaries for dcache ops

Quoted 9 lines · Stefan Roese

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

Cc Joe Hershberger <[email protected]>