mirror of
https://gitee.com/open-loongarch/linux-6.12.git
synced 2026-10-25 12:37:11 +08:00
net: stmmac: Return early if invalid in loongson_dwmac_fix_reset()
If the MAC controller does not connect to any PHY interface, there is a missing clock, then the DMA reset fails. For this case, the DMA_BUS_MODE_SFT_RESET bit is 1 before software reset, just print an error message which gives a hint the PHY clock is missing, and then return -EINVAL immediately to avoid waiting for the timeout when the DMA reset fails in loongson_dwmac_fix_reset(). With this patch, for the normal end user, the computer start faster with reducing boot time for 2 seconds on the specified mainboard. Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn> Link: https://patch.msgid.link/20250811073506.27513-4-yangtiezhu@loongson.cn Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: maoxiaochuan <maoxiaochuan@loongson.cn>
This commit is contained in:
committed by
maoxiaochuan
parent
0f89cb1635
commit
1b5916fcb4
@@ -514,6 +514,11 @@ static int loongson_dwmac_fix_reset(void *priv, void __iomem *ioaddr)
|
||||
{
|
||||
u32 value = readl(ioaddr + DMA_BUS_MODE);
|
||||
|
||||
if (value & DMA_BUS_MODE_SFT_RESET) {
|
||||
netdev_err(priv->dev, "the PHY clock is missing\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
value |= DMA_BUS_MODE_SFT_RESET;
|
||||
writel(value, ioaddr + DMA_BUS_MODE);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user