[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <5b01bd9c-252c-41ac-adaa-dddda8ffd06b@lunn.ch>
Date: Mon, 14 Jul 2025 15:53:07 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Marvin Lin <milkfafa@...il.com>
Cc: andrew+netdev@...n.ch, davem@...emloft.net, edumazet@...gle.com,
kuba@...nel.org, pabeni@...hat.com, mcoquelin.stm32@...il.com,
alexandre.torgue@...s.st.com, netdev@...r.kernel.org,
linux-stm32@...md-mailman.stormreply.com,
linux-arm-kernel@...ts.infradead.org, openbmc@...ts.ozlabs.org,
KWLIU@...oton.com, tmaimon77@...il.com, kflin@...oton.com
Subject: Re: [PATCH] net: stmmac: Add NCSI support
> - 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
Powered by blists - more mailing lists