On 5/22/2019 6:20 PM, Ioana Ciornei wrote:
> This completely removes the usage of PHYLIB from DSA, namely for the
> aforementioned switch ports which used to drive a software PHY manually
> using genphy operations.
>
> For these ports, the newly introduced phylink_create_raw API must be
> used, and the callbacks are received through a notifier block registered
> per dsa_port, but otherwise the implementation is fairly
> straightforward, and the handling of the regular vs raw PHYLINK
> instances is common from the perspective of the driver.
>
> What changes for drivers:
>
> The .adjust_link callback is no longer called for the fixed-link CPU/DSA
> ports and drivers must migrate to standard PHYLINK operations (e.g.
> .phylink_mac_config). The reason why we can't do anything for them is
> because PHYLINK does not wrap the fixed link state behind a phydev
> object, so we cannot wrap .phylink_mac_config into .adjust_link unless
> we fabricate a phy_device structure.
Can't we offer a slightly nicer transition period for DSA switch drivers:
- if adjust_link and phylink_mac_ops are both supported, prefer
phylink_mac_ops
- if phylink_mac_ops is defined alone use it, we're good
- if adjust_link alone is defined, keep using it with the existing code
but print a warning inviting to migrate?
The changes look fine but the transition path needs to be a little more
gentle IMHO.
--
Florian