Skip to content

Commit 6fb43f6

Browse files
GuEe-GUIRbb666
authored andcommitted
[PHY/OFW] Fixup the phy link up waiting forever
Signed-off-by: GuEe-GUI <2991707448@qq.com>
1 parent 04af612 commit 6fb43f6

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

components/drivers/phy/general.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,22 +172,23 @@ int rt_genphy_update_link(struct rt_phy_device *phydev)
172172
!(mii_reg & RT_BMSR_ANEGCOMPLETE))
173173
{
174174
int i = 0;
175-
rt_kprintf("Waiting for PHY auto negotiation to complete");
175+
LOG_I("Waiting for PHY auto negotiation to complete");
176176
while (!(mii_reg & RT_BMSR_ANEGCOMPLETE))
177177
{
178178

179179
if (i > (RT_PHY_ANEG_TIMEOUT))
180180
{
181-
LOG_E(" TIMEOUT !\n");
181+
LOG_E(" TIMEOUT!");
182182
phydev->link = 0;
183183
return -ETIMEDOUT;
184184
}
185185

186186
mii_reg = rt_phy_read(phydev, RT_MDIO_DEVAD_NONE, RT_MII_BMSR);
187187

188188
rt_thread_delay(100);
189+
i += 100;
189190
}
190-
LOG_D(" done\n");
191+
LOG_D(" Done");
191192
phydev->link = 1;
192193
} else {
193194
mii_reg = rt_phy_read(phydev, RT_MDIO_DEVAD_NONE, RT_MII_BMSR);

0 commit comments

Comments
 (0)