Thank you for your contribution! Sashiko AI review found more severe issue(s) in other patches of this series. This mail is only an FYI, in case you want to address the nit picks below when you respin. Low priority / nit picks for your consideration: - [Low] The comment in rtl8365mb_phylink_mac_link_down() (drivers/net/dsa/realtek/rtl8365mb_main.c, lines 1839-1843) is now… - [Low] The new pcs_link_down() kernel-doc (include/linux/phylink.h:698-706) copies the mac_link_down() contract… -- net: phylink: add .pcs_link_down PCS OP This commit adds an optional .pcs_link_down operation to struct phylink_pcs_ops. phylink_link_down() calls it right after .mac_link_down, so a PCS driver can tear down the link between the MAC and the PCS.
> diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c > index 3471ba8d5ba6f..b57a7de058b8f 100644 > --- a/drivers/net/phy/phylink.c > +++ b/drivers/net/phy/phylink.c
[ ... ]
> @@ -1889,6 +1895,9 @@ static void phylink_link_down(struct phylink *pl) > > pl->mac_ops->mac_link_down(pl->config, pl->act_link_an_mode, > pl->cur_interface); > + > + phylink_pcs_link_down(pl->pcs); > + > phylink_info(pl, "Link is Down\n"); > }
[Severity: Low] With this hook added, the comment in rtl8365mb_phylink_mac_link_down() in drivers/net/dsa/realtek/rtl8365mb_main.c is no longer accurate: /* phylink has no pcs_link_down callback, so on the SerDes path only the * MAC external interface force is reset here. Clearing the MAC force is * enough to bring the link down; the SerDes keeps presenting its last * forced state until the next pcs_link_up() reprograms it. */ rtl8365mb_pcs_ops does not set .pcs_link_down, so runtime behaviour does not change. The comment still says phylink lacks this callback, and it uses that to explain the stale SerDes state. The comment is unchanged at the end of the series. Should this comment be updated in this series? Another option would be to move the SerDes teardown into a .pcs_link_down implementation.
> diff --git a/include/linux/phylink.h b/include/linux/phylink.h > index 9ce66b0344370..d53319e67f776 100644 > --- a/include/linux/phylink.h > +++ b/include/linux/phylink.h
[ ... ]
> @@ -693,6 +695,16 @@ void pcs_an_restart(struct phylink_pcs *pcs); > void pcs_link_up(struct phylink_pcs *pcs, unsigned int neg_mode, > phy_interface_t interface, int speed, int duplex); > > +/** > + * pcs_link_down() - tear down link between MAC and PCS > + * @pcs: a pointer to a &struct phylink_pcs. > + * > + * This call will be made just after mac_link_down() to inform the PCS the > + * link has gone down. PCS should be configured to stop processing packets > + * for transmission and reception. > + */ > +void pcs_link_down(struct phylink_pcs *pcs);
[Severity: Low] This text follows the mac_link_down() contract but leaves out its in-band caveat: * If @mode is %MLO_AN_INBAND, then this function must not prevent the * link coming up. Should pcs_link_down() have the same caveat? With MLO_AN_INBAND, phylink_resolve() gets link state from pcs_get_state(). The only call that reverses pcs_link_down() is pcs_link_up(), and phylink_link_up() calls it only after pcs_get_state() has reported link up: phylink_link_down() phylink_pcs_link_down() <- PCS stops RX/AN, as this doc allows phylink_resolve() phylink_mac_pcs_get_state() <- link stays false phylink_link_up()->pcs_link_up() is never reached phylink_link_down() calls the hook on every link-down, including the latched link-fail retrigger path. Could a PCS driver that follows this doc literally and stops its receive or AN logic here leave an in-band port down for good? Unlike pcs_link_up(), the new callback gets no neg_mode or interface argument. A driver cannot tell from the call alone whether in-band detection has to stay active. The only implementation in the series is airoha_pcs_link_down() in "net: pcs: airoha: add PCS driver for Airoha AN7581 SoC". It is not affected. It only sets the XFI MAC RX/TX MPI/MBI STOP bits, which airoha_pcs_pre_config() also sets before link-up. airoha_pcs_get_state() reads the hsgmii_an and usxgmii_pcs registers.
-- Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/2026…%40gmail.com