[PATCH] net: stmmac: Add NCSI support
Andrew Lunn
andrew at lunn.ch
Mon Jul 14 06:53:07 PDT 2025
> - ret = stmmac_reset(priv, priv->ioaddr);
> - if (ret) {
> - netdev_err(priv->dev, "Failed to reset the dma\n");
> - return ret;
> + if (!priv->plat->use_ncsi) {
> + ret = stmmac_reset(priv, priv->ioaddr);
> + if (ret) {
> + netdev_err(priv->dev, "Failed to reset the dma\n");
> + return ret;
> + }
> }
Please break this patch up into a series and include good commit
messages. You can then explain why this change is safe.
> /* DMA Configuration */
> @@ -3643,6 +3646,14 @@ static void stmmac_hw_teardown(struct net_device *dev)
> clk_disable_unprepare(priv->plat->clk_ptp_ref);
> }
>
> +static void stmmac_ncsi_handler(struct ncsi_dev *nd)
> +{
> + if (unlikely(nd->state != ncsi_dev_state_functional))
> + return;
> +
> + netdev_info(nd->dev, "NCSI interface %s\n", nd->link_up ? "up" : "down");
Please don't spam the kernel log. Only do prints if something goes
wrong.
> +}
> +
> static void stmmac_free_irq(struct net_device *dev,
> enum request_irq_err irq_err, int irq_idx)
> {
> @@ -4046,14 +4057,16 @@ static int __stmmac_open(struct net_device *dev,
> if (ret < 0)
> return ret;
>
> - if ((!priv->hw->xpcs ||
> - xpcs_get_an_mode(priv->hw->xpcs, mode) != DW_AN_C73)) {
> - ret = stmmac_init_phy(dev);
> - if (ret) {
> - netdev_err(priv->dev,
> - "%s: Cannot attach to PHY (error: %d)\n",
> - __func__, ret);
> - goto init_phy_error;
> + if (!priv->plat->use_ncsi) {
> + if ((!priv->hw->xpcs ||
My understanding of NCSI is that you have an additional RGMII like
port feeding into the MAC. The MAC still has all its media machinery,
a PCS, PHY etc. Something needs to drive that PCS and PHY. So it would
be good to explain in the commit message why you are removing all
this.
Andrew
More information about the linux-arm-kernel
mailing list