* [PATCH v1 05/23] media: rkisp1: Discard pm_runtime_put() return value
[not found] <6245770.lOV4Wx5bFT@rafael.j.wysocki>
@ 2025-12-22 20:01 ` Rafael J. Wysocki
2025-12-23 16:30 ` Laurent Pinchart
2025-12-22 20:03 ` [PATCH v1 06/23] media: ccs: " Rafael J. Wysocki
2025-12-22 20:06 ` [PATCH v1 07/23] media: mediatek: vcodec: " Rafael J. Wysocki
2 siblings, 1 reply; 5+ messages in thread
From: Rafael J. Wysocki @ 2025-12-22 20:01 UTC (permalink / raw)
To: Linux PM
Cc: LKML, Ulf Hansson, Brian Norris, Dafna Hirschfeld,
Laurent Pinchart, Mauro Carvalho Chehab, Heiko Stuebner,
linux-media, linux-rockchip
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 rkisp1_vb2_stop_streaming() 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 patch is part of a series, but it doesn't depend on anything else
in that series. The last patch in the series depends on it.
It can be applied by itself and if you decide to do so, 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.
---
drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
--- a/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c
+++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c
@@ -1123,7 +1123,6 @@ static void rkisp1_vb2_stop_streaming(st
struct rkisp1_capture *cap = queue->drv_priv;
struct rkisp1_vdev_node *node = &cap->vnode;
struct rkisp1_device *rkisp1 = cap->rkisp1;
- int ret;
mutex_lock(&cap->rkisp1->stream_lock);
@@ -1132,9 +1131,7 @@ static void rkisp1_vb2_stop_streaming(st
rkisp1_return_all_buffers(cap, VB2_BUF_STATE_ERROR);
v4l2_pipeline_pm_put(&node->vdev.entity);
- ret = pm_runtime_put(rkisp1->dev);
- if (ret < 0)
- dev_err(rkisp1->dev, "power down failed error:%d\n", ret);
+ pm_runtime_put(rkisp1->dev);
rkisp1_dummy_buf_destroy(cap);
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v1 06/23] media: ccs: Discard pm_runtime_put() return value
[not found] <6245770.lOV4Wx5bFT@rafael.j.wysocki>
2025-12-22 20:01 ` [PATCH v1 05/23] media: rkisp1: Discard pm_runtime_put() return value Rafael J. Wysocki
@ 2025-12-22 20:03 ` Rafael J. Wysocki
2026-01-07 18:51 ` Sakari Ailus
2025-12-22 20:06 ` [PATCH v1 07/23] media: mediatek: vcodec: " Rafael J. Wysocki
2 siblings, 1 reply; 5+ messages in thread
From: Rafael J. Wysocki @ 2025-12-22 20:03 UTC (permalink / raw)
To: Linux PM
Cc: LKML, Ulf Hansson, Brian Norris, Sakari Ailus,
Mauro Carvalho Chehab, linux-media
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Passing the pm_runtime_put() return value to callers 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. It also happens when the kernel is
configured with CONFIG_PM unset.
Accordingly, update ccs_post_streamoff() to simply discard the return
value of pm_runtime_put() and always return success to the caller.
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 patch is part of a series, but it doesn't depend on anything else
in that series. The last patch in the series depends on it.
It can be applied by itself and if you decide to do so, 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.
---
drivers/media/i2c/ccs/ccs-core.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--- a/drivers/media/i2c/ccs/ccs-core.c
+++ b/drivers/media/i2c/ccs/ccs-core.c
@@ -1974,7 +1974,9 @@ static int ccs_post_streamoff(struct v4l
struct ccs_sensor *sensor = to_ccs_sensor(subdev);
struct i2c_client *client = v4l2_get_subdevdata(&sensor->src->sd);
- return pm_runtime_put(&client->dev);
+ pm_runtime_put(&client->dev);
+
+ return 0;
}
static int ccs_enum_mbus_code(struct v4l2_subdev *subdev,
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v1 07/23] media: mediatek: vcodec: Discard pm_runtime_put() return value
[not found] <6245770.lOV4Wx5bFT@rafael.j.wysocki>
2025-12-22 20:01 ` [PATCH v1 05/23] media: rkisp1: Discard pm_runtime_put() return value Rafael J. Wysocki
2025-12-22 20:03 ` [PATCH v1 06/23] media: ccs: " Rafael J. Wysocki
@ 2025-12-22 20:06 ` Rafael J. Wysocki
2 siblings, 0 replies; 5+ messages in thread
From: Rafael J. Wysocki @ 2025-12-22 20:06 UTC (permalink / raw)
To: Linux PM
Cc: LKML, Ulf Hansson, Brian Norris, Tiffany Lin, Andrew-CT Chen,
Yunfei Dong, Mauro Carvalho Chehab, Matthias Brugger,
AngeloGioacchino Del Regno, linux-media, 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 patch is part of a series, but it doesn't depend on anything else
in that series. The last patch in the series depends on it.
It can be applied by itself and if you decide to do so, 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.
---
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] 5+ messages in thread
* Re: [PATCH v1 05/23] media: rkisp1: Discard pm_runtime_put() return value
2025-12-22 20:01 ` [PATCH v1 05/23] media: rkisp1: Discard pm_runtime_put() return value Rafael J. Wysocki
@ 2025-12-23 16:30 ` Laurent Pinchart
0 siblings, 0 replies; 5+ messages in thread
From: Laurent Pinchart @ 2025-12-23 16:30 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: Linux PM, LKML, Ulf Hansson, Brian Norris, Dafna Hirschfeld,
Mauro Carvalho Chehab, Heiko Stuebner, linux-media,
linux-rockchip
Hi Rafael,
Thank you for the patch.
On Mon, Dec 22, 2025 at 09:01:55PM +0100, Rafael J. Wysocki wrote:
> 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 rkisp1_vb2_stop_streaming() 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: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
>
> This patch is part of a series, but it doesn't depend on anything else
> in that series. The last patch in the series depends on it.
>
> It can be applied by itself and if you decide to do so, please let me
> know.
I've applied the patch to my tree for v6.20.
> Otherwise, an ACK or equivalent will be appreciated, but also the lack
> of specific criticism will be eventually regarded as consent.
>
> ---
> drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> --- a/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c
> +++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c
> @@ -1123,7 +1123,6 @@ static void rkisp1_vb2_stop_streaming(st
> struct rkisp1_capture *cap = queue->drv_priv;
> struct rkisp1_vdev_node *node = &cap->vnode;
> struct rkisp1_device *rkisp1 = cap->rkisp1;
> - int ret;
>
> mutex_lock(&cap->rkisp1->stream_lock);
>
> @@ -1132,9 +1131,7 @@ static void rkisp1_vb2_stop_streaming(st
> rkisp1_return_all_buffers(cap, VB2_BUF_STATE_ERROR);
>
> v4l2_pipeline_pm_put(&node->vdev.entity);
> - ret = pm_runtime_put(rkisp1->dev);
> - if (ret < 0)
> - dev_err(rkisp1->dev, "power down failed error:%d\n", ret);
> + pm_runtime_put(rkisp1->dev);
>
> rkisp1_dummy_buf_destroy(cap);
>
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v1 06/23] media: ccs: Discard pm_runtime_put() return value
2025-12-22 20:03 ` [PATCH v1 06/23] media: ccs: " Rafael J. Wysocki
@ 2026-01-07 18:51 ` Sakari Ailus
0 siblings, 0 replies; 5+ messages in thread
From: Sakari Ailus @ 2026-01-07 18:51 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: Linux PM, LKML, Ulf Hansson, Brian Norris, Mauro Carvalho Chehab,
linux-media
Hi Rafael,
On Mon, Dec 22, 2025 at 09:03:25PM +0100, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>
> Passing the pm_runtime_put() return value to callers 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. It also happens when the kernel is
> configured with CONFIG_PM unset.
>
> Accordingly, update ccs_post_streamoff() to simply discard the return
> value of pm_runtime_put() and always return success to the caller.
>
> 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 patch is part of a series, but it doesn't depend on anything else
> in that series. The last patch in the series depends on it.
>
> It can be applied by itself and if you decide to do so, 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.
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
--
Sakari Ailus
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-01-07 18:51 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <6245770.lOV4Wx5bFT@rafael.j.wysocki>
2025-12-22 20:01 ` [PATCH v1 05/23] media: rkisp1: Discard pm_runtime_put() return value Rafael J. Wysocki
2025-12-23 16:30 ` Laurent Pinchart
2025-12-22 20:03 ` [PATCH v1 06/23] media: ccs: " Rafael J. Wysocki
2026-01-07 18:51 ` Sakari Ailus
2025-12-22 20:06 ` [PATCH v1 07/23] media: mediatek: vcodec: " Rafael J. Wysocki
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox