Re: [PATCH net-next v5 3/3] net: stmmac: Add DWMAC glue layer for Renesas GBETH

From: Lad, Prabhakar
Date: Tue Apr 15 2025 - 08:33:34 EST


Hi Russell,

On Mon, Apr 14, 2025 at 7:14 PM Lad, Prabhakar
<prabhakar.csengg@xxxxxxxxx> wrote:
>
> Hi Russell,
>
> On Mon, Apr 14, 2025 at 5:57 PM Russell King (Oracle)
> <linux@xxxxxxxxxxxxxxx> wrote:
> >
> > On Mon, Apr 07, 2025 at 01:03:17PM +0100, Prabhakar wrote:
> > > + gbeth->rstc = devm_reset_control_get_exclusive(dev, NULL);
> > > + if (IS_ERR(gbeth->rstc))
> > > + return PTR_ERR(gbeth->rstc);
> > > +
> > > + gbeth->dev = dev;
> > > + gbeth->regs = stmmac_res.addr;
> > > + gbeth->plat_dat = plat_dat;
> > > + plat_dat->bsp_priv = gbeth;
> > > + plat_dat->set_clk_tx_rate = stmmac_set_clk_tx_rate;
> > > + plat_dat->clks_config = renesas_gbeth_clks_config;
> > > + plat_dat->flags |= STMMAC_FLAG_HWTSTAMP_CORRECT_LATENCY |
> > > + STMMAC_FLAG_EN_TX_LPI_CLK_PHY_CAP |
> > > + STMMAC_FLAG_SPH_DISABLE;
> > > +
> > > + err = renesas_gbeth_clks_config(gbeth, true);
> > > + if (err)
> > > + return err;
> > > +
> > > + err = stmmac_dvr_probe(dev, plat_dat, &stmmac_res);
> > > + if (err)
> > > + renesas_gbeth_clks_config(gbeth, false);
> > > +
> > > + return err;
> > > +}
> > > +
> > > +static void renesas_gbeth_remove(struct platform_device *pdev)
> > > +{
> > > + stmmac_dvr_remove(&pdev->dev);
> > > +
> > > + renesas_gbeth_clks_config(get_stmmac_bsp_priv(&pdev->dev), false);
> > > +}
> >
> > Would calling renesas_gbeth_clks_config() in the suspend/resume paths
> > cause problems?
> >
> > If not, please consider using plat_dat->init() and plat_dat->exit()
> > to control these clocks, and then use devm_stmmac_pltfr_probe()
> > which will call the ->init and ->exit functions around the probe
> > as necessary and at removal time (and you won't need the remove
> > method.)
> >
On the RZ/G3E, the upstream support for testing S2R is not yet in a
usable state. So for now, I'll switch to using init/exit callbacks and
drop the PM callback.

Cheers,
Prabhakar