[PATCH 19/80] drm/panfrost: Remove redundant pm_runtime_mark_last_busy() calls

Sakari Ailus posted 80 patches 3 months ago
[PATCH 19/80] drm/panfrost: 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/gpu/drm/panfrost/panfrost_perfcnt.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/panfrost/panfrost_perfcnt.c b/drivers/gpu/drm/panfrost/panfrost_perfcnt.c
index 563f16bae543..0dd62e8b2fa7 100644
--- a/drivers/gpu/drm/panfrost/panfrost_perfcnt.c
+++ b/drivers/gpu/drm/panfrost/panfrost_perfcnt.c
@@ -203,7 +203,6 @@ static int panfrost_perfcnt_disable_locked(struct panfrost_device *pfdev,
 	panfrost_mmu_as_put(pfdev, perfcnt->mapping->mmu);
 	panfrost_gem_mapping_put(perfcnt->mapping);
 	perfcnt->mapping = NULL;
-	pm_runtime_mark_last_busy(pfdev->dev);
 	pm_runtime_put_autosuspend(pfdev->dev);
 
 	return 0;
@@ -279,7 +278,6 @@ void panfrost_perfcnt_close(struct drm_file *file_priv)
 	if (perfcnt->user == pfile)
 		panfrost_perfcnt_disable_locked(pfdev, file_priv);
 	mutex_unlock(&perfcnt->lock);
-	pm_runtime_mark_last_busy(pfdev->dev);
 	pm_runtime_put_autosuspend(pfdev->dev);
 }
 
-- 
2.39.5
Re: [PATCH 19/80] drm/panfrost: Remove redundant pm_runtime_mark_last_busy() calls
Posted by Steven Price 3 months ago
On 04/07/2025 08:54, 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@linux.intel.com>

Reviewed-by: Steven Price <steven.price@arm.com>

But this can't be merged via drm-misc until the PM changes have hit
Linus' tree and been backmerged to drm-misc-next.

Thanks,
Steve

> ---
> 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/gpu/drm/panfrost/panfrost_perfcnt.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/panfrost/panfrost_perfcnt.c b/drivers/gpu/drm/panfrost/panfrost_perfcnt.c
> index 563f16bae543..0dd62e8b2fa7 100644
> --- a/drivers/gpu/drm/panfrost/panfrost_perfcnt.c
> +++ b/drivers/gpu/drm/panfrost/panfrost_perfcnt.c
> @@ -203,7 +203,6 @@ static int panfrost_perfcnt_disable_locked(struct panfrost_device *pfdev,
>  	panfrost_mmu_as_put(pfdev, perfcnt->mapping->mmu);
>  	panfrost_gem_mapping_put(perfcnt->mapping);
>  	perfcnt->mapping = NULL;
> -	pm_runtime_mark_last_busy(pfdev->dev);
>  	pm_runtime_put_autosuspend(pfdev->dev);
>  
>  	return 0;
> @@ -279,7 +278,6 @@ void panfrost_perfcnt_close(struct drm_file *file_priv)
>  	if (perfcnt->user == pfile)
>  		panfrost_perfcnt_disable_locked(pfdev, file_priv);
>  	mutex_unlock(&perfcnt->lock);
> -	pm_runtime_mark_last_busy(pfdev->dev);
>  	pm_runtime_put_autosuspend(pfdev->dev);
>  }
>
Re: [PATCH 19/80] drm/panfrost: Remove redundant pm_runtime_mark_last_busy() calls
Posted by Steven Price 1 month, 3 weeks ago
On 04/07/2025 10:18, Steven Price wrote:
> On 04/07/2025 08:54, 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@linux.intel.com>
> 
> Reviewed-by: Steven Price <steven.price@arm.com>
> 
> But this can't be merged via drm-misc until the PM changes have hit
> Linus' tree and been backmerged to drm-misc-next.

The back merged of -rc1 happened, so I've now merged this to drm-misc-next.

Thanks,
Steve

> Thanks,
> Steve
> 
>> ---
>> 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/gpu/drm/panfrost/panfrost_perfcnt.c | 2 --
>>  1 file changed, 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/panfrost/panfrost_perfcnt.c b/drivers/gpu/drm/panfrost/panfrost_perfcnt.c
>> index 563f16bae543..0dd62e8b2fa7 100644
>> --- a/drivers/gpu/drm/panfrost/panfrost_perfcnt.c
>> +++ b/drivers/gpu/drm/panfrost/panfrost_perfcnt.c
>> @@ -203,7 +203,6 @@ static int panfrost_perfcnt_disable_locked(struct panfrost_device *pfdev,
>>  	panfrost_mmu_as_put(pfdev, perfcnt->mapping->mmu);
>>  	panfrost_gem_mapping_put(perfcnt->mapping);
>>  	perfcnt->mapping = NULL;
>> -	pm_runtime_mark_last_busy(pfdev->dev);
>>  	pm_runtime_put_autosuspend(pfdev->dev);
>>  
>>  	return 0;
>> @@ -279,7 +278,6 @@ void panfrost_perfcnt_close(struct drm_file *file_priv)
>>  	if (perfcnt->user == pfile)
>>  		panfrost_perfcnt_disable_locked(pfdev, file_priv);
>>  	mutex_unlock(&perfcnt->lock);
>> -	pm_runtime_mark_last_busy(pfdev->dev);
>>  	pm_runtime_put_autosuspend(pfdev->dev);
>>  }
>>  
>