Re: [PATCH RFC net-next v2 3/8] net: stmmac: dwmac1000: convert sgmii/rgmii "pcs" to phylink
From: "Russell King (Oracle)" <linux@armlinux.org.uk>
Date: 2024-06-12 22:04:50
Also in:
netdev
From: "Russell King (Oracle)" <linux@armlinux.org.uk>
Date: 2024-06-12 22:04:50
Also in:
netdev
On Tue, Jun 11, 2024 at 03:25:14PM +0300, Serge Semin wrote:
Hi Russell, Andrew Should we have a DW IP-core-specific getter like stmmac_ops::pcs_get_config_reg() which would return the tx_config_reg[15:0] field then we could have cleared the IRQ by just calling it, we could have had the fields generically parsed in the dwmac_pcs_isr() handler and in the phylink_pcs_ops::pcs_get_state().
pcs_get_state() is not supposed to get some cached state, but is supposed to return the real state at the time that it is called. There's a good reason for this - dealing with latched-low link failed indications, it's necessary that pcs_get_state() reports that the link failed if _sometime_ between the last time it was called and the next time the link has failed. So, I'm afraid your idea of simplifying it doesn't sound to me like a good idea. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!