* [PATCH] ASoC: Intel: sst: Fix runtime PM imbalance in sst_power_control
@ 2020-05-25 7:06 ` Dinghao Liu
0 siblings, 0 replies; 6+ messages in thread
From: Dinghao Liu @ 2020-05-25 7:06 UTC (permalink / raw)
To: dinghao.liu, kjlu
Cc: Cezary Rojewski, Pierre-Louis Bossart, Liam Girdwood, Jie Yang,
Mark Brown, Jaroslav Kysela, Takashi Iwai, Thomas Gleixner,
Allison Randal, Greg Kroah-Hartman, Alexios Zavras, alsa-devel,
linux-kernel
When sst_load_fw() returns an error code, a pairing runtime
PM usage counter decrement is needed to keep the counter
balanced.
Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
---
sound/soc/intel/atom/sst/sst_drv_interface.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/sound/soc/intel/atom/sst/sst_drv_interface.c b/sound/soc/intel/atom/sst/sst_drv_interface.c
index 762495385d5c..3897985b254f 100644
--- a/sound/soc/intel/atom/sst/sst_drv_interface.c
+++ b/sound/soc/intel/atom/sst/sst_drv_interface.c
@@ -150,6 +150,7 @@ static int sst_power_control(struct device *dev, bool state)
if ((ctx->sst_state == SST_RESET) && (usage_count == 1)) {
ret = sst_load_fw(ctx);
if (ret) {
+ pm_runtime_put_sync(dev);
dev_err(dev, "FW download fail %d\n", ret);
sst_set_fw_state_locked(ctx, SST_RESET);
ret = sst_pm_runtime_put(ctx);
--
2.17.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH] ASoC: Intel: sst: Fix runtime PM imbalance in sst_power_control
@ 2020-05-25 7:06 ` Dinghao Liu
0 siblings, 0 replies; 6+ messages in thread
From: Dinghao Liu @ 2020-05-25 7:06 UTC (permalink / raw)
To: dinghao.liu, kjlu
Cc: Cezary Rojewski, linux-kernel, alsa-devel, Greg Kroah-Hartman,
Takashi Iwai, Jie Yang, Pierre-Louis Bossart, Liam Girdwood,
Alexios Zavras, Mark Brown, Thomas Gleixner, Allison Randal
When sst_load_fw() returns an error code, a pairing runtime
PM usage counter decrement is needed to keep the counter
balanced.
Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
---
sound/soc/intel/atom/sst/sst_drv_interface.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/sound/soc/intel/atom/sst/sst_drv_interface.c b/sound/soc/intel/atom/sst/sst_drv_interface.c
index 762495385d5c..3897985b254f 100644
--- a/sound/soc/intel/atom/sst/sst_drv_interface.c
+++ b/sound/soc/intel/atom/sst/sst_drv_interface.c
@@ -150,6 +150,7 @@ static int sst_power_control(struct device *dev, bool state)
if ((ctx->sst_state == SST_RESET) && (usage_count == 1)) {
ret = sst_load_fw(ctx);
if (ret) {
+ pm_runtime_put_sync(dev);
dev_err(dev, "FW download fail %d\n", ret);
sst_set_fw_state_locked(ctx, SST_RESET);
ret = sst_pm_runtime_put(ctx);
--
2.17.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] ASoC: Intel: sst: Fix runtime PM imbalance in sst_power_control
2020-05-25 7:06 ` Dinghao Liu
@ 2020-05-26 13:25 ` Pierre-Louis Bossart
-1 siblings, 0 replies; 6+ messages in thread
From: Pierre-Louis Bossart @ 2020-05-26 13:25 UTC (permalink / raw)
To: Dinghao Liu, kjlu
Cc: Cezary Rojewski, Liam Girdwood, Jie Yang, Mark Brown,
Jaroslav Kysela, Takashi Iwai, Thomas Gleixner, Allison Randal,
Greg Kroah-Hartman, Alexios Zavras, alsa-devel, linux-kernel
On 5/25/20 2:06 AM, Dinghao Liu wrote:
> When sst_load_fw() returns an error code, a pairing runtime
> PM usage counter decrement is needed to keep the counter
> balanced.
>
> Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
> ---
> sound/soc/intel/atom/sst/sst_drv_interface.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/sound/soc/intel/atom/sst/sst_drv_interface.c b/sound/soc/intel/atom/sst/sst_drv_interface.c
> index 762495385d5c..3897985b254f 100644
> --- a/sound/soc/intel/atom/sst/sst_drv_interface.c
> +++ b/sound/soc/intel/atom/sst/sst_drv_interface.c
> @@ -150,6 +150,7 @@ static int sst_power_control(struct device *dev, bool state)
> if ((ctx->sst_state == SST_RESET) && (usage_count == 1)) {
> ret = sst_load_fw(ctx);
> if (ret) {
> + pm_runtime_put_sync(dev);
> dev_err(dev, "FW download fail %d\n", ret);
> sst_set_fw_state_locked(ctx, SST_RESET);
> ret = sst_pm_runtime_put(ctx);
this change doesn't seem quite right, if you look the code below there
is no PM imbalance, is there?
int sst_pm_runtime_put(struct intel_sst_drv *sst_drv)
{
int ret;
pm_runtime_mark_last_busy(sst_drv->dev);
ret = pm_runtime_put_autosuspend(sst_drv->dev);
if (ret < 0)
return ret;
return 0;
}
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] ASoC: Intel: sst: Fix runtime PM imbalance in sst_power_control
@ 2020-05-26 13:25 ` Pierre-Louis Bossart
0 siblings, 0 replies; 6+ messages in thread
From: Pierre-Louis Bossart @ 2020-05-26 13:25 UTC (permalink / raw)
To: Dinghao Liu, kjlu
Cc: Cezary Rojewski, linux-kernel, alsa-devel, Greg Kroah-Hartman,
Jie Yang, Takashi Iwai, Liam Girdwood, Alexios Zavras,
Mark Brown, Thomas Gleixner, Allison Randal
On 5/25/20 2:06 AM, Dinghao Liu wrote:
> When sst_load_fw() returns an error code, a pairing runtime
> PM usage counter decrement is needed to keep the counter
> balanced.
>
> Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
> ---
> sound/soc/intel/atom/sst/sst_drv_interface.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/sound/soc/intel/atom/sst/sst_drv_interface.c b/sound/soc/intel/atom/sst/sst_drv_interface.c
> index 762495385d5c..3897985b254f 100644
> --- a/sound/soc/intel/atom/sst/sst_drv_interface.c
> +++ b/sound/soc/intel/atom/sst/sst_drv_interface.c
> @@ -150,6 +150,7 @@ static int sst_power_control(struct device *dev, bool state)
> if ((ctx->sst_state == SST_RESET) && (usage_count == 1)) {
> ret = sst_load_fw(ctx);
> if (ret) {
> + pm_runtime_put_sync(dev);
> dev_err(dev, "FW download fail %d\n", ret);
> sst_set_fw_state_locked(ctx, SST_RESET);
> ret = sst_pm_runtime_put(ctx);
this change doesn't seem quite right, if you look the code below there
is no PM imbalance, is there?
int sst_pm_runtime_put(struct intel_sst_drv *sst_drv)
{
int ret;
pm_runtime_mark_last_busy(sst_drv->dev);
ret = pm_runtime_put_autosuspend(sst_drv->dev);
if (ret < 0)
return ret;
return 0;
}
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Re: [PATCH] ASoC: Intel: sst: Fix runtime PM imbalance in sst_power_control
2020-05-26 13:25 ` Pierre-Louis Bossart
@ 2020-05-27 1:07 ` dinghao.liu
-1 siblings, 0 replies; 6+ messages in thread
From: dinghao.liu @ 2020-05-27 1:07 UTC (permalink / raw)
To: Pierre-Louis Bossart
Cc: kjlu, Cezary Rojewski, Liam Girdwood, Jie Yang, Mark Brown,
Jaroslav Kysela, Takashi Iwai, Thomas Gleixner, Allison Randal,
Greg Kroah-Hartman, Alexios Zavras, alsa-devel, linux-kernel
>
> this change doesn't seem quite right, if you look the code below there
> is no PM imbalance, is there?
>
> int sst_pm_runtime_put(struct intel_sst_drv *sst_drv)
> {
> int ret;
>
> pm_runtime_mark_last_busy(sst_drv->dev);
> ret = pm_runtime_put_autosuspend(sst_drv->dev);
> if (ret < 0)
> return ret;
> return 0;
> }
You are right. Thank you for your correction!
Regards,
Dinghao
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Re: [PATCH] ASoC: Intel: sst: Fix runtime PM imbalance in sst_power_control
@ 2020-05-27 1:07 ` dinghao.liu
0 siblings, 0 replies; 6+ messages in thread
From: dinghao.liu @ 2020-05-27 1:07 UTC (permalink / raw)
To: Pierre-Louis Bossart
Cc: Cezary Rojewski, linux-kernel, alsa-devel, kjlu, Jie Yang,
Takashi Iwai, Liam Girdwood, Alexios Zavras, Mark Brown,
Greg Kroah-Hartman, Thomas Gleixner, Allison Randal
>
> this change doesn't seem quite right, if you look the code below there
> is no PM imbalance, is there?
>
> int sst_pm_runtime_put(struct intel_sst_drv *sst_drv)
> {
> int ret;
>
> pm_runtime_mark_last_busy(sst_drv->dev);
> ret = pm_runtime_put_autosuspend(sst_drv->dev);
> if (ret < 0)
> return ret;
> return 0;
> }
You are right. Thank you for your correction!
Regards,
Dinghao
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2020-05-27 1:08 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-25 7:06 [PATCH] ASoC: Intel: sst: Fix runtime PM imbalance in sst_power_control Dinghao Liu
2020-05-25 7:06 ` Dinghao Liu
2020-05-26 13:25 ` Pierre-Louis Bossart
2020-05-26 13:25 ` Pierre-Louis Bossart
2020-05-27 1:07 ` dinghao.liu
2020-05-27 1:07 ` dinghao.liu
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.