* [PATCH 0/5] soundwire: use pm_runtime_resume_and_get()
@ 2022-04-26 23:56 Bard Liao
2022-04-26 23:56 ` [PATCH 1/5] soundwire: qcom: return error when pm_runtime_get_sync fails Bard Liao
` (5 more replies)
0 siblings, 6 replies; 9+ messages in thread
From: Bard Liao @ 2022-04-26 23:56 UTC (permalink / raw)
To: alsa-devel, vkoul
Cc: vinod.koul, linux-kernel, gregkh, srinivas.kandagatla,
pierre-louis.bossart, sanyog.r.kale, bard.liao
Use pm_runtime_resume_and_get() to replace the pm_runtime_get_sync() and
pm_runtime_put_noidle() pattern.
Pierre-Louis Bossart (5):
soundwire: qcom: return error when pm_runtime_get_sync fails
soundwire: bus: use pm_runtime_resume_and_get()
soundwire: cadence: use pm_runtime_resume_and_get()
soundwire: intel: use pm_runtime_resume_and_get()
soundwire: qcom: use pm_runtime_resume_and_get()
drivers/soundwire/bus.c | 15 +++++----------
drivers/soundwire/cadence_master.c | 5 ++---
drivers/soundwire/intel.c | 5 ++---
drivers/soundwire/qcom.c | 17 ++++++++---------
4 files changed, 17 insertions(+), 25 deletions(-)
--
2.25.1
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 1/5] soundwire: qcom: return error when pm_runtime_get_sync fails
2022-04-26 23:56 [PATCH 0/5] soundwire: use pm_runtime_resume_and_get() Bard Liao
@ 2022-04-26 23:56 ` Bard Liao
2022-04-29 15:59 ` Srinivas Kandagatla
2022-04-26 23:56 ` [PATCH 2/5] soundwire: bus: use pm_runtime_resume_and_get() Bard Liao
` (4 subsequent siblings)
5 siblings, 1 reply; 9+ messages in thread
From: Bard Liao @ 2022-04-26 23:56 UTC (permalink / raw)
To: alsa-devel, vkoul
Cc: vinod.koul, linux-kernel, gregkh, srinivas.kandagatla,
pierre-louis.bossart, sanyog.r.kale, bard.liao
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
For some reason there's a missing error return in two places.
Fixes: 74e79da9fd46a ("soundwire: qcom: add runtime pm support")
Fixes: 04d46a7b38375 ("soundwire: qcom: add in-band wake up interrupt support")
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
---
drivers/soundwire/qcom.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/soundwire/qcom.c b/drivers/soundwire/qcom.c
index f5fc8c27012a..c40c25f2d264 100644
--- a/drivers/soundwire/qcom.c
+++ b/drivers/soundwire/qcom.c
@@ -516,6 +516,7 @@ static irqreturn_t qcom_swrm_wake_irq_handler(int irq, void *dev_id)
"pm_runtime_get_sync failed in %s, ret %d\n",
__func__, ret);
pm_runtime_put_noidle(swrm->dev);
+ return ret;
}
if (swrm->wake_irq > 0) {
@@ -1258,6 +1259,7 @@ static int swrm_reg_show(struct seq_file *s_file, void *data)
"pm_runtime_get_sync failed in %s, ret %d\n",
__func__, ret);
pm_runtime_put_noidle(swrm->dev);
+ return ret;
}
for (reg = 0; reg <= SWR_MSTR_MAX_REG_ADDR; reg += 4) {
--
2.25.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 2/5] soundwire: bus: use pm_runtime_resume_and_get()
2022-04-26 23:56 [PATCH 0/5] soundwire: use pm_runtime_resume_and_get() Bard Liao
2022-04-26 23:56 ` [PATCH 1/5] soundwire: qcom: return error when pm_runtime_get_sync fails Bard Liao
@ 2022-04-26 23:56 ` Bard Liao
2022-04-26 23:56 ` [PATCH 3/5] soundwire: cadence: " Bard Liao
` (3 subsequent siblings)
5 siblings, 0 replies; 9+ messages in thread
From: Bard Liao @ 2022-04-26 23:56 UTC (permalink / raw)
To: alsa-devel, vkoul
Cc: vinod.koul, linux-kernel, gregkh, srinivas.kandagatla,
pierre-louis.bossart, sanyog.r.kale, bard.liao
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Use pm_runtime_resume_and_get() to replace the pm_runtime_get_sync() and
pm_runtime_put_noidle() pattern.
No functional changes.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
---
drivers/soundwire/bus.c | 15 +++++----------
1 file changed, 5 insertions(+), 10 deletions(-)
diff --git a/drivers/soundwire/bus.c b/drivers/soundwire/bus.c
index 354d3f89366f..193bf87866f6 100644
--- a/drivers/soundwire/bus.c
+++ b/drivers/soundwire/bus.c
@@ -536,11 +536,9 @@ int sdw_nread(struct sdw_slave *slave, u32 addr, size_t count, u8 *val)
{
int ret;
- ret = pm_runtime_get_sync(&slave->dev);
- if (ret < 0 && ret != -EACCES) {
- pm_runtime_put_noidle(&slave->dev);
+ ret = pm_runtime_resume_and_get(&slave->dev);
+ if (ret < 0 && ret != -EACCES)
return ret;
- }
ret = sdw_nread_no_pm(slave, addr, count, val);
@@ -562,11 +560,9 @@ int sdw_nwrite(struct sdw_slave *slave, u32 addr, size_t count, const u8 *val)
{
int ret;
- ret = pm_runtime_get_sync(&slave->dev);
- if (ret < 0 && ret != -EACCES) {
- pm_runtime_put_noidle(&slave->dev);
+ ret = pm_runtime_resume_and_get(&slave->dev);
+ if (ret < 0 && ret != -EACCES)
return ret;
- }
ret = sdw_nwrite_no_pm(slave, addr, count, val);
@@ -1506,10 +1502,9 @@ static int sdw_handle_slave_alerts(struct sdw_slave *slave)
sdw_modify_slave_status(slave, SDW_SLAVE_ALERT);
- ret = pm_runtime_get_sync(&slave->dev);
+ ret = pm_runtime_resume_and_get(&slave->dev);
if (ret < 0 && ret != -EACCES) {
dev_err(&slave->dev, "Failed to resume device: %d\n", ret);
- pm_runtime_put_noidle(&slave->dev);
return ret;
}
--
2.25.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 3/5] soundwire: cadence: use pm_runtime_resume_and_get()
2022-04-26 23:56 [PATCH 0/5] soundwire: use pm_runtime_resume_and_get() Bard Liao
2022-04-26 23:56 ` [PATCH 1/5] soundwire: qcom: return error when pm_runtime_get_sync fails Bard Liao
2022-04-26 23:56 ` [PATCH 2/5] soundwire: bus: use pm_runtime_resume_and_get() Bard Liao
@ 2022-04-26 23:56 ` Bard Liao
2022-04-26 23:56 ` [PATCH 4/5] soundwire: intel: " Bard Liao
` (2 subsequent siblings)
5 siblings, 0 replies; 9+ messages in thread
From: Bard Liao @ 2022-04-26 23:56 UTC (permalink / raw)
To: alsa-devel, vkoul
Cc: vinod.koul, linux-kernel, gregkh, srinivas.kandagatla,
pierre-louis.bossart, sanyog.r.kale, bard.liao
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Use pm_runtime_resume_and_get() to replace the pm_runtime_get_sync() and
pm_runtime_put_noidle() pattern.
No functional changes.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
---
drivers/soundwire/cadence_master.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/soundwire/cadence_master.c b/drivers/soundwire/cadence_master.c
index 558390af44b6..a53a777f2241 100644
--- a/drivers/soundwire/cadence_master.c
+++ b/drivers/soundwire/cadence_master.c
@@ -386,12 +386,11 @@ static int cdns_parity_error_injection(void *data, u64 value)
* Resume Master device. If this results in a bus reset, the
* Slave devices will re-attach and be re-enumerated.
*/
- ret = pm_runtime_get_sync(bus->dev);
+ ret = pm_runtime_resume_and_get(bus->dev);
if (ret < 0 && ret != -EACCES) {
dev_err_ratelimited(cdns->dev,
- "pm_runtime_get_sync failed in %s, ret %d\n",
+ "pm_runtime_resume_and_get failed in %s, ret %d\n",
__func__, ret);
- pm_runtime_put_noidle(bus->dev);
return ret;
}
--
2.25.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 4/5] soundwire: intel: use pm_runtime_resume_and_get()
2022-04-26 23:56 [PATCH 0/5] soundwire: use pm_runtime_resume_and_get() Bard Liao
` (2 preceding siblings ...)
2022-04-26 23:56 ` [PATCH 3/5] soundwire: cadence: " Bard Liao
@ 2022-04-26 23:56 ` Bard Liao
2022-04-26 23:56 ` [PATCH 5/5] soundwire: qcom: " Bard Liao
2022-05-09 6:32 ` [PATCH 0/5] soundwire: " Vinod Koul
5 siblings, 0 replies; 9+ messages in thread
From: Bard Liao @ 2022-04-26 23:56 UTC (permalink / raw)
To: alsa-devel, vkoul
Cc: vinod.koul, linux-kernel, gregkh, srinivas.kandagatla,
pierre-louis.bossart, sanyog.r.kale, bard.liao
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Use pm_runtime_resume_and_get() to replace the pm_runtime_get_sync() and
pm_runtime_put_noidle() pattern.
No functional changes.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
---
drivers/soundwire/intel.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/soundwire/intel.c b/drivers/soundwire/intel.c
index 63101f1ba271..ad41b50f2ef1 100644
--- a/drivers/soundwire/intel.c
+++ b/drivers/soundwire/intel.c
@@ -799,12 +799,11 @@ static int intel_startup(struct snd_pcm_substream *substream,
struct sdw_cdns *cdns = snd_soc_dai_get_drvdata(dai);
int ret;
- ret = pm_runtime_get_sync(cdns->dev);
+ ret = pm_runtime_resume_and_get(cdns->dev);
if (ret < 0 && ret != -EACCES) {
dev_err_ratelimited(cdns->dev,
- "pm_runtime_get_sync failed in %s, ret %d\n",
+ "pm_runtime_resume_and_get failed in %s, ret %d\n",
__func__, ret);
- pm_runtime_put_noidle(cdns->dev);
return ret;
}
return 0;
--
2.25.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 5/5] soundwire: qcom: use pm_runtime_resume_and_get()
2022-04-26 23:56 [PATCH 0/5] soundwire: use pm_runtime_resume_and_get() Bard Liao
` (3 preceding siblings ...)
2022-04-26 23:56 ` [PATCH 4/5] soundwire: intel: " Bard Liao
@ 2022-04-26 23:56 ` Bard Liao
2022-04-29 15:59 ` Srinivas Kandagatla
2022-05-09 6:32 ` [PATCH 0/5] soundwire: " Vinod Koul
5 siblings, 1 reply; 9+ messages in thread
From: Bard Liao @ 2022-04-26 23:56 UTC (permalink / raw)
To: alsa-devel, vkoul
Cc: vinod.koul, linux-kernel, gregkh, srinivas.kandagatla,
pierre-louis.bossart, sanyog.r.kale, bard.liao
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Use pm_runtime_resume_and_get() to replace the pm_runtime_get_sync() and
pm_runtime_put_noidle() pattern.
No functional changes.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
---
drivers/soundwire/qcom.c | 15 ++++++---------
1 file changed, 6 insertions(+), 9 deletions(-)
diff --git a/drivers/soundwire/qcom.c b/drivers/soundwire/qcom.c
index c40c25f2d264..c244d31805cc 100644
--- a/drivers/soundwire/qcom.c
+++ b/drivers/soundwire/qcom.c
@@ -510,12 +510,11 @@ static irqreturn_t qcom_swrm_wake_irq_handler(int irq, void *dev_id)
struct qcom_swrm_ctrl *swrm = dev_id;
int ret;
- ret = pm_runtime_get_sync(swrm->dev);
+ ret = pm_runtime_resume_and_get(swrm->dev);
if (ret < 0 && ret != -EACCES) {
dev_err_ratelimited(swrm->dev,
- "pm_runtime_get_sync failed in %s, ret %d\n",
+ "pm_runtime_resume_and_get failed in %s, ret %d\n",
__func__, ret);
- pm_runtime_put_noidle(swrm->dev);
return ret;
}
@@ -1059,12 +1058,11 @@ static int qcom_swrm_startup(struct snd_pcm_substream *substream,
struct snd_soc_dai *codec_dai;
int ret, i;
- ret = pm_runtime_get_sync(ctrl->dev);
+ ret = pm_runtime_resume_and_get(ctrl->dev);
if (ret < 0 && ret != -EACCES) {
dev_err_ratelimited(ctrl->dev,
- "pm_runtime_get_sync failed in %s, ret %d\n",
+ "pm_runtime_resume_and_get failed in %s, ret %d\n",
__func__, ret);
- pm_runtime_put_noidle(ctrl->dev);
return ret;
}
@@ -1253,12 +1251,11 @@ static int swrm_reg_show(struct seq_file *s_file, void *data)
struct qcom_swrm_ctrl *swrm = s_file->private;
int reg, reg_val, ret;
- ret = pm_runtime_get_sync(swrm->dev);
+ ret = pm_runtime_resume_and_get(swrm->dev);
if (ret < 0 && ret != -EACCES) {
dev_err_ratelimited(swrm->dev,
- "pm_runtime_get_sync failed in %s, ret %d\n",
+ "pm_runtime_resume_and_get failed in %s, ret %d\n",
__func__, ret);
- pm_runtime_put_noidle(swrm->dev);
return ret;
}
--
2.25.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 1/5] soundwire: qcom: return error when pm_runtime_get_sync fails
2022-04-26 23:56 ` [PATCH 1/5] soundwire: qcom: return error when pm_runtime_get_sync fails Bard Liao
@ 2022-04-29 15:59 ` Srinivas Kandagatla
0 siblings, 0 replies; 9+ messages in thread
From: Srinivas Kandagatla @ 2022-04-29 15:59 UTC (permalink / raw)
To: Bard Liao, alsa-devel, vkoul
Cc: vinod.koul, linux-kernel, gregkh, pierre-louis.bossart,
sanyog.r.kale, bard.liao
On 27/04/2022 00:56, Bard Liao wrote:
> From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
>
> For some reason there's a missing error return in two places.
>
> Fixes: 74e79da9fd46a ("soundwire: qcom: add runtime pm support")
> Fixes: 04d46a7b38375 ("soundwire: qcom: add in-band wake up interrupt support")
> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
> Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
> ---
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> drivers/soundwire/qcom.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/soundwire/qcom.c b/drivers/soundwire/qcom.c
> index f5fc8c27012a..c40c25f2d264 100644
> --- a/drivers/soundwire/qcom.c
> +++ b/drivers/soundwire/qcom.c
> @@ -516,6 +516,7 @@ static irqreturn_t qcom_swrm_wake_irq_handler(int irq, void *dev_id)
> "pm_runtime_get_sync failed in %s, ret %d\n",
> __func__, ret);
> pm_runtime_put_noidle(swrm->dev);
> + return ret;
> }
>
> if (swrm->wake_irq > 0) {
> @@ -1258,6 +1259,7 @@ static int swrm_reg_show(struct seq_file *s_file, void *data)
> "pm_runtime_get_sync failed in %s, ret %d\n",
> __func__, ret);
> pm_runtime_put_noidle(swrm->dev);
> + return ret;
> }
>
> for (reg = 0; reg <= SWR_MSTR_MAX_REG_ADDR; reg += 4) {
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 5/5] soundwire: qcom: use pm_runtime_resume_and_get()
2022-04-26 23:56 ` [PATCH 5/5] soundwire: qcom: " Bard Liao
@ 2022-04-29 15:59 ` Srinivas Kandagatla
0 siblings, 0 replies; 9+ messages in thread
From: Srinivas Kandagatla @ 2022-04-29 15:59 UTC (permalink / raw)
To: Bard Liao, alsa-devel, vkoul
Cc: vinod.koul, linux-kernel, gregkh, pierre-louis.bossart,
sanyog.r.kale, bard.liao
On 27/04/2022 00:56, Bard Liao wrote:
> From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
>
> Use pm_runtime_resume_and_get() to replace the pm_runtime_get_sync() and
> pm_runtime_put_noidle() pattern.
>
> No functional changes.
>
> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
> Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
> ---
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> drivers/soundwire/qcom.c | 15 ++++++---------
> 1 file changed, 6 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/soundwire/qcom.c b/drivers/soundwire/qcom.c
> index c40c25f2d264..c244d31805cc 100644
> --- a/drivers/soundwire/qcom.c
> +++ b/drivers/soundwire/qcom.c
> @@ -510,12 +510,11 @@ static irqreturn_t qcom_swrm_wake_irq_handler(int irq, void *dev_id)
> struct qcom_swrm_ctrl *swrm = dev_id;
> int ret;
>
> - ret = pm_runtime_get_sync(swrm->dev);
> + ret = pm_runtime_resume_and_get(swrm->dev);
> if (ret < 0 && ret != -EACCES) {
> dev_err_ratelimited(swrm->dev,
> - "pm_runtime_get_sync failed in %s, ret %d\n",
> + "pm_runtime_resume_and_get failed in %s, ret %d\n",
> __func__, ret);
> - pm_runtime_put_noidle(swrm->dev);
> return ret;
> }
>
> @@ -1059,12 +1058,11 @@ static int qcom_swrm_startup(struct snd_pcm_substream *substream,
> struct snd_soc_dai *codec_dai;
> int ret, i;
>
> - ret = pm_runtime_get_sync(ctrl->dev);
> + ret = pm_runtime_resume_and_get(ctrl->dev);
> if (ret < 0 && ret != -EACCES) {
> dev_err_ratelimited(ctrl->dev,
> - "pm_runtime_get_sync failed in %s, ret %d\n",
> + "pm_runtime_resume_and_get failed in %s, ret %d\n",
> __func__, ret);
> - pm_runtime_put_noidle(ctrl->dev);
> return ret;
> }
>
> @@ -1253,12 +1251,11 @@ static int swrm_reg_show(struct seq_file *s_file, void *data)
> struct qcom_swrm_ctrl *swrm = s_file->private;
> int reg, reg_val, ret;
>
> - ret = pm_runtime_get_sync(swrm->dev);
> + ret = pm_runtime_resume_and_get(swrm->dev);
> if (ret < 0 && ret != -EACCES) {
> dev_err_ratelimited(swrm->dev,
> - "pm_runtime_get_sync failed in %s, ret %d\n",
> + "pm_runtime_resume_and_get failed in %s, ret %d\n",
> __func__, ret);
> - pm_runtime_put_noidle(swrm->dev);
> return ret;
> }
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 0/5] soundwire: use pm_runtime_resume_and_get()
2022-04-26 23:56 [PATCH 0/5] soundwire: use pm_runtime_resume_and_get() Bard Liao
` (4 preceding siblings ...)
2022-04-26 23:56 ` [PATCH 5/5] soundwire: qcom: " Bard Liao
@ 2022-05-09 6:32 ` Vinod Koul
5 siblings, 0 replies; 9+ messages in thread
From: Vinod Koul @ 2022-05-09 6:32 UTC (permalink / raw)
To: Bard Liao
Cc: alsa-devel, linux-kernel, gregkh, srinivas.kandagatla,
pierre-louis.bossart, sanyog.r.kale, bard.liao
On 27-04-22, 07:56, Bard Liao wrote:
> Use pm_runtime_resume_and_get() to replace the pm_runtime_get_sync() and
> pm_runtime_put_noidle() pattern.
Applied, thanks
--
~Vinod
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2022-05-09 6:37 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-26 23:56 [PATCH 0/5] soundwire: use pm_runtime_resume_and_get() Bard Liao
2022-04-26 23:56 ` [PATCH 1/5] soundwire: qcom: return error when pm_runtime_get_sync fails Bard Liao
2022-04-29 15:59 ` Srinivas Kandagatla
2022-04-26 23:56 ` [PATCH 2/5] soundwire: bus: use pm_runtime_resume_and_get() Bard Liao
2022-04-26 23:56 ` [PATCH 3/5] soundwire: cadence: " Bard Liao
2022-04-26 23:56 ` [PATCH 4/5] soundwire: intel: " Bard Liao
2022-04-26 23:56 ` [PATCH 5/5] soundwire: qcom: " Bard Liao
2022-04-29 15:59 ` Srinivas Kandagatla
2022-05-09 6:32 ` [PATCH 0/5] soundwire: " Vinod Koul
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).