* [PATCH 00/13] PM: runtime: Convert pm_runtime_put_autosuspend() and friends to a void function
@ 2026-10-06 23:13 Brian Norris
2026-10-06 23:13 ` [PATCH 08/13] ALSA: hda: Discard pm_runtime_put_autosuspend() return value Brian Norris
` (3 more replies)
0 siblings, 4 replies; 6+ messages in thread
From: Brian Norris @ 2026-10-06 23:13 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: linux-pm, Ulf Hansson, linux-kernel, Brian Norris,
Bryan O'Donoghue, Maíra Canal, Nuno Sá, Alex Elder,
Andy Shevchenko, Bard Liao, Bartosz Golaszewski, Bjorn Andersson,
Cezary Rojewski, Daniel Baluta, David Lechner, Dikshita Agarwal,
Geert Uytterhoeven, Greg Kroah-Hartman, Hadar Gat, Herbert Xu,
Jaroslav Kysela, Jessica Zhang, Johan Hovold, Jonathan Cameron,
Jyri Sarha, Kai Vehmanen, Liam Girdwood, Liam Girdwood,
Linus Walleij, Maarten Lankhorst, Magnus Damm, Marek Vasut,
Mark Brown, Mauro Carvalho Chehab, Maxime Ripard, Melissa Wen,
Neil Armstrong, Olivia Mackall, Peter Ujfalusi,
Pierre-Louis Bossart, Rui Miguel Silva, Srinivas Kandagatla,
Takashi Iwai, Thomas Zimmermann, Tomi Valkeinen, Vijendar Mukunda,
Vikash Garodia, dri-devel, greybus-dev, linux-arm-msm,
linux-crypto, linux-gpio, linux-iio, linux-media,
linux-renesas-soc, linux-sound, linux-spi, linux-staging,
sound-open-firmware
Similar to this effort:
Subject: [PATCH v1 00/23] PM: runtime: Convert pm_runtime_put() to a void function
https://lore.kernel.org/all/6245770.lOV4Wx5bFT@rafael.j.wysocki/
i.e., commit 3afd8df02433 ("PM: runtime: Change pm_runtime_put() return
type to void") and friends.
As with pm_runtime_put(), there is very little value in return-code
checking for any of the other async __pm_runtime_suspend() and
__pm_runtime_idle() APIs:
pm_runtime_put_autosuspend()
pm_request_idle()
pm_request_autosuspend()
Checking the return code is more likely to
produce a race condition (fighting with user space writing "on" to the
"control" attribute) than to tell a consumer useful info.
Nobody outside KUnit tests checks pm_request_idle() or
pm_request_autosuspend() return codes, but there are a number of
pm_runtime_put_autosuspend() callers that check its return code. Thus,
this series largely deals with pm_runtime_put_autosuspend().
Patches 1-11 are independent of each other, and similarly to the last
series, I expect the respective maintainers can pick them up. We can
apply patch 12 later. Patch 13 is also independent, but included in this
topic for completeness. It can be applied any time.
This touches a lot of trees/maintainers, so I tried to keep CC's only
for the relevant patch(es), plus the cover letter. I hope that's not too
noisy.
- Brian
Brian Norris (13):
hwrng: cctrng: Discard pm_runtime_put_autosuspend() return value
drm: Discard pm_runtime_put_autosuspend() return values
iio: Discard pm_runtime_put_autosuspend() return values
media: venus: Discard pm_runtime_put_autosuspend() return values
pinctrl: qcom: lpass-lpi: Discard pm_runtime_put_autosuspend() return
values
spi: ti-qspi: Discard pm_runtime_put_autosuspend() return value
greybus: Discard pm_runtime_put_autosuspend() return value
ALSA: hda: Discard pm_runtime_put_autosuspend() return value
ASoC: codecs: lpass: Discard pm_runtime_put_autosuspend() return
values
ASoC: intel: atom: Discard pm_runtime_put_autosuspend() return value
ASoC: SOF: Discard pm_runtime_put_autosuspend() return values
PM: runtime: Drop pm_runtime_put_autosuspend() return code
PM: runtime: Drop pm_request_{idle,autosuspend}() return codes
drivers/base/power/runtime-test.c | 8 ---
drivers/char/hw_random/cctrng.c | 6 +-
drivers/gpu/drm/panel/panel-simple.c | 8 +--
drivers/gpu/drm/tidss/tidss_drv.c | 7 +--
drivers/gpu/drm/v3d/v3d_drv.h | 4 +-
drivers/iio/accel/bmc150-accel-core.c | 14 ++---
drivers/iio/accel/fxls8962af-core.c | 11 +---
drivers/iio/accel/kxcjk-1013.c | 15 ++---
drivers/iio/accel/mma8452.c | 15 +++--
drivers/iio/accel/mma9551_core.c | 15 +++--
drivers/iio/adc/rcar-gyroadc.c | 4 +-
drivers/iio/adc/ti-ads1015.c | 8 +--
drivers/iio/chemical/atlas-sensor.c | 4 +-
.../common/hid-sensors/hid-sensor-trigger.c | 14 ++---
drivers/iio/gyro/bmg160_core.c | 17 +++--
drivers/iio/gyro/fxas21002c_core.c | 12 ++--
drivers/iio/imu/kmx61.c | 17 +++--
drivers/iio/light/apds9960.c | 2 +-
drivers/iio/light/isl29028.c | 15 +----
drivers/iio/light/pa12203001.c | 3 +-
drivers/iio/light/rpr0521.c | 15 +++--
drivers/iio/light/tsl2583.c | 27 ++------
drivers/iio/light/us5182d.c | 3 +-
drivers/media/platform/qcom/venus/vdec.c | 10 ++-
drivers/media/platform/qcom/venus/venc.c | 10 ++-
drivers/pinctrl/qcom/pinctrl-lpass-lpi.c | 16 +++--
drivers/spi/spi-ti-qspi.c | 6 +-
drivers/staging/greybus/power_supply.c | 8 +--
include/linux/greybus/bundle.h | 12 +---
include/linux/pm_runtime.h | 63 +++----------------
include/sound/hdaudio.h | 8 +--
sound/hda/core/device.c | 13 ++--
sound/soc/codecs/lpass-rx-macro.c | 4 +-
sound/soc/codecs/lpass-tx-macro.c | 4 +-
sound/soc/codecs/lpass-va-macro.c | 17 ++---
sound/soc/codecs/lpass-wsa-macro.c | 8 +--
sound/soc/intel/atom/sst/sst.h | 2 +-
sound/soc/intel/atom/sst/sst_drv_interface.c | 4 +-
sound/soc/intel/atom/sst/sst_pvt.c | 9 +--
sound/soc/sof/control.c | 6 +-
sound/soc/sof/sof-client-ipc-flood-test.c | 5 +-
.../soc/sof/sof-client-ipc-kernel-injector.c | 4 +-
sound/soc/sof/sof-client-ipc-msg-injector.c | 6 +-
sound/soc/sof/sof-client-probes.c | 18 ++----
44 files changed, 152 insertions(+), 325 deletions(-)
--
2.56.0.360.g66cac248cb-goog
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 08/13] ALSA: hda: Discard pm_runtime_put_autosuspend() return value
2026-10-06 23:13 [PATCH 00/13] PM: runtime: Convert pm_runtime_put_autosuspend() and friends to a void function Brian Norris
@ 2026-10-06 23:13 ` Brian Norris
2026-10-07 9:45 ` Takashi Iwai
2026-10-06 23:13 ` [PATCH 09/13] ASoC: codecs: lpass: Discard pm_runtime_put_autosuspend() return values Brian Norris
` (2 subsequent siblings)
3 siblings, 1 reply; 6+ messages in thread
From: Brian Norris @ 2026-10-06 23:13 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: linux-pm, Ulf Hansson, linux-kernel, Brian Norris,
Jaroslav Kysela, Takashi Iwai, linux-sound
snd_hdac_power_down() and snd_hdac_power_down_pm() are defined to return
an int, but their return values are never used by any caller.
snd_hdac_power_down() also passes the return value of
pm_runtime_put_autosuspend() to the caller, which is not very useful.
Returning an error code from pm_runtime_put_autosuspend() merely means
that it has not queued up a timer or 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
device's runtime PM "control" attribute in sysfs for one example.
Modify snd_hdac_power_down() to discard the pm_runtime_put_autosuspend()
return value and change the return types of snd_hdac_power_down() and
snd_hdac_power_down_pm() to void.
No intentional functional impact.
This will facilitate a planned change of the
pm_runtime_put_autosuspend() return type to void in the future, similar
to commit 3afd8df02433 ("PM: runtime: Change pm_runtime_put() return
type to void").
Signed-off-by: Brian Norris <briannorris@chromium.org>
---
This patch is independent of the rest of the series, except for the end
(changing the return type). I expect it can be applied by individual
maintainers, and we pick up the end once the dust is settled.
include/sound/hdaudio.h | 8 ++++----
sound/hda/core/device.c | 13 ++++---------
2 files changed, 8 insertions(+), 13 deletions(-)
diff --git a/include/sound/hdaudio.h b/include/sound/hdaudio.h
index aa994d6e6d35..4cbbb1744740 100644
--- a/include/sound/hdaudio.h
+++ b/include/sound/hdaudio.h
@@ -179,9 +179,9 @@ static inline int snd_hdac_read_parm(struct hdac_device *codec, hda_nid_t nid,
#ifdef CONFIG_PM
int snd_hdac_power_up(struct hdac_device *codec);
-int snd_hdac_power_down(struct hdac_device *codec);
+void snd_hdac_power_down(struct hdac_device *codec);
int snd_hdac_power_up_pm(struct hdac_device *codec);
-int snd_hdac_power_down_pm(struct hdac_device *codec);
+void snd_hdac_power_down_pm(struct hdac_device *codec);
int snd_hdac_keep_power_up(struct hdac_device *codec);
/* call this at entering into suspend/resume callbacks in codec driver */
@@ -207,9 +207,9 @@ static inline bool snd_hdac_is_power_on(struct hdac_device *codec)
}
#else
static inline int snd_hdac_power_up(struct hdac_device *codec) { return 0; }
-static inline int snd_hdac_power_down(struct hdac_device *codec) { return 0; }
+static inline void snd_hdac_power_down(struct hdac_device *codec) {}
static inline int snd_hdac_power_up_pm(struct hdac_device *codec) { return 0; }
-static inline int snd_hdac_power_down_pm(struct hdac_device *codec) { return 0; }
+static inline void snd_hdac_power_down_pm(struct hdac_device *codec) {}
static inline int snd_hdac_keep_power_up(struct hdac_device *codec) { return 0; }
static inline void snd_hdac_enter_pm(struct hdac_device *codec) {}
static inline void snd_hdac_leave_pm(struct hdac_device *codec) {}
diff --git a/sound/hda/core/device.c b/sound/hda/core/device.c
index a45f61e12c1a..6187ffaedbfa 100644
--- a/sound/hda/core/device.c
+++ b/sound/hda/core/device.c
@@ -572,14 +572,12 @@ EXPORT_SYMBOL_GPL(snd_hdac_power_up);
/**
* snd_hdac_power_down - power down the codec
* @codec: the codec object
- *
- * Returns zero if successful, or a negative error code.
*/
-int snd_hdac_power_down(struct hdac_device *codec)
+void snd_hdac_power_down(struct hdac_device *codec)
{
struct device *dev = &codec->dev;
- return pm_runtime_put_autosuspend(dev);
+ pm_runtime_put_autosuspend(dev);
}
EXPORT_SYMBOL_GPL(snd_hdac_power_down);
@@ -624,14 +622,11 @@ int snd_hdac_keep_power_up(struct hdac_device *codec)
*
* Like snd_hdac_power_up_pm(), this function is used in a recursive
* code path like init code which may be called by PM suspend/resume again.
- *
- * Returns zero if successful, or a negative error code.
*/
-int snd_hdac_power_down_pm(struct hdac_device *codec)
+void snd_hdac_power_down_pm(struct hdac_device *codec)
{
if (atomic_dec_if_positive(&codec->in_pm) < 0)
- return snd_hdac_power_down(codec);
- return 0;
+ snd_hdac_power_down(codec);
}
EXPORT_SYMBOL_GPL(snd_hdac_power_down_pm);
#endif
--
2.56.0.360.g66cac248cb-goog
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 09/13] ASoC: codecs: lpass: Discard pm_runtime_put_autosuspend() return values
2026-10-06 23:13 [PATCH 00/13] PM: runtime: Convert pm_runtime_put_autosuspend() and friends to a void function Brian Norris
2026-10-06 23:13 ` [PATCH 08/13] ALSA: hda: Discard pm_runtime_put_autosuspend() return value Brian Norris
@ 2026-10-06 23:13 ` Brian Norris
2026-10-06 23:13 ` [PATCH 10/13] ASoC: intel: atom: Discard pm_runtime_put_autosuspend() return value Brian Norris
2026-10-06 23:13 ` [PATCH 11/13] ASoC: SOF: Discard pm_runtime_put_autosuspend() return values Brian Norris
3 siblings, 0 replies; 6+ messages in thread
From: Brian Norris @ 2026-10-06 23:13 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: linux-pm, Ulf Hansson, linux-kernel, Brian Norris,
Jaroslav Kysela, Liam Girdwood, Mark Brown, Srinivas Kandagatla,
Takashi Iwai, linux-arm-msm, linux-sound
Printing warning messages on pm_runtime_put_autosuspend() returning
negative values is not particularly useful.
Returning an error code from pm_runtime_put_autosuspend() merely means
that it has not queued up a timer or 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
device's runtime PM "control" attribute in sysfs for one example.
Accordingly, update the LPASS macro codec drivers to simply discard the
return value of pm_runtime_put_autosuspend().
This will facilitate a planned change of the
pm_runtime_put_autosuspend() return type to void in the future, similar
to commit 3afd8df02433 ("PM: runtime: Change pm_runtime_put() return
type to void").
Signed-off-by: Brian Norris <briannorris@chromium.org>
---
This patch is independent of the rest of the series, except for the end
(changing the return type). I expect it can be applied by individual
maintainers, and we pick up the end once the dust is settled.
sound/soc/codecs/lpass-rx-macro.c | 4 +---
sound/soc/codecs/lpass-tx-macro.c | 4 +---
sound/soc/codecs/lpass-va-macro.c | 17 ++++-------------
sound/soc/codecs/lpass-wsa-macro.c | 8 ++------
4 files changed, 8 insertions(+), 25 deletions(-)
diff --git a/sound/soc/codecs/lpass-rx-macro.c b/sound/soc/codecs/lpass-rx-macro.c
index 282a6aaa9986..e6c27893584c 100644
--- a/sound/soc/codecs/lpass-rx-macro.c
+++ b/sound/soc/codecs/lpass-rx-macro.c
@@ -3917,9 +3917,7 @@ static int rx_macro_probe(struct platform_device *pdev)
if (ret)
goto err_rpm_put;
- ret = pm_runtime_put_autosuspend(dev);
- if (ret < 0)
- dev_warn(dev, "runtime PM put failed after probe: %d\n", ret);
+ pm_runtime_put_autosuspend(dev);
return 0;
diff --git a/sound/soc/codecs/lpass-tx-macro.c b/sound/soc/codecs/lpass-tx-macro.c
index a8e83eb60ba2..149373384a15 100644
--- a/sound/soc/codecs/lpass-tx-macro.c
+++ b/sound/soc/codecs/lpass-tx-macro.c
@@ -2370,9 +2370,7 @@ static int tx_macro_probe(struct platform_device *pdev)
if (ret)
goto err_rpm_put;
- ret = pm_runtime_put_autosuspend(dev);
- if (ret < 0)
- dev_warn(dev, "runtime PM put failed after probe: %d\n", ret);
+ pm_runtime_put_autosuspend(dev);
return 0;
diff --git a/sound/soc/codecs/lpass-va-macro.c b/sound/soc/codecs/lpass-va-macro.c
index dbc5795b9273..48139119b335 100644
--- a/sound/soc/codecs/lpass-va-macro.c
+++ b/sound/soc/codecs/lpass-va-macro.c
@@ -1352,7 +1352,7 @@ static int fsgen_gate_enable(struct clk_hw *hw)
{
struct va_macro *va = to_va_macro(hw);
struct regmap *regmap = va->regmap;
- int ret, rpm_ret;
+ int ret;
ret = pm_runtime_resume_and_get(va->dev);
if (ret < 0)
@@ -1360,11 +1360,7 @@ static int fsgen_gate_enable(struct clk_hw *hw)
ret = va_macro_mclk_enable(va, true);
if (ret) {
- rpm_ret = pm_runtime_put_autosuspend(va->dev);
- if (rpm_ret < 0)
- dev_warn(va->dev,
- "runtime PM put failed in fsgen enable unwind: %d\n",
- rpm_ret);
+ pm_runtime_put_autosuspend(va->dev);
return ret;
}
if (va->has_swr_master)
@@ -1378,7 +1374,6 @@ static void fsgen_gate_disable(struct clk_hw *hw)
{
struct va_macro *va = to_va_macro(hw);
struct regmap *regmap = va->regmap;
- int ret;
if (va->has_swr_master)
regmap_update_bits(regmap, CDC_VA_CLK_RST_CTRL_SWR_CONTROL,
@@ -1386,9 +1381,7 @@ static void fsgen_gate_disable(struct clk_hw *hw)
va_macro_mclk_enable(va, false);
- ret = pm_runtime_put_autosuspend(va->dev);
- if (ret < 0)
- dev_warn(va->dev, "runtime PM put failed in fsgen disable: %d\n", ret);
+ pm_runtime_put_autosuspend(va->dev);
}
static int fsgen_gate_is_enabled(struct clk_hw *hw)
@@ -1693,9 +1686,7 @@ static int va_macro_probe(struct platform_device *pdev)
goto err_rpm_put;
}
- rpm_ret = pm_runtime_put_autosuspend(dev);
- if (rpm_ret < 0)
- dev_warn(dev, "runtime PM put failed after probe: %d\n", rpm_ret);
+ pm_runtime_put_autosuspend(dev);
return 0;
diff --git a/sound/soc/codecs/lpass-wsa-macro.c b/sound/soc/codecs/lpass-wsa-macro.c
index cfd2ac0a6cda..60d285a2040f 100644
--- a/sound/soc/codecs/lpass-wsa-macro.c
+++ b/sound/soc/codecs/lpass-wsa-macro.c
@@ -2548,9 +2548,7 @@ static int wsa_swrm_clock(struct wsa_macro *wsa, bool enable)
CDC_WSA_SWR_CLK_EN_MASK, 0);
wsa_macro_mclk_enable(wsa, false);
- ret = pm_runtime_put_autosuspend(wsa->dev);
- if (ret < 0)
- dev_warn(wsa->dev, "runtime PM put failed: %d\n", ret);
+ pm_runtime_put_autosuspend(wsa->dev);
}
return 0;
@@ -2820,9 +2818,7 @@ static int wsa_macro_probe(struct platform_device *pdev)
if (ret)
goto err_rpm_put;
- ret = pm_runtime_put_autosuspend(dev);
- if (ret < 0)
- dev_warn(dev, "runtime PM put failed after probe: %d\n", ret);
+ pm_runtime_put_autosuspend(dev);
return 0;
err_rpm_put:
--
2.56.0.360.g66cac248cb-goog
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 10/13] ASoC: intel: atom: Discard pm_runtime_put_autosuspend() return value
2026-10-06 23:13 [PATCH 00/13] PM: runtime: Convert pm_runtime_put_autosuspend() and friends to a void function Brian Norris
2026-10-06 23:13 ` [PATCH 08/13] ALSA: hda: Discard pm_runtime_put_autosuspend() return value Brian Norris
2026-10-06 23:13 ` [PATCH 09/13] ASoC: codecs: lpass: Discard pm_runtime_put_autosuspend() return values Brian Norris
@ 2026-10-06 23:13 ` Brian Norris
2026-10-06 23:13 ` [PATCH 11/13] ASoC: SOF: Discard pm_runtime_put_autosuspend() return values Brian Norris
3 siblings, 0 replies; 6+ messages in thread
From: Brian Norris @ 2026-10-06 23:13 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: linux-pm, Ulf Hansson, linux-kernel, Brian Norris, Bard Liao,
Cezary Rojewski, Jaroslav Kysela, Kai Vehmanen, Liam Girdwood,
Mark Brown, Peter Ujfalusi, Pierre-Louis Bossart, Takashi Iwai,
linux-sound
Propagating the pm_runtime_put_autosuspend() return value to callers is
not particularly useful.
Returning an error code from pm_runtime_put_autosuspend() merely means
that it has not queued up a timer or 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
device's runtime PM "control" attribute in sysfs for one example.
Modify sst_pm_runtime_put() to discard the pm_runtime_put_autosuspend()
return value, change its return type to void, and update its callers in
sst_power_control() accordingly.
Note that in one error path for sst_power_control(), we would previously
overwrite one error code (from "FW download fail") with the return code
from pm_runtime_put_autosuspend(). This was probably an unexpected
behavior, which is now changed to propagate the sst_load_fw() error
code.
This will facilitate a planned change of the
pm_runtime_put_autosuspend() return type to void in the future, similar
to commit 3afd8df02433 ("PM: runtime: Change pm_runtime_put() return
type to void").
Signed-off-by: Brian Norris <briannorris@chromium.org>
---
This patch is independent of the rest of the series, except for the end
(changing the return type). I expect it can be applied by individual
maintainers, and we pick up the end once the dust is settled.
sound/soc/intel/atom/sst/sst.h | 2 +-
sound/soc/intel/atom/sst/sst_drv_interface.c | 4 ++--
sound/soc/intel/atom/sst/sst_pvt.c | 9 ++-------
3 files changed, 5 insertions(+), 10 deletions(-)
diff --git a/sound/soc/intel/atom/sst/sst.h b/sound/soc/intel/atom/sst/sst.h
index c43946c5ecee..518b2b53510d 100644
--- a/sound/soc/intel/atom/sst/sst.h
+++ b/sound/soc/intel/atom/sst/sst.h
@@ -497,7 +497,7 @@ int get_stream_id_mrfld(struct intel_sst_drv *sst_drv_ctx,
u32 relocate_imr_addr_mrfld(u32 base_addr);
void sst_add_to_dispatch_list_and_post(struct intel_sst_drv *sst,
struct ipc_post *msg);
-int sst_pm_runtime_put(struct intel_sst_drv *sst_drv);
+void sst_pm_runtime_put(struct intel_sst_drv *sst_drv);
int sst_shim_write(void __iomem *addr, int offset, int value);
u32 sst_shim_read(void __iomem *addr, int offset);
u64 sst_reg_read64(void __iomem *addr, int offset);
diff --git a/sound/soc/intel/atom/sst/sst_drv_interface.c b/sound/soc/intel/atom/sst/sst_drv_interface.c
index 2646c4632ca1..c99697b975d8 100644
--- a/sound/soc/intel/atom/sst/sst_drv_interface.c
+++ b/sound/soc/intel/atom/sst/sst_drv_interface.c
@@ -135,13 +135,13 @@ static int sst_power_control(struct device *dev, bool state)
if (ret) {
dev_err(dev, "FW download fail %d\n", ret);
sst_set_fw_state_locked(ctx, SST_RESET);
- ret = sst_pm_runtime_put(ctx);
+ sst_pm_runtime_put(ctx);
}
}
} else {
usage_count = GET_USAGE_COUNT(dev);
dev_dbg(ctx->dev, "Disable: pm usage count: %d\n", usage_count);
- return sst_pm_runtime_put(ctx);
+ sst_pm_runtime_put(ctx);
}
return ret;
}
diff --git a/sound/soc/intel/atom/sst/sst_pvt.c b/sound/soc/intel/atom/sst/sst_pvt.c
index 0b0cfd70efbc..913e232bf6ed 100644
--- a/sound/soc/intel/atom/sst/sst_pvt.c
+++ b/sound/soc/intel/atom/sst/sst_pvt.c
@@ -255,14 +255,9 @@ int sst_prepare_and_post_msg(struct intel_sst_drv *sst,
return ret;
}
-int sst_pm_runtime_put(struct intel_sst_drv *sst_drv)
+void sst_pm_runtime_put(struct intel_sst_drv *sst_drv)
{
- int ret;
-
- ret = pm_runtime_put_autosuspend(sst_drv->dev);
- if (ret < 0)
- return ret;
- return 0;
+ pm_runtime_put_autosuspend(sst_drv->dev);
}
void sst_fill_header_mrfld(union ipc_header_mrfld *header,
--
2.56.0.360.g66cac248cb-goog
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 11/13] ASoC: SOF: Discard pm_runtime_put_autosuspend() return values
2026-10-06 23:13 [PATCH 00/13] PM: runtime: Convert pm_runtime_put_autosuspend() and friends to a void function Brian Norris
` (2 preceding siblings ...)
2026-10-06 23:13 ` [PATCH 10/13] ASoC: intel: atom: Discard pm_runtime_put_autosuspend() return value Brian Norris
@ 2026-10-06 23:13 ` Brian Norris
3 siblings, 0 replies; 6+ messages in thread
From: Brian Norris @ 2026-10-06 23:13 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: linux-pm, Ulf Hansson, linux-kernel, Brian Norris, Bard Liao,
Daniel Baluta, Jaroslav Kysela, Kai Vehmanen, Liam Girdwood,
Mark Brown, Peter Ujfalusi, Pierre-Louis Bossart, Takashi Iwai,
Vijendar Mukunda, linux-sound, sound-open-firmware
Printing error messages on pm_runtime_put_autosuspend() returning
negative values is not particularly useful.
Returning an error code from pm_runtime_put_autosuspend() merely means
that it has not queued up a timer or 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
device's runtime PM "control" attribute in sysfs for one example.
Accordingly, update the SOF driver to simply discard the return value of
pm_runtime_put_autosuspend().
This will facilitate a planned change of the
pm_runtime_put_autosuspend() return type to void in the future, similar
to commit 3afd8df02433 ("PM: runtime: Change pm_runtime_put() return
type to void").
Signed-off-by: Brian Norris <briannorris@chromium.org>
---
This patch is independent of the rest of the series, except for the end
(changing the return type). I expect it can be applied by individual
maintainers, and we pick up the end once the dust is settled.
sound/soc/sof/control.c | 6 ++----
sound/soc/sof/sof-client-ipc-flood-test.c | 5 +----
sound/soc/sof/sof-client-ipc-kernel-injector.c | 4 +---
sound/soc/sof/sof-client-ipc-msg-injector.c | 6 ++----
sound/soc/sof/sof-client-probes.c | 18 ++++++------------
5 files changed, 12 insertions(+), 27 deletions(-)
diff --git a/sound/soc/sof/control.c b/sound/soc/sof/control.c
index 74d997a4f620..8718c293c5b9 100644
--- a/sound/soc/sof/control.c
+++ b/sound/soc/sof/control.c
@@ -185,7 +185,7 @@ int snd_sof_bytes_ext_volatile_get(struct snd_kcontrol *kcontrol, unsigned int _
struct snd_soc_component *scomp = scontrol->scomp;
struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(scomp);
const struct sof_ipc_tplg_ops *tplg_ops = sof_ipc_get_ops(sdev, tplg);
- int ret, err;
+ int ret;
/* ignore the ext_volatile_get call if the callbacks are not provided */
if (!tplg_ops || !tplg_ops->control ||
@@ -205,9 +205,7 @@ int snd_sof_bytes_ext_volatile_get(struct snd_kcontrol *kcontrol, unsigned int _
binary_data,
size);
- err = pm_runtime_put_autosuspend(scomp->dev);
- if (err < 0)
- dev_err_ratelimited(scomp->dev, "%s: failed to idle %d\n", __func__, err);
+ pm_runtime_put_autosuspend(scomp->dev);
return ret;
}
diff --git a/sound/soc/sof/sof-client-ipc-flood-test.c b/sound/soc/sof/sof-client-ipc-flood-test.c
index 2396cc35489a..a86dd5630790 100644
--- a/sound/soc/sof/sof-client-ipc-flood-test.c
+++ b/sound/soc/sof/sof-client-ipc-flood-test.c
@@ -157,7 +157,6 @@ static ssize_t sof_ipc_flood_dfs_write(struct file *file, const char __user *buf
unsigned long ipc_duration_ms = 0;
bool flood_duration_test = false;
unsigned long ipc_count = 0;
- int err;
char *string;
int ret;
@@ -223,9 +222,7 @@ static ssize_t sof_ipc_flood_dfs_write(struct file *file, const char __user *buf
ret = sof_debug_ipc_flood_test(cdev, flood_duration_test,
ipc_duration_ms, ipc_count);
- err = pm_runtime_put_autosuspend(dev);
- if (err < 0)
- dev_err_ratelimited(dev, "debugfs write failed to idle %d\n", err);
+ pm_runtime_put_autosuspend(dev);
/* return count if test is successful */
if (ret >= 0)
diff --git a/sound/soc/sof/sof-client-ipc-kernel-injector.c b/sound/soc/sof/sof-client-ipc-kernel-injector.c
index 02d0d97ad1a0..751d6a0bef79 100644
--- a/sound/soc/sof/sof-client-ipc-kernel-injector.c
+++ b/sound/soc/sof/sof-client-ipc-kernel-injector.c
@@ -66,9 +66,7 @@ static ssize_t sof_kernel_msg_inject_dfs_write(struct file *file, const char __u
if (!ret)
sof_client_ipc_rx_message(cdev, hdr, priv->kernel_buffer);
- ret = pm_runtime_put_autosuspend(dev);
- if (ret < 0)
- dev_err_ratelimited(dev, "debugfs write failed to idle %d\n", ret);
+ pm_runtime_put_autosuspend(dev);
return count;
};
diff --git a/sound/soc/sof/sof-client-ipc-msg-injector.c b/sound/soc/sof/sof-client-ipc-msg-injector.c
index 932ab459c079..2eaec52ab439 100644
--- a/sound/soc/sof/sof-client-ipc-msg-injector.c
+++ b/sound/soc/sof/sof-client-ipc-msg-injector.c
@@ -122,7 +122,7 @@ static int sof_msg_inject_send_message(struct sof_client_dev *cdev)
{
struct sof_msg_inject_priv *priv = cdev->data;
struct device *dev = &cdev->auxdev.dev;
- int ret, err;
+ int ret;
ret = pm_runtime_resume_and_get(dev);
if (ret < 0 && ret != -EACCES) {
@@ -140,9 +140,7 @@ static int sof_msg_inject_send_message(struct sof_client_dev *cdev)
dev_err(dev, "IPC message send failed: %d\n", ret);
}
- err = pm_runtime_put_autosuspend(dev);
- if (err < 0)
- dev_err_ratelimited(dev, "debugfs write failed to idle %d\n", err);
+ pm_runtime_put_autosuspend(dev);
return ret;
}
diff --git a/sound/soc/sof/sof-client-probes.c b/sound/soc/sof/sof-client-probes.c
index 124f55508159..32e31d6aa9bb 100644
--- a/sound/soc/sof/sof-client-probes.c
+++ b/sound/soc/sof/sof-client-probes.c
@@ -211,7 +211,7 @@ static ssize_t sof_probes_dfs_points_read(struct file *file, char __user *to,
int remaining, offset;
size_t num_desc;
char *buf;
- int i, ret, err;
+ int i, ret;
if (priv->extractor_stream_tag == SOF_PROBES_INVALID_NODE_ID) {
dev_warn(dev, "no extractor stream running\n");
@@ -258,9 +258,7 @@ static ssize_t sof_probes_dfs_points_read(struct file *file, char __user *to,
kfree(desc);
pm_error:
- err = pm_runtime_put_autosuspend(dev);
- if (err < 0)
- dev_err_ratelimited(dev, "debugfs read failed to idle %d\n", err);
+ pm_runtime_put_autosuspend(dev);
exit:
kfree(buf);
@@ -294,7 +292,7 @@ sof_probes_dfs_points_write(struct file *file, const char __user *from,
struct sof_probe_point_desc *desc;
u32 num_elems, *array;
size_t bytes;
- int ret, err;
+ int ret;
if (priv->extractor_stream_tag == SOF_PROBES_INVALID_NODE_ID) {
dev_warn(dev, "no extractor stream running\n");
@@ -327,9 +325,7 @@ sof_probes_dfs_points_write(struct file *file, const char __user *from,
ret = count;
}
- err = pm_runtime_put_autosuspend(dev);
- if (err < 0)
- dev_err_ratelimited(dev, "debugfs write failed to idle %d\n", err);
+ pm_runtime_put_autosuspend(dev);
exit:
kfree(array);
return ret;
@@ -360,7 +356,7 @@ sof_probes_dfs_points_remove_write(struct file *file, const char __user *from,
struct sof_probes_priv *priv = cdev->data;
const struct sof_probes_ipc_ops *ipc = priv->ipc_ops;
struct device *dev = &cdev->auxdev.dev;
- int ret, err;
+ int ret;
u32 *array;
if (priv->extractor_stream_tag == SOF_PROBES_INVALID_NODE_ID) {
@@ -385,9 +381,7 @@ sof_probes_dfs_points_remove_write(struct file *file, const char __user *from,
ret = count;
}
- err = pm_runtime_put_autosuspend(dev);
- if (err < 0)
- dev_err_ratelimited(dev, "debugfs write failed to idle %d\n", err);
+ pm_runtime_put_autosuspend(dev);
exit:
kfree(array);
return ret;
--
2.56.0.360.g66cac248cb-goog
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 08/13] ALSA: hda: Discard pm_runtime_put_autosuspend() return value
2026-10-06 23:13 ` [PATCH 08/13] ALSA: hda: Discard pm_runtime_put_autosuspend() return value Brian Norris
@ 2026-10-07 9:45 ` Takashi Iwai
0 siblings, 0 replies; 6+ messages in thread
From: Takashi Iwai @ 2026-10-07 9:45 UTC (permalink / raw)
To: Brian Norris
Cc: Rafael J. Wysocki, linux-pm, Ulf Hansson, linux-kernel,
Jaroslav Kysela, Takashi Iwai, linux-sound
On Wed, 07 Oct 2026 01:13:36 +0200,
Brian Norris wrote:
>
> snd_hdac_power_down() and snd_hdac_power_down_pm() are defined to return
> an int, but their return values are never used by any caller.
> snd_hdac_power_down() also passes the return value of
> pm_runtime_put_autosuspend() to the caller, which is not very useful.
>
> Returning an error code from pm_runtime_put_autosuspend() merely means
> that it has not queued up a timer or 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
> device's runtime PM "control" attribute in sysfs for one example.
>
> Modify snd_hdac_power_down() to discard the pm_runtime_put_autosuspend()
> return value and change the return types of snd_hdac_power_down() and
> snd_hdac_power_down_pm() to void.
>
> No intentional functional impact.
>
> This will facilitate a planned change of the
> pm_runtime_put_autosuspend() return type to void in the future, similar
> to commit 3afd8df02433 ("PM: runtime: Change pm_runtime_put() return
> type to void").
>
> Signed-off-by: Brian Norris <briannorris@chromium.org>
> ---
> This patch is independent of the rest of the series, except for the end
> (changing the return type). I expect it can be applied by individual
> maintainers, and we pick up the end once the dust is settled.
OK, I applied this one to sound.git tree for-next branch now.
thanks,
Takashi
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-10-07 9:45 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-06 23:13 [PATCH 00/13] PM: runtime: Convert pm_runtime_put_autosuspend() and friends to a void function Brian Norris
2026-10-06 23:13 ` [PATCH 08/13] ALSA: hda: Discard pm_runtime_put_autosuspend() return value Brian Norris
2026-10-07 9:45 ` Takashi Iwai
2026-10-06 23:13 ` [PATCH 09/13] ASoC: codecs: lpass: Discard pm_runtime_put_autosuspend() return values Brian Norris
2026-10-06 23:13 ` [PATCH 10/13] ASoC: intel: atom: Discard pm_runtime_put_autosuspend() return value Brian Norris
2026-10-06 23:13 ` [PATCH 11/13] ASoC: SOF: Discard pm_runtime_put_autosuspend() return values Brian Norris
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox