[PATCH RESEND 1/4] net: ethernet: Remove redundant pm_runtime_mark_last_busy() calls

Niklas Söderlund niklas.soderlund at ragnatech.se
Mon Oct 27 05:05:59 PDT 2025


Hi Sakari,

Thanks for your work cleaning this up!

On 2025-10-27 13:50:19 +0200, 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 at linux.intel.com>
> ---
>  drivers/net/ethernet/cadence/macb_main.c  | 5 -----
>  drivers/net/ethernet/freescale/fec_main.c | 8 --------
>  drivers/net/ethernet/renesas/ravb_main.c  | 4 ----
>  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 39673f5c3337..847c4ab9df23 100644
> --- a/drivers/net/ethernet/cadence/macb_main.c
> +++ b/drivers/net/ethernet/cadence/macb_main.c
> @@ -327,7 +327,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;
> @@ -373,7 +372,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;
> @@ -405,7 +403,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;
> @@ -451,7 +448,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;
> @@ -5564,7 +5560,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 1edcfaee6819..4875101c4f3f 100644
> --- a/drivers/net/ethernet/freescale/fec_main.c
> +++ b/drivers/net/ethernet/freescale/fec_main.c
> @@ -2231,7 +2231,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;
> @@ -2280,7 +2279,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;
> @@ -2312,7 +2310,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;
> @@ -2356,7 +2353,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;
> @@ -2839,7 +2835,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);
>  }
>  
> @@ -3616,7 +3611,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;
> @@ -3647,7 +3641,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);
> @@ -4616,7 +4609,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 c3fc15f9ec85..21a45583e7e1 100644
> --- a/drivers/net/ethernet/renesas/ravb_main.c
> +++ b/drivers/net/ethernet/renesas/ravb_main.c
> @@ -1975,7 +1975,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)
> @@ -2404,7 +2403,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;
> @@ -3116,7 +3114,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;
> @@ -3301,7 +3298,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);
>  	}

You could drop the { } here. With this fixed for RAVB,

Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas at ragnatech.se>

>  
> 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.47.3
> 

-- 
Kind Regards,
Niklas Söderlund



More information about the linux-arm-kernel mailing list