From: Vivian Wang <hidden> Date: 2026-01-21 02:17:45
Someone did run into this timeout in the wild [1], and it turns out to
be related to the PHY reference clock stopping.
Improve the comments and error message prints around this to reflect the
better understanding of how this could happen.
This patch isn't a fix for the problem per se, since it is hardware
behavior. The new message and comments, however, should direct those
running into this on new hardware towards a fix.
Link: https://lore.kernel.org/r/20260119141620.1318102-1-amadeus@jmu.edu.cn/ # [1]
Fixes: bfec6d7f2001 ("net: spacemit: Add K1 Ethernet MAC")
Signed-off-by: Vivian Wang <redacted>
---
Changes in v2:
- Add "Fixes" and retarget to net (Andrew)
- Link to v1: https://lore.kernel.org/r/20260120-k1-ethernet-clarify-stat-timeout-v1-1-108cf928d1b3@iscas.ac.cn
---
drivers/net/ethernet/spacemit/k1_emac.c | 23 +++++++++++++++++------
1 file changed, 17 insertions(+), 6 deletions(-)
From: Jakub Kicinski <kuba@kernel.org> Date: 2026-01-22 04:04:41
On Wed, 21 Jan 2026 10:17:18 +0800 Vivian Wang wrote:
This patch isn't a fix for the problem per se, since it is hardware
behavior. The new message and comments, however, should direct those
running into this on new hardware towards a fix.
Is it not possible to improve the situation?
Is the refclock disappearing because of power saving?
Or because the link is down?
Because if it's the latter we should be able to skip reading the stats
when link is down (still racy but better than waiting in cases we can
detect?)
From: Vivian Wang <hidden> Date: 2026-01-22 10:39:26
On 1/22/26 12:04, Jakub Kicinski wrote:
On Wed, 21 Jan 2026 10:17:18 +0800 Vivian Wang wrote:
quoted
This patch isn't a fix for the problem per se, since it is hardware
behavior. The new message and comments, however, should direct those
running into this on new hardware towards a fix.
Is it not possible to improve the situation?
Maybe I should have made it clearer, but this comment and messages
improvement was proposed by Andrew in the linked thread [1].
As an aside, saying that made me realize this patch should be:
Suggested-by: Andrew Lunn <andrew@lunn.ch>
Is the refclock disappearing because of power saving?
Or because the link is down?
I'm not really well-versed in what's allowed from the PHY here, but at
least the Motorcomm and Realtek PHYs seem to only stop this clock while
the link is down. So from what I can tell it's PHY stopping the clock
because of power saving for when the link is down. I'm not sure how that
should translate into an answer to your question here...
Because if it's the latter we should be able to skip reading the stats
when link is down (still racy but better than waiting in cases we can
detect?)
From: Paolo Abeni <pabeni@redhat.com> Date: 2026-01-22 11:51:32
On 1/22/26 11:39 AM, Vivian Wang wrote:
On 1/22/26 12:04, Jakub Kicinski wrote:
quoted
On Wed, 21 Jan 2026 10:17:18 +0800 Vivian Wang wrote:
quoted
This patch isn't a fix for the problem per se, since it is hardware
behavior. The new message and comments, however, should direct those
running into this on new hardware towards a fix.
Is it not possible to improve the situation?
Maybe I should have made it clearer, but this comment and messages
improvement was proposed by Andrew in the linked thread [1].
As an aside, saying that made me realize this patch should be:
Suggested-by: Andrew Lunn <andrew@lunn.ch>
quoted
Is the refclock disappearing because of power saving?
Or because the link is down?
I'm not really well-versed in what's allowed from the PHY here, but at
least the Motorcomm and Realtek PHYs seem to only stop this clock while
the link is down. So from what I can tell it's PHY stopping the clock
because of power saving for when the link is down. I'm not sure how that
should translate into an answer to your question here...
quoted
Because if it's the latter we should be able to skip reading the stats
when link is down (still racy but better than waiting in cases we can
detect?)
If checking the link is definitely up as a condition for updating stats
would be acceptable, then maybe the original patch from the linked
thread [2] can also be adopted?
My understanding is that such option would fit Jakub's suggestion. Note
that the commit message should be expanded and clarified WRT the
original submission.
/P
From: Jakub Kicinski <kuba@kernel.org> Date: 2026-01-22 15:30:44
On Thu, 22 Jan 2026 18:39:06 +0800 Vivian Wang wrote:
quoted
Because if it's the latter we should be able to skip reading the stats
when link is down (still racy but better than waiting in cases we can
detect?)
If checking the link is definitely up as a condition for updating stats
would be acceptable, then maybe the original patch from the linked
thread [2] can also be adopted?
Yes, speaking under correction if Andrew disagrees, but could you
squash those two patches ([2] and the v2) into one?