Commit 2c84959
net: spacemit: Check for netif_carrier_ok() in emac_stats_update()
Some PHYs stop the refclk for power saving, usually while link down.
This causes reading stats to time out.
Therefore, in emac_stats_update(), also don't update and reschedule if
!netif_carrier_ok(). But that means we could be missing later updates if
the link comes back up, so also reschedule when link up is detected in
emac_adjust_link().
While we're at it, improve the comments and error message prints around
this to reflect the better understanding of how this could happen.
Hopefully if this happens again on new hardware, these comments will
direct towards a solution.
Closes: https://lore.kernel.org/r/[email protected]/
Fixes: bfec6d7 ("net: spacemit: Add K1 Ethernet MAC")
Co-developed-by: Chukun Pan <[email protected]>
Signed-off-by: Chukun Pan <[email protected]>
Signed-off-by: Vivian Wang <[email protected]>
Link: https://patch.msgid.link/20260123-k1-ethernet-clarify-stat-timeout-v3-1-93b9df627e87@iscas.ac.cn
Signed-off-by: Jakub Kicinski <[email protected]>1 parent e2a9eeb commit 2c84959
1 file changed
Lines changed: 27 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1099 | 1099 | | |
1100 | 1100 | | |
1101 | 1101 | | |
1102 | | - | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
1103 | 1109 | | |
1104 | 1110 | | |
1105 | 1111 | | |
| |||
1147 | 1153 | | |
1148 | 1154 | | |
1149 | 1155 | | |
1150 | | - | |
1151 | | - | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
1152 | 1165 | | |
1153 | 1166 | | |
1154 | 1167 | | |
1155 | 1168 | | |
1156 | 1169 | | |
1157 | | - | |
1158 | | - | |
1159 | | - | |
1160 | | - | |
| 1170 | + | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
1161 | 1175 | | |
1162 | 1176 | | |
1163 | 1177 | | |
| |||
1636 | 1650 | | |
1637 | 1651 | | |
1638 | 1652 | | |
| 1653 | + | |
| 1654 | + | |
| 1655 | + | |
| 1656 | + | |
| 1657 | + | |
| 1658 | + | |
1639 | 1659 | | |
1640 | 1660 | | |
1641 | 1661 | | |
| |||
0 commit comments