• Kory Maincent's avatar
    net: Change the API of PHY default timestamp to MAC · 0f7f463d
    Kory Maincent authored
    Change the API to select MAC default time stamping instead of the PHY.
    Indeed the PHY is closer to the wire therefore theoretically it has less
    delay than the MAC timestamping but the reality is different. Due to lower
    time stamping clock frequency, latency in the MDIO bus and no PHC hardware
    synchronization between different PHY, the PHY PTP is often less precise
    than the MAC. The exception is for PHY designed specially for PTP case but
    these devices are not very widespread. For not breaking the compatibility I
    introduce a default_timestamp flag in phy_device that is set by the phy
    driver to know we are using the old API behavior.
    
    The phy_set_timestamp function is called at each call of phy_attach_direct.
    In case of MAC driver using phylink this function is called when the
    interface is turned up. Then if the interface goes down and up again the
    last choice of timestamp will be overwritten by the default choice.
    A solution could be to cache the timestamp status but it can bring other
    issues. In case of SFP, if we change the module, it doesn't make sense to
    blindly re-set the timestamp back to PHY, if the new module has a PHY with
    mediocre timestamping capabilities.
    Signed-off-by: default avatarKory Maincent <kory.maincent@bootlin.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    0f7f463d
mscc_ptp.c 46.7 KB