Re: [net-next v1 2/6] net: stmmac: Checking whether priv->phylink if NULL in NCSI case

From: Minda Chen

Date: Sun Jun 14 2026 - 22:59:23 EST




>
> > +static inline bool stmmac_phylink_expects_phy(struct phylink *link) {
> > + if (link)
> > + return phylink_expects_phy(link);
> > +
> > + return false;
> > +}
> > +
> > +static inline int stmmac_phylink_pcs_pre_init(struct phylink *link,
> > +struct phylink_pcs *pcs) {
> > + if (link)
> > + return phylink_pcs_pre_init(link, pcs);
> > +
> > + return 0;
> > +}
> > +
> > +static inline void stmmac_phylink_start(struct phylink *link) {
> > + if (link)
> > + phylink_start(link);
> > +}
> > +
> > +static inline void stmmac_phylink_stop(struct phylink *link) {
> > + if (link)
> > + phylink_stop(link);
> > +}
>
> Please take a step back and think about the Linux big picture architecture.
>
> What is stmmac specific here? If you were to add NCSI support to another driver
> which uses phylink, would it need to replicate all this?
>
> When you consider how the MAC is configured, does it need to know it is
> connected to an NCSI? Can the MAC tell the difference between NSCI, fixed-link,
> a PHY or an SFP? Or does the MAC just need to know RGMII, the link is up, send
> frames?
>
> Please look at adding generic support for NSCI in phylink, and see if the existing
> phylink mac ops covers everything needed for configuring the MAC.
>
> Andrew

Thanks. I will try to use fix-PHY link.