From 959bf8a245016220c1d9ece011d25505f724cd2a Mon Sep 17 00:00:00 2001 From: Astro Date: Mon, 11 Nov 2019 00:08:05 +0100 Subject: [PATCH] zynq::eth: don't check_link_change if link already established --- src/zynq/eth/mod.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/zynq/eth/mod.rs b/src/zynq/eth/mod.rs index a4a5940..4ab6071 100644 --- a/src/zynq/eth/mod.rs +++ b/src/zynq/eth/mod.rs @@ -507,6 +507,12 @@ impl<'r> EthInner<'r> { fn check_link_change(&mut self, phy: &Phy) { + // As the PHY access takes some time, exit early if there was + // already a link. TODO: check once per second. + if self.link.is_some() { + return + } + let link = phy.get_link(self); // Check link state transition