diff mbox series

ASoC: intel: atom: Remove superfluous flush_scheduled_work()

Message ID 20220322154826.19400-1-tiwai@suse.de
State Accepted
Commit 290186e14c3bbef07a6c68e689f26bf076259ee4
Headers show
Series ASoC: intel: atom: Remove superfluous flush_scheduled_work() | expand

Commit Message

Takashi Iwai March 22, 2022, 3:48 p.m. UTC
It seems that flush_scheduled_work() is called without any real
purpose at sst_context_cleanup() (the driver doesn't put works on the
global queue at all).  As the flush_schedule_work() function is going
to be abolished in near future, let's drop it now.

Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 sound/soc/intel/atom/sst/sst.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Pierre-Louis Bossart March 22, 2022, 3:57 p.m. UTC | #1
On 3/22/22 10:48, Takashi Iwai wrote:
> It seems that flush_scheduled_work() is called without any real
> purpose at sst_context_cleanup() (the driver doesn't put works on the
> global queue at all).  As the flush_schedule_work() function is going
> to be abolished in near future, let's drop it now.
> 
> Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
> Signed-off-by: Takashi Iwai <tiwai@suse.de>
> ---
>   sound/soc/intel/atom/sst/sst.c | 1 -
>   1 file changed, 1 deletion(-)
> 
> diff --git a/sound/soc/intel/atom/sst/sst.c b/sound/soc/intel/atom/sst/sst.c
> index e21e11dac000..3a42d68c0247 100644
> --- a/sound/soc/intel/atom/sst/sst.c
> +++ b/sound/soc/intel/atom/sst/sst.c
> @@ -360,7 +360,6 @@ void sst_context_cleanup(struct intel_sst_drv *ctx)
>   	sst_unregister(ctx->dev);
>   	sst_set_fw_state_locked(ctx, SST_SHUTDOWN);
>   	sysfs_remove_group(&ctx->dev->kobj, &sst_fw_version_attr_group);
> -	flush_scheduled_work(); >   	destroy_workqueue(ctx->post_msg_wq);

It could also be a confusion, there are calls to

flush_workqueue(ctx->post_msg_wq);

for suspend-resume, so wondering if the right sequence could be

flush_workqueue(ctx->post_msg_wq);
destroy_workqueue(ctx->post_msg_wq);

?

>   	cpu_latency_qos_remove_request(ctx->qos);
>   	kfree(ctx->fw_sg_list.src);
Cezary Rojewski March 22, 2022, 4:11 p.m. UTC | #2
On 2022-03-22 4:48 PM, Takashi Iwai wrote:
> It seems that flush_scheduled_work() is called without any real
> purpose at sst_context_cleanup() (the driver doesn't put works on the
> global queue at all).  As the flush_schedule_work() function is going
> to be abolished in near future, let's drop it now.
> 
> Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
> Signed-off-by: Takashi Iwai <tiwai@suse.de>


Thanks for the contribution, Takashi! LGTM so:

Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>

>   sound/soc/intel/atom/sst/sst.c | 1 -
>   1 file changed, 1 deletion(-)
> 
> diff --git a/sound/soc/intel/atom/sst/sst.c b/sound/soc/intel/atom/sst/sst.c
> index e21e11dac000..3a42d68c0247 100644
> --- a/sound/soc/intel/atom/sst/sst.c
> +++ b/sound/soc/intel/atom/sst/sst.c
> @@ -360,7 +360,6 @@ void sst_context_cleanup(struct intel_sst_drv *ctx)
>   	sst_unregister(ctx->dev);
>   	sst_set_fw_state_locked(ctx, SST_SHUTDOWN);
>   	sysfs_remove_group(&ctx->dev->kobj, &sst_fw_version_attr_group);
> -	flush_scheduled_work();
>   	destroy_workqueue(ctx->post_msg_wq);
>   	cpu_latency_qos_remove_request(ctx->qos);
>   	kfree(ctx->fw_sg_list.src);
diff mbox series

Patch

diff --git a/sound/soc/intel/atom/sst/sst.c b/sound/soc/intel/atom/sst/sst.c
index e21e11dac000..3a42d68c0247 100644
--- a/sound/soc/intel/atom/sst/sst.c
+++ b/sound/soc/intel/atom/sst/sst.c
@@ -360,7 +360,6 @@  void sst_context_cleanup(struct intel_sst_drv *ctx)
 	sst_unregister(ctx->dev);
 	sst_set_fw_state_locked(ctx, SST_SHUTDOWN);
 	sysfs_remove_group(&ctx->dev->kobj, &sst_fw_version_attr_group);
-	flush_scheduled_work();
 	destroy_workqueue(ctx->post_msg_wq);
 	cpu_latency_qos_remove_request(ctx->qos);
 	kfree(ctx->fw_sg_list.src);