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

linguini1 pushed a commit to branch releases/13.1
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 3b9a7e57b026491178b7ebc6fe118789950ce376
Author: Daniel P. Carvalho <[email protected]>
AuthorDate: Mon Sep 21 19:29:52 2026 -0300

    arch/arm/stm32h7: fail the PHY initialization when the reset times out.
    
    When the PHY did not clear the reset bit in time, stm32_phyinit()
    returned the result of the last MDIO read. The bus reads all ones when
    the PHY does not answer yet, and that read succeeds, so the function
    returned OK and the driver went on with its default of 10 Mbps and half
    duplex, while the PHY negotiated 100 Mbps and full duplex. The interface
    was up and could not talk to anyone.
    
    Return -ETIMEDOUT, so that bringing the interface up fails and the
    failure is not hidden.
    
    Signed-off-by: Daniel P. Carvalho <[email protected]>
    Assisted-by: Claude:claude-sonnet-5
---
 arch/arm/src/stm32h7/stm32_ethernet.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/src/stm32h7/stm32_ethernet.c 
b/arch/arm/src/stm32h7/stm32_ethernet.c
index abe6ab20be8..79a20a1931e 100644
--- a/arch/arm/src/stm32h7/stm32_ethernet.c
+++ b/arch/arm/src/stm32h7/stm32_ethernet.c
@@ -3336,7 +3336,7 @@ static int stm32_phyinit(struct stm32_ethmac_s *priv)
   if (to <= 0)
     {
       nerr("ERROR: Phy reset timeout\n");
-      return ret;
+      return -ETIMEDOUT;
     }
   else
     {

Reply via email to