2022-12-15 10:51:49

by Wei Fang

[permalink] [raw]
Subject: [PATCH net] arm64: dts: imx8dxl: Disable hibernation mode of AR8031 for EQOS

From: Wei Fang <[email protected]>

The hibernation mode of AR8031 PHY defaults to be enabled after hardware
reset. When the cable is unplugged, the PHY will enter hibernation mode
after about 10 senconds and the PHY clocks will be stopped to save
power. However, due to the design of EQOS, the mac needs the RX_CLK of
PHY for software reset to complete. Otherwise the software reset of EQOS
will be failed and do not work correctly. The only way is to disable
hibernation mode of AR8031 PHY for EQOS, the "qca,disable-hibernation-mode"
property is used for this purpose and has already been submitted to the
upstream, for more details please refer to the below link:
https://lore.kernel.org/netdev/[email protected]/

This issue is easy to reproduce, just unplug the cable and "ifconfig eth0
down", after about 10 senconds, then "ifconfig eth0 up", you will see
failure log on the serial port. The log is shown as following:
root@imx8dxlevk:~#
[34.941970] imx-dwmac 5b050000.ethernet eth0: Link is Down
root@imx8dxlevk:~# ifconfig eth0 down
[35.437814] imx-dwmac 5b050000.ethernet eth0: FPE workqueue stop
[35.507913] imx-dwmac 5b050000.ethernet eth0: PHY [stmmac-1:00] driver [Qualcomm Atheros AR8031/AR8033] (irq=POLL)
[35.518613] imx-dwmac 5b050000.ethernet eth0: configuring for phy/rgmii-id link mode
root@imx8dxlevk:~# ifconfig eth0 up
[71.143044] imx-dwmac 5b050000.ethernet eth0: Register MEM_TYPE_PAGE_POOL RxQ-0
[71.215855] imx-dwmac 5b050000.ethernet eth0: PHY [stmmac-1:00] driver [Qualcomm Atheros AR8031/AR8033] (irq=POLL)
[72.230417] imx-dwmac 5b050000.ethernet: Failed to reset the dma
[72.236512] imx-dwmac 5b050000.ethernet eth0: stmmac_hw_setup: DMA engine initialization failed
[72.245258] imx-dwmac 5b050000.ethernet eth0: __stmmac_open: Hw setup failed
SIOCSIFFLAGS: Connection timed out

After applying this patch, the software reset of EQOS will be
successful. And the log is shown as below.
root@imx8dxlevk:~# ifconfig eth0 up
[96.114344] imx-dwmac 5b050000.ethernet eth0: Register MEM_TYPE_PAGE_POOL RxQ-0
[96.171466] imx-dwmac 5b050000.ethernet eth0: PHY [stmmac-1:00] driver [Qualcomm Atheros AR8031/AR8033] (irq=POLL)
[96.188883] imx-dwmac 5b050000.ethernet eth0: No Safety Features support found
[96.196221] imx-dwmac 5b050000.ethernet eth0: IEEE 1588-2008 Advanced Timestamp supported
[96.204846] imx-dwmac 5b050000.ethernet eth0: registered PTP clock
[96.225558] imx-dwmac 5b050000.ethernet eth0: FPE workqueue start
[96.236858] imx-dwmac 5b050000.ethernet eth0: configuring for phy/rgmii-id link mode
[96.249358] 8021q: adding VLAN 0 to HW filter on device eth0

Signed-off-by: Wei Fang <[email protected]>
Reviewed-by: Clark Wang <[email protected]>
---
arch/arm64/boot/dts/freescale/imx8dxl-evk.dts | 1 +
1 file changed, 1 insertion(+)

diff --git a/arch/arm64/boot/dts/freescale/imx8dxl-evk.dts b/arch/arm64/boot/dts/freescale/imx8dxl-evk.dts
index 280a9c9d8bd9..1bcf228a22b8 100644
--- a/arch/arm64/boot/dts/freescale/imx8dxl-evk.dts
+++ b/arch/arm64/boot/dts/freescale/imx8dxl-evk.dts
@@ -135,6 +135,7 @@ ethphy0: ethernet-phy@0 {
reg = <0>;
eee-broken-1000t;
qca,disable-smarteee;
+ qca,disable-hibernation-mode;
vddio-supply = <&vddio0>;

vddio0: vddio-regulator {
--
2.25.1


2022-12-15 11:47:47

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH net] arm64: dts: imx8dxl: Disable hibernation mode of AR8031 for EQOS

On 15/12/2022 10:36, [email protected] wrote:
> From: Wei Fang <[email protected]>
>
> The hibernation mode of AR8031 PHY defaults to be enabled after hardware
> reset. When the cable is unplugged, the PHY will enter hibernation mode
> after about 10 senconds and the PHY clocks will be stopped to save
> power. However, due to the design of EQOS, the mac needs the RX_CLK of
> PHY for software reset to complete. Otherwise the software reset of EQOS
> will be failed and do not work correctly. The only way is to disable
> hibernation mode of AR8031 PHY for EQOS, the "qca,disable-hibernation-mode"
> property is used for this purpose and has already been submitted to the
> upstream, for more details please refer to the below link:
> https://lore.kernel.org/netdev/[email protected]/

This is not a patch for net-next as you indicate in the subject. DTS
patches go via SoC platform maintainers.

Best regards,
Krzysztof

2022-12-16 01:27:57

by Wei Fang

[permalink] [raw]
Subject: RE: [PATCH net] arm64: dts: imx8dxl: Disable hibernation mode of AR8031 for EQOS

> -----Original Message-----
> From: Krzysztof Kozlowski <[email protected]>
> Sent: 2022??12??15?? 18:13
> To: Wei Fang <[email protected]>; [email protected];
> [email protected]; [email protected];
> [email protected]; [email protected]; [email protected];
> dl-linux-imx <[email protected]>; Frank Li <[email protected]>; Shenwei
> Wang <[email protected]>; Clark Wang <[email protected]>
> Cc: [email protected]; [email protected];
> [email protected]
> Subject: Re: [PATCH net] arm64: dts: imx8dxl: Disable hibernation mode of
> AR8031 for EQOS
>
> On 15/12/2022 10:36, [email protected] wrote:
> > From: Wei Fang <[email protected]>
> >
> > The hibernation mode of AR8031 PHY defaults to be enabled after
> > hardware reset. When the cable is unplugged, the PHY will enter
> > hibernation mode after about 10 senconds and the PHY clocks will be
> > stopped to save power. However, due to the design of EQOS, the mac
> > needs the RX_CLK of PHY for software reset to complete. Otherwise the
> > software reset of EQOS will be failed and do not work correctly. The
> > only way is to disable hibernation mode of AR8031 PHY for EQOS, the
> "qca,disable-hibernation-mode"
> > property is used for this purpose and has already been submitted to
> > the upstream, for more details please refer to the below link:
> > https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flore
> > .kernel.org%2Fnetdev%2F20220818030054.1010660-2-wei.fang%40nxp.co
> m%2F&
> >
> amp;data=05%7C01%7Cwei.fang%40nxp.com%7C47ca8408b3124cdc6abf08d
> ade84f8
> >
> 1b%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C6380669599293
> 37076%7CU
> >
> nknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6
> Ik1ha
> >
> WwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=92M0yZ%2FmcqFr
> U9pGrkbn8Tfo
> > %2BG5MVgjyexiNRKD2nic%3D&amp;reserved=0
>
> This is not a patch for net-next as you indicate in the subject. DTS patches go
> via SoC platform maintainers.
>

Okay, I'll remove "net" from the subject.