You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by da...@apache.org on 2022/08/11 07:40:32 UTC

[incubator-nuttx] branch master updated: arch/arm/stm32f7: fix cache invalidation issue in Ethernet RX

This is an automated email from the ASF dual-hosted git repository.

davids5 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 27fe5a50c6 arch/arm/stm32f7: fix cache invalidation issue in Ethernet RX
27fe5a50c6 is described below

commit 27fe5a50c68387f83644d47c9e27b00b861cfe87
Author: Petro Karashchenko <pe...@gmail.com>
AuthorDate: Thu Aug 11 01:03:17 2022 +0200

    arch/arm/stm32f7: fix cache invalidation issue in Ethernet RX
    
    Signed-off-by: Petro Karashchenko <pe...@gmail.com>
---
 arch/arm/src/stm32f7/stm32_ethernet.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/arch/arm/src/stm32f7/stm32_ethernet.c b/arch/arm/src/stm32f7/stm32_ethernet.c
index ceca359a99..9a68b794dd 100644
--- a/arch/arm/src/stm32f7/stm32_ethernet.c
+++ b/arch/arm/src/stm32f7/stm32_ethernet.c
@@ -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);