I'm still puzzled regarding this issue.
I've confirmed with a scope that indeed the reference clock shows a temporary decrease in frequency from 50Mhz to 25Mhz due to the reset of the MAC (the duration of the glitch is about 300ms with linux 5.8).
I've also confirmed that the outbound TX signals from the PHY show an increase in width starting exactly at the same time as the reference clock glitch, consistent with the fact that they are clocked at 25Mhz instead of 50.
Oddly enough I've also noticed that this link failure occurs only with some link partners (specifically HP computers in my case, which are using the I218/I219/X722 intel chips - the link does not drop when the link partner is a raspberry pi, or the same HP laptop using a usb/ethernet adapter). Also this seems to occur only with newer versions of linux, as 2.6.35 does not show the same behavior.
Interestingly the time between the end of TX signals and the beginning of autonegotiation is very close to 1200ms, which suggests to me that the link_break_timer may be engaged (this timer lasts approx. 1200ms from the LAN8720 datasheet). The fact that this timer is engaged would probably mean that the PHY has decided to restart autonegotiation, either because bit 0.9 has been set by software (which I am trying to confirm but without luck so far), or for another unspecified reason.
Would there by any chance happen to be an (undocumented) register that disables or otherwise modulates the "link fail inhibit" timer (apparently some PHYs offer this possibility)?
Any other suggestions on where to look at to figure out the root cause?
Thanks in advance,
post edited by wawrzeniec - 2020/09/28 06:37:35