Skip to content

Commit 4ebc963

Browse files
TomzBenchfabiobaltieri
authored andcommitted
drivers: eth: gmac: Fixed ethernet startup when fixed-link
When upgrading to version 3.4, our hardware lost ethernet connectivity. Our hardware assumes a fixed link and does not communicate with the underlying phy via the mdio bus. I confirmed that the atsame54_xpro board also will lose ethernet functionality when the atsame54_xpro configures the phy via to use a fixed link... The eth_sam_gmac driver changed the initialization behavior to call net_if_carrier_off and notes to wait until phy link is up (via callback.) However, when in a fixed link configuration, the callback is never called. So the net_if_carrier_on event never occurs. This patch adds a check to see if link is up already before calling net_if_carrior_off. This check works because in fixed-link mode, link-up is set synchronously during phy driver initialization. I tested that atsame54_xpro with fixed-link configuration will now work after this patch. Signed-off-by: Thomas Chiantia <[email protected]>
1 parent ee588ba commit 4ebc963

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/ethernet/eth_sam_gmac.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1973,7 +1973,9 @@ static void eth0_iface_init(struct net_if *iface)
19731973
}
19741974

19751975
/* Do not start the interface until PHY link is up */
1976-
net_if_carrier_off(iface);
1976+
if (!(dev_data->link_up)) {
1977+
net_if_carrier_off(iface);
1978+
}
19771979

19781980
init_done = true;
19791981
}

0 commit comments

Comments
 (0)