mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [RESEND][PATCH v1] media: mediatek: vcodec: Discard pm_runtime_put() return value
@ 2026-01-08 15:23 Rafael J. Wysocki
  2026-01-08 19:51 ` Nicolas Dufresne
  0 siblings, 1 reply; 2+ messages in thread
From: Rafael J. Wysocki @ 2026-01-08 15:23 UTC (permalink / raw)
  To: Linux PM, linux-media
  Cc: LKML, Ulf Hansson, Brian Norris, Tiffany Lin, Andrew-CT Chen,
	Yunfei Dong, Mauro Carvalho Chehab, Matthias Brugger,
	AngeloGioacchino Del Regno, linux-mediatek

From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

Printing error messages on pm_runtime_put() returning negative values
is not particularly useful.

Returning an error code from pm_runtime_put() merely means that it has
not queued up a work item to check whether or not the device can be
suspended and there are many perfectly valid situations in which that
can happen, like after writing "on" to the devices' runtime PM "control"
attribute in sysfs for one example.

Accordingly, update mtk_vcodec_enc_pw_off() and mtk_vcodec_dec_pw_off()
to simply discard the return value of pm_runtime_put().

This will facilitate a planned change of the pm_runtime_put() return
type to void in the future.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---

This is requisite for converting pm_runtime_put() into a void function.

If you decide to pick it up, please let me know.

Otherwise, an ACK or equivalent will be appreciated, but also the lack
of specific criticism will be eventually regarded as consent.

Originally posted here:

https://lore.kernel.org/linux-pm/3690736.iIbC2pHGDl@rafael.j.wysocki/

---
 drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_pm.c |    6 +-----
 drivers/media/platform/mediatek/vcodec/encoder/mtk_vcodec_enc_pm.c |    6 +-----
 2 files changed, 2 insertions(+), 10 deletions(-)

--- a/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_pm.c
+++ b/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_pm.c
@@ -67,11 +67,7 @@ static int mtk_vcodec_dec_pw_on(struct m
 
 static void mtk_vcodec_dec_pw_off(struct mtk_vcodec_pm *pm)
 {
-	int ret;
-
-	ret = pm_runtime_put(pm->dev);
-	if (ret && ret != -EAGAIN)
-		dev_err(pm->dev, "pm_runtime_put fail %d", ret);
+	pm_runtime_put(pm->dev);
 }
 
 static void mtk_vcodec_dec_clock_on(struct mtk_vcodec_pm *pm)
--- a/drivers/media/platform/mediatek/vcodec/encoder/mtk_vcodec_enc_pm.c
+++ b/drivers/media/platform/mediatek/vcodec/encoder/mtk_vcodec_enc_pm.c
@@ -71,11 +71,7 @@ int mtk_vcodec_enc_pw_on(struct mtk_vcod
 
 void mtk_vcodec_enc_pw_off(struct mtk_vcodec_pm *pm)
 {
-	int ret;
-
-	ret = pm_runtime_put(pm->dev);
-	if (ret && ret != -EAGAIN)
-		dev_err(pm->dev, "pm_runtime_put fail %d", ret);
+	pm_runtime_put(pm->dev);
 }
 
 void mtk_vcodec_enc_clock_on(struct mtk_vcodec_pm *pm)




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [RESEND][PATCH v1] media: mediatek: vcodec: Discard pm_runtime_put() return value
  2026-01-08 15:23 [RESEND][PATCH v1] media: mediatek: vcodec: Discard pm_runtime_put() return value Rafael J. Wysocki
@ 2026-01-08 19:51 ` Nicolas Dufresne
  0 siblings, 0 replies; 2+ messages in thread
From: Nicolas Dufresne @ 2026-01-08 19:51 UTC (permalink / raw)
  To: Rafael J. Wysocki, Linux PM, linux-media
  Cc: LKML, Ulf Hansson, Brian Norris, Tiffany Lin, Andrew-CT Chen,
	Yunfei Dong, Mauro Carvalho Chehab, Matthias Brugger,
	AngeloGioacchino Del Regno, linux-mediatek

[-- Attachment #1: Type: text/plain, Size: 2692 bytes --]

Le jeudi 08 janvier 2026 à 16:23 +0100, Rafael J. Wysocki a écrit :
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> 
> Printing error messages on pm_runtime_put() returning negative values
> is not particularly useful.
> 
> Returning an error code from pm_runtime_put() merely means that it has
> not queued up a work item to check whether or not the device can be
> suspended and there are many perfectly valid situations in which that
> can happen, like after writing "on" to the devices' runtime PM "control"
> attribute in sysfs for one example.
> 
> Accordingly, update mtk_vcodec_enc_pw_off() and mtk_vcodec_dec_pw_off()
> to simply discard the return value of pm_runtime_put().
> 
> This will facilitate a planned change of the pm_runtime_put() return
> type to void in the future.
> 
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>

> ---
> 
> This is requisite for converting pm_runtime_put() into a void function.
> 
> If you decide to pick it up, please let me know.
> 
> Otherwise, an ACK or equivalent will be appreciated, but also the lack
> of specific criticism will be eventually regarded as consent.
> 
> Originally posted here:
> 
> https://lore.kernel.org/linux-pm/3690736.iIbC2pHGDl@rafael.j.wysocki/
> 
> ---
>  drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_pm.c |    6 +--
> ---
>  drivers/media/platform/mediatek/vcodec/encoder/mtk_vcodec_enc_pm.c |    6 +--
> ---
>  2 files changed, 2 insertions(+), 10 deletions(-)
> 
> --- a/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_pm.c
> +++ b/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_pm.c
> @@ -67,11 +67,7 @@ static int mtk_vcodec_dec_pw_on(struct m
>  
>  static void mtk_vcodec_dec_pw_off(struct mtk_vcodec_pm *pm)
>  {
> -	int ret;
> -
> -	ret = pm_runtime_put(pm->dev);
> -	if (ret && ret != -EAGAIN)
> -		dev_err(pm->dev, "pm_runtime_put fail %d", ret);
> +	pm_runtime_put(pm->dev);
>  }
>  
>  static void mtk_vcodec_dec_clock_on(struct mtk_vcodec_pm *pm)
> --- a/drivers/media/platform/mediatek/vcodec/encoder/mtk_vcodec_enc_pm.c
> +++ b/drivers/media/platform/mediatek/vcodec/encoder/mtk_vcodec_enc_pm.c
> @@ -71,11 +71,7 @@ int mtk_vcodec_enc_pw_on(struct mtk_vcod
>  
>  void mtk_vcodec_enc_pw_off(struct mtk_vcodec_pm *pm)
>  {
> -	int ret;
> -
> -	ret = pm_runtime_put(pm->dev);
> -	if (ret && ret != -EAGAIN)
> -		dev_err(pm->dev, "pm_runtime_put fail %d", ret);
> +	pm_runtime_put(pm->dev);
>  }
>  
>  void mtk_vcodec_enc_clock_on(struct mtk_vcodec_pm *pm)
> 
> 
> 

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-01-08 19:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-01-08 15:23 [RESEND][PATCH v1] media: mediatek: vcodec: Discard pm_runtime_put() return value Rafael J. Wysocki
2026-01-08 19:51 ` Nicolas Dufresne

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®