[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 11 Nov 2021 17:01:50 +0300
From: Denis Kirjanov <dkirjanov@...e.de>
To: Meng Li <Meng.Li@...driver.com>, peppe.cavallaro@...com,
alexandre.torgue@...s.st.com, joabreu@...opsys.com,
davem@...emloft.net, kuba@...nel.org, mcoquelin.stm32@...il.com
Cc: netdev@...r.kernel.org, linux-stm32@...md-mailman.stormreply.com,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] net: stmmac: socfpga: add runtime suspend/resume callback
for stratix10 platform
11/11/21 4:56 PM, Meng Li пишет:
> From: Meng Li <meng.li@...driver.com>
>
> According to upstream commit 5ec55823438e("net: stmmac:
> add clocks management for gmac driver "), it improve clocks
> management for stmmac driver. So, it is necessary to implement
> the runtime callback in dwmac-socfpga driver because it doesn’t
> use the common stmmac_pltfr_pm_ops instance. Otherwise, clocks
> are not disabled when system enters suspend status.
Please add Fixes tag
>
> Signed-off-by: Meng Li <Meng.Li@...driver.com>
> ---
> .../ethernet/stmicro/stmmac/dwmac-socfpga.c | 24 +++++++++++++++++--
> 1 file changed, 22 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c
> index 85208128f135..93abde467de4 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c
> @@ -485,8 +485,28 @@ static int socfpga_dwmac_resume(struct device *dev)
> }
> #endif /* CONFIG_PM_SLEEP */
>
> -static SIMPLE_DEV_PM_OPS(socfpga_dwmac_pm_ops, stmmac_suspend,
> - socfpga_dwmac_resume);
> +static int __maybe_unused socfpga_dwmac_runtime_suspend(struct device *dev)
> +{
> + struct net_device *ndev = dev_get_drvdata(dev);
> + struct stmmac_priv *priv = netdev_priv(ndev);
> +
> + stmmac_bus_clks_config(priv, false);
check the return value?
> +
> + return 0;
> +}
> +
> +static int __maybe_unused socfpga_dwmac_runtime_resume(struct device *dev)
> +{
> + struct net_device *ndev = dev_get_drvdata(dev);
> + struct stmmac_priv *priv = netdev_priv(ndev);
> +
> + return stmmac_bus_clks_config(priv, true);
> +}
> +
> +const struct dev_pm_ops socfpga_dwmac_pm_ops = {
> + SET_SYSTEM_SLEEP_PM_OPS(stmmac_suspend, socfpga_dwmac_resume)
> + SET_RUNTIME_PM_OPS(socfpga_dwmac_runtime_suspend, socfpga_dwmac_runtime_resume, NULL)
> +};
>
> static const struct socfpga_dwmac_ops socfpga_gen5_ops = {
> .set_phy_mode = socfpga_gen5_set_phy_mode,
>
Powered by blists - more mailing lists