net: phy: at803x: add disable hibernation mode support
authorWei Fang <wei.fang@nxp.com>
Thu, 18 Aug 2022 03:00:54 +0000 (11:00 +0800)
committerJakub Kicinski <kuba@kernel.org>
Thu, 18 Aug 2022 21:16:33 +0000 (14:16 -0700)
commit9ecf04016c87bcb33b44e24489d33618e2592f41
treeaaf813798acd45917d71b16c122adfd8411392cc
parent2e7f089914b94450d4c3b6408e22af3f016fc332
net: phy: at803x: add disable hibernation mode support

When the cable is unplugged, the Atheros AR803x PHYs will enter
hibernation mode after about 10 seconds if the hibernation mode
is enabled and will not provide any clock to the MAC. But for
some MACs, this feature might cause unexpected issues due to the
logic of MACs.
Taking SYNP MAC (stmmac) as an example, if the cable is unplugged
and the "eth0" interface is down, the AR803x PHY will enter
hibernation mode. Then perform the "ifconfig eth0 up" operation,
the stmmac can't be able to complete the software reset operation
and fail to init it's own DMA. Therefore, the "eth0" interface is
failed to ifconfig up. Why does it cause this issue? The truth is
that the software reset operation of the stmmac is designed to
depend on the RX_CLK of PHY.
So, this patch offers an option for the user to determine whether
to disable the hibernation mode of AR803x PHYs.

Signed-off-by: Wei Fang <wei.fang@nxp.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/phy/at803x.c