[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250704085740.GA137171@ragnatech.se>
Date: Fri, 4 Jul 2025 10:57:40 +0200
From: Niklas Söderlund <niklas.soderlund@...natech.se>
To: Sakari Ailus <sakari.ailus@...ux.intel.com>
Cc: Nicolas Ferre <nicolas.ferre@...rochip.com>,
Claudiu Beznea <claudiu.beznea@...on.dev>,
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>,
Wei Fang <wei.fang@....com>, Shenwei Wang <shenwei.wang@....com>,
Clark Wang <xiaoning.wang@....com>, Paul Barker <paul@...rker.dev>,
Siddharth Vadapalli <s-vadapalli@...com>,
Roger Quadros <rogerq@...nel.org>,
Uwe Kleine-König <u.kleine-koenig@...libre.com>,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
imx@...ts.linux.dev, linux-renesas-soc@...r.kernel.org,
linux-omap@...r.kernel.org
Subject: Re: [PATCH 46/80] net: ethernet: Remove redundant
pm_runtime_mark_last_busy() calls
Hej Sakari,
Thanks for your work, this is a nice improvement!
On 2025-07-04 10:54:35 +0300, Sakari Ailus wrote:
> pm_runtime_put_autosuspend(), pm_runtime_put_sync_autosuspend(),
> pm_runtime_autosuspend() and pm_request_autosuspend() now include a call
> to pm_runtime_mark_last_busy(). Remove the now-reduntant explicit call to
> pm_runtime_mark_last_busy().
>
> Signed-off-by: Sakari Ailus <sakari.ailus@...ux.intel.com>
> ---
> The cover letter of the set can be found here
> <URL:https://lore.kernel.org/linux-pm/20250704075225.3212486-1-sakari.ailus@linux.intel.com>.
>
> In brief, this patch depends on PM runtime patches adding marking the last
> busy timestamp in autosuspend related functions. The patches are here, on
> rc2:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git \
> pm-runtime-6.17-rc1
>
> drivers/net/ethernet/cadence/macb_main.c | 5 -----
> drivers/net/ethernet/freescale/fec_main.c | 8 --------
> drivers/net/ethernet/renesas/ravb_main.c | 4 ----
For RAVB,
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@...natech.se>
> drivers/net/ethernet/ti/davinci_mdio.c | 7 -------
> 4 files changed, 24 deletions(-)
>
> diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
> index 53aaf6b08e39..9b7cbb3e3108 100644
> --- a/drivers/net/ethernet/cadence/macb_main.c
> +++ b/drivers/net/ethernet/cadence/macb_main.c
> @@ -360,7 +360,6 @@ static int macb_mdio_read_c22(struct mii_bus *bus, int mii_id, int regnum)
> status = MACB_BFEXT(DATA, macb_readl(bp, MAN));
>
> mdio_read_exit:
> - pm_runtime_mark_last_busy(&bp->pdev->dev);
> pm_runtime_put_autosuspend(&bp->pdev->dev);
> mdio_pm_exit:
> return status;
> @@ -406,7 +405,6 @@ static int macb_mdio_read_c45(struct mii_bus *bus, int mii_id, int devad,
> status = MACB_BFEXT(DATA, macb_readl(bp, MAN));
>
> mdio_read_exit:
> - pm_runtime_mark_last_busy(&bp->pdev->dev);
> pm_runtime_put_autosuspend(&bp->pdev->dev);
> mdio_pm_exit:
> return status;
> @@ -438,7 +436,6 @@ static int macb_mdio_write_c22(struct mii_bus *bus, int mii_id, int regnum,
> goto mdio_write_exit;
>
> mdio_write_exit:
> - pm_runtime_mark_last_busy(&bp->pdev->dev);
> pm_runtime_put_autosuspend(&bp->pdev->dev);
> mdio_pm_exit:
> return status;
> @@ -484,7 +481,6 @@ static int macb_mdio_write_c45(struct mii_bus *bus, int mii_id,
> goto mdio_write_exit;
>
> mdio_write_exit:
> - pm_runtime_mark_last_busy(&bp->pdev->dev);
> pm_runtime_put_autosuspend(&bp->pdev->dev);
> mdio_pm_exit:
> return status;
> @@ -5358,7 +5354,6 @@ static int macb_probe(struct platform_device *pdev)
> macb_is_gem(bp) ? "GEM" : "MACB", macb_readl(bp, MID),
> dev->base_addr, dev->irq, dev->dev_addr);
>
> - pm_runtime_mark_last_busy(&bp->pdev->dev);
> pm_runtime_put_autosuspend(&bp->pdev->dev);
>
> return 0;
> diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
> index d4eed252ad40..e6979599ae7e 100644
> --- a/drivers/net/ethernet/freescale/fec_main.c
> +++ b/drivers/net/ethernet/freescale/fec_main.c
> @@ -2207,7 +2207,6 @@ static int fec_enet_mdio_read_c22(struct mii_bus *bus, int mii_id, int regnum)
> ret = FEC_MMFR_DATA(readl(fep->hwp + FEC_MII_DATA));
>
> out:
> - pm_runtime_mark_last_busy(dev);
> pm_runtime_put_autosuspend(dev);
>
> return ret;
> @@ -2256,7 +2255,6 @@ static int fec_enet_mdio_read_c45(struct mii_bus *bus, int mii_id,
> ret = FEC_MMFR_DATA(readl(fep->hwp + FEC_MII_DATA));
>
> out:
> - pm_runtime_mark_last_busy(dev);
> pm_runtime_put_autosuspend(dev);
>
> return ret;
> @@ -2288,7 +2286,6 @@ static int fec_enet_mdio_write_c22(struct mii_bus *bus, int mii_id, int regnum,
> if (ret)
> netdev_err(fep->netdev, "MDIO write timeout\n");
>
> - pm_runtime_mark_last_busy(dev);
> pm_runtime_put_autosuspend(dev);
>
> return ret;
> @@ -2332,7 +2329,6 @@ static int fec_enet_mdio_write_c45(struct mii_bus *bus, int mii_id,
> netdev_err(fep->netdev, "MDIO write timeout\n");
>
> out:
> - pm_runtime_mark_last_busy(dev);
> pm_runtime_put_autosuspend(dev);
>
> return ret;
> @@ -2814,7 +2810,6 @@ static void fec_enet_get_regs(struct net_device *ndev,
> buf[off] = readl(&theregs[off]);
> }
>
> - pm_runtime_mark_last_busy(dev);
> pm_runtime_put_autosuspend(dev);
> }
>
> @@ -3590,7 +3585,6 @@ fec_enet_open(struct net_device *ndev)
> err_enet_alloc:
> fec_enet_clk_enable(ndev, false);
> clk_enable:
> - pm_runtime_mark_last_busy(&fep->pdev->dev);
> pm_runtime_put_autosuspend(&fep->pdev->dev);
> pinctrl_pm_select_sleep_state(&fep->pdev->dev);
> return ret;
> @@ -3621,7 +3615,6 @@ fec_enet_close(struct net_device *ndev)
> cpu_latency_qos_remove_request(&fep->pm_qos_req);
>
> pinctrl_pm_select_sleep_state(&fep->pdev->dev);
> - pm_runtime_mark_last_busy(&fep->pdev->dev);
> pm_runtime_put_autosuspend(&fep->pdev->dev);
>
> fec_enet_free_buffers(ndev);
> @@ -4568,7 +4561,6 @@ fec_probe(struct platform_device *pdev)
>
> INIT_WORK(&fep->tx_timeout_work, fec_enet_timeout_work);
>
> - pm_runtime_mark_last_busy(&pdev->dev);
> pm_runtime_put_autosuspend(&pdev->dev);
>
> return 0;
> diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c
> index c9f4976a3527..b8bfc3cdbb6b 100644
> --- a/drivers/net/ethernet/renesas/ravb_main.c
> +++ b/drivers/net/ethernet/renesas/ravb_main.c
> @@ -1974,7 +1974,6 @@ static int ravb_open(struct net_device *ndev)
> out_set_reset:
> ravb_set_opmode(ndev, CCC_OPC_RESET);
> out_rpm_put:
> - pm_runtime_mark_last_busy(dev);
> pm_runtime_put_autosuspend(dev);
> out_napi_off:
> if (info->nc_queues)
> @@ -2383,7 +2382,6 @@ static int ravb_close(struct net_device *ndev)
> if (error)
> return error;
>
> - pm_runtime_mark_last_busy(dev);
> pm_runtime_put_autosuspend(dev);
>
> return 0;
> @@ -3089,7 +3087,6 @@ static int ravb_probe(struct platform_device *pdev)
> netdev_info(ndev, "Base address at %#x, %pM, IRQ %d.\n",
> (u32)ndev->base_addr, ndev->dev_addr, ndev->irq);
>
> - pm_runtime_mark_last_busy(&pdev->dev);
> pm_runtime_put_autosuspend(&pdev->dev);
>
> return 0;
> @@ -3274,7 +3271,6 @@ static int ravb_resume(struct device *dev)
>
> out_rpm_put:
> if (!priv->wol_enabled) {
> - pm_runtime_mark_last_busy(dev);
> pm_runtime_put_autosuspend(dev);
> }
>
> diff --git a/drivers/net/ethernet/ti/davinci_mdio.c b/drivers/net/ethernet/ti/davinci_mdio.c
> index 68507126be8e..9f049ebbf107 100644
> --- a/drivers/net/ethernet/ti/davinci_mdio.c
> +++ b/drivers/net/ethernet/ti/davinci_mdio.c
> @@ -234,7 +234,6 @@ static int davinci_mdiobb_read_c22(struct mii_bus *bus, int phy, int reg)
>
> ret = mdiobb_read_c22(bus, phy, reg);
>
> - pm_runtime_mark_last_busy(bus->parent);
> pm_runtime_put_autosuspend(bus->parent);
>
> return ret;
> @@ -251,7 +250,6 @@ static int davinci_mdiobb_write_c22(struct mii_bus *bus, int phy, int reg,
>
> ret = mdiobb_write_c22(bus, phy, reg, val);
>
> - pm_runtime_mark_last_busy(bus->parent);
> pm_runtime_put_autosuspend(bus->parent);
>
> return ret;
> @@ -268,7 +266,6 @@ static int davinci_mdiobb_read_c45(struct mii_bus *bus, int phy, int devad,
>
> ret = mdiobb_read_c45(bus, phy, devad, reg);
>
> - pm_runtime_mark_last_busy(bus->parent);
> pm_runtime_put_autosuspend(bus->parent);
>
> return ret;
> @@ -285,7 +282,6 @@ static int davinci_mdiobb_write_c45(struct mii_bus *bus, int phy, int devad,
>
> ret = mdiobb_write_c45(bus, phy, devad, reg, val);
>
> - pm_runtime_mark_last_busy(bus->parent);
> pm_runtime_put_autosuspend(bus->parent);
>
> return ret;
> @@ -332,7 +328,6 @@ static int davinci_mdio_common_reset(struct davinci_mdio_data *data)
> data->bus->phy_mask = phy_mask;
>
> done:
> - pm_runtime_mark_last_busy(data->dev);
> pm_runtime_put_autosuspend(data->dev);
>
> return 0;
> @@ -441,7 +436,6 @@ static int davinci_mdio_read(struct mii_bus *bus, int phy_id, int phy_reg)
> break;
> }
>
> - pm_runtime_mark_last_busy(data->dev);
> pm_runtime_put_autosuspend(data->dev);
> return ret;
> }
> @@ -478,7 +472,6 @@ static int davinci_mdio_write(struct mii_bus *bus, int phy_id,
> break;
> }
>
> - pm_runtime_mark_last_busy(data->dev);
> pm_runtime_put_autosuspend(data->dev);
>
> return ret;
> --
> 2.39.5
>
--
Kind Regards,
Niklas Söderlund
Powered by blists - more mailing lists