[PATCH 38/80] iio: temperature: Remove redundant pm_runtime_mark_last_busy() calls

Sakari Ailus posted 80 patches 3 months ago
[PATCH 38/80] iio: temperature: Remove redundant pm_runtime_mark_last_busy() calls
Posted by Sakari Ailus 3 months ago
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@linux.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/iio/temperature/mlx90614.c | 1 -
 drivers/iio/temperature/mlx90632.c | 1 -
 drivers/iio/temperature/mlx90635.c | 1 -
 3 files changed, 3 deletions(-)

diff --git a/drivers/iio/temperature/mlx90614.c b/drivers/iio/temperature/mlx90614.c
index 740018d4b3df..8a44a00bfd5e 100644
--- a/drivers/iio/temperature/mlx90614.c
+++ b/drivers/iio/temperature/mlx90614.c
@@ -225,7 +225,6 @@ static void mlx90614_power_put(struct mlx90614_data *data)
 	if (!data->wakeup_gpio)
 		return;
 
-	pm_runtime_mark_last_busy(&data->client->dev);
 	pm_runtime_put_autosuspend(&data->client->dev);
 }
 #else
diff --git a/drivers/iio/temperature/mlx90632.c b/drivers/iio/temperature/mlx90632.c
index ae4ea587e7f9..bf689f6143f3 100644
--- a/drivers/iio/temperature/mlx90632.c
+++ b/drivers/iio/temperature/mlx90632.c
@@ -1043,7 +1043,6 @@ static int mlx90632_read_raw(struct iio_dev *indio_dev,
 	}
 
 mlx90632_read_raw_pm:
-	pm_runtime_mark_last_busy(&data->client->dev);
 	pm_runtime_put_autosuspend(&data->client->dev);
 	return ret;
 }
diff --git a/drivers/iio/temperature/mlx90635.c b/drivers/iio/temperature/mlx90635.c
index f7f88498ba0e..80d0eb7d2294 100644
--- a/drivers/iio/temperature/mlx90635.c
+++ b/drivers/iio/temperature/mlx90635.c
@@ -749,7 +749,6 @@ static int mlx90635_read_raw(struct iio_dev *indio_dev,
 	}
 
 mlx90635_read_raw_pm:
-	pm_runtime_mark_last_busy(&data->client->dev);
 	pm_runtime_put_autosuspend(&data->client->dev);
 	return ret;
 }
-- 
2.39.5
Re: [PATCH 38/80] iio: temperature: Remove redundant pm_runtime_mark_last_busy() calls
Posted by Crt Mori 3 months ago
If that is the case then:
Acked-by: Crt Mori<cmo@melexis.com>



On Fri, 4 Jul 2025 at 09:54, Sakari Ailus <sakari.ailus@linux.intel.com> 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@linux.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/iio/temperature/mlx90614.c | 1 -
>  drivers/iio/temperature/mlx90632.c | 1 -
>  drivers/iio/temperature/mlx90635.c | 1 -
>  3 files changed, 3 deletions(-)
>
> diff --git a/drivers/iio/temperature/mlx90614.c b/drivers/iio/temperature/mlx90614.c
> index 740018d4b3df..8a44a00bfd5e 100644
> --- a/drivers/iio/temperature/mlx90614.c
> +++ b/drivers/iio/temperature/mlx90614.c
> @@ -225,7 +225,6 @@ static void mlx90614_power_put(struct mlx90614_data *data)
>         if (!data->wakeup_gpio)
>                 return;
>
> -       pm_runtime_mark_last_busy(&data->client->dev);
>         pm_runtime_put_autosuspend(&data->client->dev);
>  }
>  #else
> diff --git a/drivers/iio/temperature/mlx90632.c b/drivers/iio/temperature/mlx90632.c
> index ae4ea587e7f9..bf689f6143f3 100644
> --- a/drivers/iio/temperature/mlx90632.c
> +++ b/drivers/iio/temperature/mlx90632.c
> @@ -1043,7 +1043,6 @@ static int mlx90632_read_raw(struct iio_dev *indio_dev,
>         }
>
>  mlx90632_read_raw_pm:
> -       pm_runtime_mark_last_busy(&data->client->dev);
>         pm_runtime_put_autosuspend(&data->client->dev);
>         return ret;
>  }
> diff --git a/drivers/iio/temperature/mlx90635.c b/drivers/iio/temperature/mlx90635.c
> index f7f88498ba0e..80d0eb7d2294 100644
> --- a/drivers/iio/temperature/mlx90635.c
> +++ b/drivers/iio/temperature/mlx90635.c
> @@ -749,7 +749,6 @@ static int mlx90635_read_raw(struct iio_dev *indio_dev,
>         }
>
>  mlx90635_read_raw_pm:
> -       pm_runtime_mark_last_busy(&data->client->dev);
>         pm_runtime_put_autosuspend(&data->client->dev);
>         return ret;
>  }
> --
> 2.39.5
>
Re: [PATCH 38/80] iio: temperature: Remove redundant pm_runtime_mark_last_busy() calls
Posted by Jonathan Cameron 3 months ago
On Fri, 4 Jul 2025 18:00:02 +0200
Crt Mori <cmo@melexis.com> wrote:

> If that is the case then:
> Acked-by: Crt Mori<cmo@melexis.com>
> 
> 
> 
> On Fri, 4 Jul 2025 at 09:54, Sakari Ailus <sakari.ailus@linux.intel.com> 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@linux.intel.com>
No {} issues in here so applied to the testing branch of iio.git.
I'll push it out as togreg later in the week at which point linux-next
will see it.

Jonathan

> > ---
> > 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/iio/temperature/mlx90614.c | 1 -
> >  drivers/iio/temperature/mlx90632.c | 1 -
> >  drivers/iio/temperature/mlx90635.c | 1 -
> >  3 files changed, 3 deletions(-)
> >
> > diff --git a/drivers/iio/temperature/mlx90614.c b/drivers/iio/temperature/mlx90614.c
> > index 740018d4b3df..8a44a00bfd5e 100644
> > --- a/drivers/iio/temperature/mlx90614.c
> > +++ b/drivers/iio/temperature/mlx90614.c
> > @@ -225,7 +225,6 @@ static void mlx90614_power_put(struct mlx90614_data *data)
> >         if (!data->wakeup_gpio)
> >                 return;
> >
> > -       pm_runtime_mark_last_busy(&data->client->dev);
> >         pm_runtime_put_autosuspend(&data->client->dev);
> >  }
> >  #else
> > diff --git a/drivers/iio/temperature/mlx90632.c b/drivers/iio/temperature/mlx90632.c
> > index ae4ea587e7f9..bf689f6143f3 100644
> > --- a/drivers/iio/temperature/mlx90632.c
> > +++ b/drivers/iio/temperature/mlx90632.c
> > @@ -1043,7 +1043,6 @@ static int mlx90632_read_raw(struct iio_dev *indio_dev,
> >         }
> >
> >  mlx90632_read_raw_pm:
> > -       pm_runtime_mark_last_busy(&data->client->dev);
> >         pm_runtime_put_autosuspend(&data->client->dev);
> >         return ret;
> >  }
> > diff --git a/drivers/iio/temperature/mlx90635.c b/drivers/iio/temperature/mlx90635.c
> > index f7f88498ba0e..80d0eb7d2294 100644
> > --- a/drivers/iio/temperature/mlx90635.c
> > +++ b/drivers/iio/temperature/mlx90635.c
> > @@ -749,7 +749,6 @@ static int mlx90635_read_raw(struct iio_dev *indio_dev,
> >         }
> >
> >  mlx90635_read_raw_pm:
> > -       pm_runtime_mark_last_busy(&data->client->dev);
> >         pm_runtime_put_autosuspend(&data->client->dev);
> >         return ret;
> >  }
> > --
> > 2.39.5
> >
Re: [PATCH 38/80] iio: temperature: Remove redundant pm_runtime_mark_last_busy() calls
Posted by Jonathan Cameron 3 months ago
On Sun, 6 Jul 2025 11:25:02 +0100
Jonathan Cameron <jic23@kernel.org> wrote:

> On Fri, 4 Jul 2025 18:00:02 +0200
> Crt Mori <cmo@melexis.com> wrote:
> 
> > If that is the case then:
> > Acked-by: Crt Mori<cmo@melexis.com>
> > 
> > 
> > 
> > On Fri, 4 Jul 2025 at 09:54, Sakari Ailus <sakari.ailus@linux.intel.com> 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@linux.intel.com>  
> No {} issues in here so applied to the testing branch of iio.git.
> I'll push it out as togreg later in the week at which point linux-next
> will see it.
> 
Actually - change of plan.  I'll wait on your set with the others fixed
up as I don't want to pull in the pm-runtime change if I'm only going
to have a few of these ready by the end of the cycle. I don't mind merging
that with the whole lot if they are ready though.

Jonathan

> Jonathan
> 
> > > ---
> > > 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/iio/temperature/mlx90614.c | 1 -
> > >  drivers/iio/temperature/mlx90632.c | 1 -
> > >  drivers/iio/temperature/mlx90635.c | 1 -
> > >  3 files changed, 3 deletions(-)
> > >
> > > diff --git a/drivers/iio/temperature/mlx90614.c b/drivers/iio/temperature/mlx90614.c
> > > index 740018d4b3df..8a44a00bfd5e 100644
> > > --- a/drivers/iio/temperature/mlx90614.c
> > > +++ b/drivers/iio/temperature/mlx90614.c
> > > @@ -225,7 +225,6 @@ static void mlx90614_power_put(struct mlx90614_data *data)
> > >         if (!data->wakeup_gpio)
> > >                 return;
> > >
> > > -       pm_runtime_mark_last_busy(&data->client->dev);
> > >         pm_runtime_put_autosuspend(&data->client->dev);
> > >  }
> > >  #else
> > > diff --git a/drivers/iio/temperature/mlx90632.c b/drivers/iio/temperature/mlx90632.c
> > > index ae4ea587e7f9..bf689f6143f3 100644
> > > --- a/drivers/iio/temperature/mlx90632.c
> > > +++ b/drivers/iio/temperature/mlx90632.c
> > > @@ -1043,7 +1043,6 @@ static int mlx90632_read_raw(struct iio_dev *indio_dev,
> > >         }
> > >
> > >  mlx90632_read_raw_pm:
> > > -       pm_runtime_mark_last_busy(&data->client->dev);
> > >         pm_runtime_put_autosuspend(&data->client->dev);
> > >         return ret;
> > >  }
> > > diff --git a/drivers/iio/temperature/mlx90635.c b/drivers/iio/temperature/mlx90635.c
> > > index f7f88498ba0e..80d0eb7d2294 100644
> > > --- a/drivers/iio/temperature/mlx90635.c
> > > +++ b/drivers/iio/temperature/mlx90635.c
> > > @@ -749,7 +749,6 @@ static int mlx90635_read_raw(struct iio_dev *indio_dev,
> > >         }
> > >
> > >  mlx90635_read_raw_pm:
> > > -       pm_runtime_mark_last_busy(&data->client->dev);
> > >         pm_runtime_put_autosuspend(&data->client->dev);
> > >         return ret;
> > >  }
> > > --
> > > 2.39.5
> > >    
>
Re: [PATCH 38/80] iio: temperature: Remove redundant pm_runtime_mark_last_busy() calls
Posted by Sakari Ailus 3 months ago
Hi Jonathan,

On Sun, Jul 06, 2025 at 11:26:31AM +0100, Jonathan Cameron wrote:
> On Sun, 6 Jul 2025 11:25:02 +0100
> Jonathan Cameron <jic23@kernel.org> wrote:
> 
> > On Fri, 4 Jul 2025 18:00:02 +0200
> > Crt Mori <cmo@melexis.com> wrote:
> > 
> > > If that is the case then:
> > > Acked-by: Crt Mori<cmo@melexis.com>
> > > 
> > > 
> > > 
> > > On Fri, 4 Jul 2025 at 09:54, Sakari Ailus <sakari.ailus@linux.intel.com> 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@linux.intel.com>  
> > No {} issues in here so applied to the testing branch of iio.git.
> > I'll push it out as togreg later in the week at which point linux-next
> > will see it.
> > 
> Actually - change of plan.  I'll wait on your set with the others fixed
> up as I don't want to pull in the pm-runtime change if I'm only going
> to have a few of these ready by the end of the cycle. I don't mind merging
> that with the whole lot if they are ready though.

Thanks for the review. I'll send v2 of the iio-related patches soonish.

-- 
Kind regards,

Sakari Ailus