arch/arm/stm32f7: fix cache invalidation issue in Ethernet RX

Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
This commit is contained in:
Petro Karashchenko 2022-08-11 01:03:17 +02:00 committed by David Sidrane
parent 4cd7e33b8d
commit 27fe5a50c6

View File

@ -219,8 +219,8 @@
# define CONFIG_STM32F7_ETH_NTXDESC 4
#endif
#ifndef min
# define min(a,b) ((a) < (b) ? (a) : (b))
#ifndef MIN
# define MIN(a,b) ((a) < (b) ? (a) : (b))
#endif
/* We need at least one more free buffer than transmit buffers */
@ -1732,7 +1732,8 @@ static int stm32_recvframe(struct stm32_ethmac_s *priv)
*/
up_invalidate_dcache((uintptr_t)dev->d_buf,
min(dev->d_len, ALIGNED_BUFSIZE));
(uintptr_t)dev->d_buf +
MIN(dev->d_len, ALIGNED_BUFSIZE));
ninfo("rxhead: %p d_buf: %p d_len: %d\n",
priv->rxhead, dev->d_buf, dev->d_len);