linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Pranjal Shrivastava <praan@google.com>
To: Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: Will Deacon <will@kernel.org>,
	Robin Murphy <robin.murphy@arm.com>,
	Joerg Roedel <joro@8bytes.org>, Jason Gunthorpe <jgg@ziepe.ca>,
	Rob Clark <robdclark@chromium.org>,
	Georgi Djakov <quic_c_gdjako@quicinc.com>,
	linux-arm-kernel@lists.infradead.org, iommu@lists.linux.dev
Subject: Re: [PATCH 22/51] iommu/arm-smmu: Switch to __pm_runtime_put_autosuspend()
Date: Thu, 10 Oct 2024 15:33:11 +0000	[thread overview]
Message-ID: <ZwfztwoGAcvyvlWL@google.com> (raw)
In-Reply-To: <20241004094123.113725-1-sakari.ailus@linux.intel.com>

On Fri, Oct 04, 2024 at 12:41:23PM +0300, Sakari Ailus wrote:
> pm_runtime_put_autosuspend() will soon be changed to include a call to
> pm_runtime_mark_last_busy(). This patch switches the current users to
> __pm_runtime_put_autosuspend() which will continue to have the
> functionality of old pm_runtime_put_autosuspend().
> 
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> ---
>  drivers/iommu/arm/arm-smmu/arm-smmu.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu.c b/drivers/iommu/arm/arm-smmu/arm-smmu.c
> index 8321962b3714..cad02d5dc6d2 100644
> --- a/drivers/iommu/arm/arm-smmu/arm-smmu.c
> +++ b/drivers/iommu/arm/arm-smmu/arm-smmu.c
> @@ -79,7 +79,7 @@ static inline int arm_smmu_rpm_get(struct arm_smmu_device *smmu)
>  static inline void arm_smmu_rpm_put(struct arm_smmu_device *smmu)
>  {
>  	if (pm_runtime_enabled(smmu->dev))
> -		pm_runtime_put_autosuspend(smmu->dev);
> +		__pm_runtime_put_autosuspend(smmu->dev);
>  }

Seems like a straightforward change as a result of [1].
Although, I had a few things to discuss:

1. The `rpm_resume` in drivers/base/power/runtime.c seems to call
`pm_runtime_mark_last_busy` in case the ->runtime_resume callback
returned successfully. In such a case, why would we want to move
`pm_runtime_mark_last_busy` within `pm_runtime_put_autosuspend` ?

2. In the arm-smmu driver, we seem to rely on the rpm_resume to call
`pm_runtime_mark_last_busy` as a part of the ->runtime_resume callback.
The only other case, where we might wanna `*mark_last_busy` is if we
want the autosuspend timer to be re-started in case of a failed suspend.
However, the `arm_smmu_runtime_suspend` doesn't return errno in any case
hence, I don't see any other case where we'd benefit from using
`mark_last_busy` in the arm-smmu driver. 

On the other hand, I don't see a problem with using it either :)
Any thoughts Will/Rob/Robin?

>  
>  static void arm_smmu_rpm_use_autosuspend(struct arm_smmu_device *smmu)
> -- 
> 2.39.5
> 

Apart from the above discussion, for this patch alone:
Reviewed-by: Pranjal Shrivastava <praan@google.com>

Thanks,
Pranjal

[1]
 https://lore.kernel.org/all/20240109133639.111210-1-sakari.ailus@linux.intel.com/


  reply	other threads:[~2024-10-10 15:56 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-04  9:41 [PATCH 00/51] treewide: Switch to __pm_runtime_put_autosuspend() Sakari Ailus
2024-10-04  9:41 ` [PATCH 15/51] stm class: " Sakari Ailus
2024-10-24 10:59   ` Alexander Shishkin
2024-10-04  9:41 ` [PATCH 23/51] irqchip/imx-irqsteer: " Sakari Ailus
2024-10-06 19:52   ` Thomas Gleixner
2024-10-04  9:41 ` [PATCH 22/51] iommu/arm-smmu: " Sakari Ailus
2024-10-10 15:33   ` Pranjal Shrivastava [this message]
2024-10-23 16:48     ` Will Deacon
2024-10-24 15:26       ` Pranjal Shrivastava
2024-10-04  9:41 ` [PATCH 24/51] mailbox: mtk-cmdq-mailbox: " Sakari Ailus
2024-10-07 14:27   ` Matthias Brugger
2024-10-04  9:41 ` [PATCH 37/51] regulator: stm32-vrefbuf: " Sakari Ailus
2024-10-04 11:34   ` Mark Brown
2024-10-04  9:41 ` [PATCH 51/51] soc: apple: mailbox: " Sakari Ailus
2024-10-04 14:38 ` [PATCH 00/51] treewide: " Ulf Hansson
2024-10-07 18:49   ` Laurent Pinchart
2024-10-07 22:08     ` Ulf Hansson
2024-10-07 22:25       ` Laurent Pinchart
2024-10-07 22:34         ` Ulf Hansson
2024-10-08 18:24           ` Rafael J. Wysocki
2024-10-09 10:20             ` Rafael J. Wysocki
2024-10-09 10:27             ` Ulf Hansson
2024-10-09 12:48             ` Richard Fitzgerald
2024-10-09 13:34               ` Rafael J. Wysocki
2024-10-08 20:38     ` Uwe Kleine-König

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZwfztwoGAcvyvlWL@google.com \
    --to=praan@google.com \
    --cc=iommu@lists.linux.dev \
    --cc=jgg@ziepe.ca \
    --cc=joro@8bytes.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=quic_c_gdjako@quicinc.com \
    --cc=robdclark@chromium.org \
    --cc=robin.murphy@arm.com \
    --cc=sakari.ailus@linux.intel.com \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).