From: Marek Vasut <marex@denx.de>
To: Wei Fang <wei.fang@nxp.com>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Cc: "David S. Miller" <davem@davemloft.net>,
Andrew Lunn <andrew@lunn.ch>, Eric Dumazet <edumazet@google.com>,
Heiner Kallweit <hkallweit1@gmail.com>,
Jakub Kicinski <kuba@kernel.org>,
Oleksij Rempel <linux@rempel-privat.de>,
Paolo Abeni <pabeni@redhat.com>,
Russell King <linux@armlinux.org.uk>
Subject: Re: [PATCH] net: phy: at803x: Improve hibernation support on start up
Date: Tue, 8 Aug 2023 20:37:18 +0200 [thread overview]
Message-ID: <45b1ee70-8330-0b18-2de1-c94ddd35d817@denx.de> (raw)
In-Reply-To: <AM5PR04MB3139793206F9101A552FADA0880DA@AM5PR04MB3139.eurprd04.prod.outlook.com>
On 8/8/23 10:44, Wei Fang wrote:
> Hi Marek,
Hi,
>> Toggle hibernation mode OFF and ON to wake the PHY up and make it
>> generate clock on RX_CLK pin for about 10 seconds.
>> These clock are needed during start up by MACs like DWMAC in NXP i.MX8M
>> Plus to release their DMA from reset. After the MAC has started up, the PHY
>> can enter hibernation and disable the RX_CLK clock, this poses no problem for
>> the MAC.
>>
>> Originally, this issue has been described by NXP in commit
>> 9ecf04016c87 ("net: phy: at803x: add disable hibernation mode support") but
>> this approach fully disables the hibernation support and takes away any power
>> saving benefit. This patch instead makes the PHY generate the clock on start
>> up for 10 seconds, which should be long enough for the EQoS MAC to release
>> DMA from reset.
>>
>> Before this patch on i.MX8M Plus board with AR8031 PHY:
>> "
>> $ ifconfig eth1 up
>> [ 25.576734] imx-dwmac 30bf0000.ethernet eth1: Register
>> MEM_TYPE_PAGE_POOL RxQ-0
>> [ 25.658916] imx-dwmac 30bf0000.ethernet eth1: PHY [stmmac-1:00]
>> driver [Qualcomm Atheros AR8031/AR8033] (irq=38)
>> [ 26.670276] imx-dwmac 30bf0000.ethernet: Failed to reset the dma
>> [ 26.676322] imx-dwmac 30bf0000.ethernet eth1: stmmac_hw_setup:
>> DMA engine initialization failed
>> [ 26.685103] imx-dwmac 30bf0000.ethernet eth1: __stmmac_open: Hw
>> setup failed
>> ifconfig: SIOCSIFFLAGS: Connection timed out "
>>
>
> Have you reproduced this issue based on the upstream net-next or net tree?
On current linux-next next-20230808 so 6.5.0-rc5 . As far as I can tell,
net-next is merged into this tree too.
> If so, can this issue be reproduced? The reason why I ask this is because when
> I tried to reproduce this problem on net-next 6.3.0 version, I found that it could
> not be reproduced (I did not disable hibernation mode when I reproduced this
> issue ). So I guess maybe other patches in eqos driver fixed the issue.
This is what I use for testing:
- Make sure "qca,disable-hibernation-mode" is NOT present in PHY DT node
- Boot the machine with NO ethernet cable plugged into the affected port
(i.e. the EQoS port), this is important
- Make sure the EQoS MAC is not brought up e.g. by systemd-networkd or
whatever other tool, I use busybox initramfs for testing with plain
script as init (it mounts the various filesystems and runs /bin/sh)
- Wait longer than 10 seconds
- If possible, measure AR8031 PHY pin 33 RX_CLK, wait for the RX_CLK to
be turned OFF by the PHY (means PHY entered hibernation)
- ifconfig ethN up -- try to bring up the EQoS MAC
<observe failure>
[...]
next prev parent reply other threads:[~2023-08-08 19:00 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-04 17:58 [PATCH] net: phy: at803x: Improve hibernation support on start up Marek Vasut
2023-08-08 8:44 ` Wei Fang
2023-08-08 18:37 ` Marek Vasut [this message]
2023-08-09 2:27 ` Wei Fang
2023-08-09 4:36 ` Oleksij Rempel
2023-08-09 5:37 ` Wei Fang
2023-08-09 6:08 ` Oleksij Rempel
2023-08-09 8:43 ` Russell King (Oracle)
2023-08-10 10:30 ` Russell King (Oracle)
2023-12-14 8:13 ` Romain Gantois
2023-12-14 10:46 ` Marek Vasut
2023-12-14 16:49 ` Russell King (Oracle)
2023-12-15 8:22 ` Romain Gantois
2023-08-10 3:28 ` Wei Fang
2023-08-10 9:08 ` Russell King (Oracle)
2023-08-09 13:40 ` Andrew Lunn
2023-08-09 21:34 ` Marek Vasut
2023-08-09 22:06 ` Andrew Lunn
2023-08-10 0:49 ` Marek Vasut
2023-08-10 4:32 ` Oleksij Rempel
2023-08-10 10:10 ` Russell King (Oracle)
2023-08-10 10:01 ` Russell King (Oracle)
2023-08-10 10:34 ` Russell King (Oracle)
2023-08-10 12:51 ` Oleksij Rempel
2023-08-10 13:16 ` Russell King (Oracle)
2023-08-10 13:49 ` Andrew Lunn
2023-08-10 13:54 ` Russell King (Oracle)
2023-08-10 14:23 ` Andrew Lunn
2023-08-10 14:36 ` Russell King (Oracle)
2023-08-09 23:15 ` Russell King (Oracle)
2023-08-10 10:34 ` Russell King (Oracle)
2023-08-10 3:38 ` Wei Fang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=45b1ee70-8330-0b18-2de1-c94ddd35d817@denx.de \
--to=marex@denx.de \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hkallweit1@gmail.com \
--cc=kuba@kernel.org \
--cc=linux@armlinux.org.uk \
--cc=linux@rempel-privat.de \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=wei.fang@nxp.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).