lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID:
 <TY3PR01MB1134633A8CB82788BB98C6E6286B82@TY3PR01MB11346.jpnprd01.prod.outlook.com>
Date: Mon, 21 Apr 2025 13:45:50 +0000
From: Biju Das <biju.das.jz@...renesas.com>
To: "Lad, Prabhakar" <prabhakar.csengg@...il.com>, "Russell King (Oracle)"
	<linux@...linux.org.uk>
CC: Andrew Lunn <andrew+netdev@...n.ch>, "David S. Miller"
	<davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski
	<kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>, Rob Herring
	<robh@...nel.org>, Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor Dooley
	<conor+dt@...nel.org>, Maxime Coquelin <mcoquelin.stm32@...il.com>, Alexandre
 Torgue <alexandre.torgue@...s.st.com>, Richard Cochran
	<richardcochran@...il.com>, Philipp Zabel <p.zabel@...gutronix.de>, Geert
 Uytterhoeven <geert+renesas@...der.be>, Magnus Damm <magnus.damm@...il.com>,
	Giuseppe Cavallaro <peppe.cavallaro@...com>, Jose Abreu
	<joabreu@...opsys.com>, "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
	"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"linux-stm32@...md-mailman.stormreply.com"
	<linux-stm32@...md-mailman.stormreply.com>,
	"linux-arm-kernel@...ts.infradead.org"
	<linux-arm-kernel@...ts.infradead.org>, "linux-renesas-soc@...r.kernel.org"
	<linux-renesas-soc@...r.kernel.org>, Fabrizio Castro
	<fabrizio.castro.jz@...esas.com>, Prabhakar Mahadev Lad
	<prabhakar.mahadev-lad.rj@...renesas.com>
Subject: RE: [PATCH net-next v5 3/3] net: stmmac: Add DWMAC glue layer for
 Renesas GBETH

Hi All,

> -----Original Message-----
> From: Lad, Prabhakar <prabhakar.csengg@...il.com>
> Sent: 15 April 2025 13:33
> Subject: Re: [PATCH net-next v5 3/3] net: stmmac: Add DWMAC glue layer for Renesas GBETH
> 
> Hi Russell,
> 
> On Mon, Apr 14, 2025 at 7:14 PM Lad, Prabhakar <prabhakar.csengg@...il.com> wrote:
> >
> > Hi Russell,
> >
> > On Mon, Apr 14, 2025 at 5:57 PM Russell King (Oracle)
> > <linux@...linux.org.uk> 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.

FYI, On RZ/G3E, for STR to work with mainline, we need to reinitialize the PHY.
I have done below changes on top of [1] to make STR working.

[1] https://lore.kernel.org/all/20250417084015.74154-4-prabhakar.mahadev-lad.rj@bp.renesas.com/

static int renesas_gbeth_init(struct platform_device *pdev, void *priv)
 {
+       struct net_device *ndev = platform_get_drvdata(pdev);
        struct plat_stmmacenet_data *plat_dat;
        struct renesas_gbeth *gbeth = priv;
        int ret;
@@ -50,6 +52,11 @@ static int renesas_gbeth_init(struct platform_device *pdev, void *priv)
        if (ret)
                reset_control_assert(gbeth->rstc);
 
+       if (gbeth->suspend) {
+               gbeth->suspend = false;
+               phy_init_hw(ndev->phydev);
+       }
+
        return ret;
 }
 
@@ -66,6 +73,8 @@ static void renesas_gbeth_exit(struct platform_device *pdev, void *priv)
        ret = reset_control_assert(gbeth->rstc);
        if (ret)
                dev_err(gbeth->dev, "Reset assert failed\n");
+
+       gbeth->suspend = true;
 }
 
 static int renesas_gbeth_probe(struct platform_device *pdev)
@@ -136,6 +145,7 @@ static struct platform_driver renesas_gbeth_driver = {
        .probe  = renesas_gbeth_probe,
        .driver = {
                .name           = "renesas-gbeth",
+               .pm             = &stmmac_pltfr_pm_ops,
                .of_match_table = renesas_gbeth_match,
        },
 };

Cheers,
Biju

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ