[PATCH net-next v5 3/3] net: ti: icssm-prueth: Adds support for ICSSM RSTP switch
Simon Horman
horms at kernel.org
Mon Nov 17 13:09:14 PST 2025
On Thu, Nov 13, 2025 at 03:40:23PM +0530, Parvathi Pudi wrote:
...
> @@ -1012,17 +1074,77 @@ static int icssm_emac_ndo_stop(struct net_device *ndev)
> hrtimer_cancel(&emac->tx_hrtimer);
>
> /* stop the PRU */
> - rproc_shutdown(emac->pru);
> + if (!PRUETH_IS_EMAC(prueth))
> + icssm_prueth_sw_shutdown_prus(emac, ndev);
> + else
> + rproc_shutdown(emac->pru);
> +
> + /* free table memory of the switch */
> + if (PRUETH_IS_SWITCH(emac->prueth))
> + icssm_prueth_sw_free_fdb_table(prueth);
The conditional block above appears to open-code icssm_prueth_free_memory()
which is also called below. I don't think this this duplication causes
any harm, as it looks like the second, indirect, call to
icssm_prueth_sw_free_fdb_table() will be a noop. But it does seem
unnecessary.
>
> /* free rx interrupts */
> free_irq(emac->rx_irq, ndev);
>
> + /* free memory related to sw */
> + icssm_prueth_free_memory(emac->prueth);
> +
> + if (!prueth->emac_configured)
> + icss_iep_exit(prueth->iep);
> +
> if (netif_msg_drv(emac))
> dev_notice(&ndev->dev, "stopped\n");
>
> return 0;
> }
...
More information about the linux-arm-kernel
mailing list