[PATCH net-next 14/14] net: stmmac: convert to phylink PCS support
Andrew Lunn
andrew at lunn.ch
Thu Oct 16 06:05:07 PDT 2025
On Wed, Oct 15, 2025 at 10:57:08PM +0100, Russell King (Oracle) wrote:
> On Wed, Oct 15, 2025 at 11:31:37PM +0200, Andrew Lunn wrote:
> > > - create stmmac_pcs.c, which contains the phylink_pcs_ops structure, a
> > > dummy .pcs_get_state() method which always reports link-down
> >
> > I've not followed the PCS code too closely. Why always report link
> > down? Why is a dummy method needed?
>
> If phylink is put into inband mode, and a PCS is supplied to phylink
> where this method left NULL, the kernel will oops.
>
> As the code stands today in mainline, if phylink were to be put into
> inband mode with the integrated PCS, then there will be no phylink PCS,
> and so phylink_mac_pcs_get_state() will fall into the "else" path of:
>
> pcs = pl->pcs;
> if (pcs)
> pcs->ops->pcs_get_state(pcs, pl->pcs_neg_mode, state);
> else
> state->link = 0;
>
> and force the link down.
>
> So, adding this method keeps the status quo - not oopsing the kernel
> and not allowing the link to come up. No unintended behavioural
> change in this regard from how it would behave today. :)
O.K. Maybe some of this text could be added to the commit message?
Thanks
Andrew
More information about the linux-arm-kernel
mailing list