Skip to contentSkip to conversation

ASoC: intel: atom: Remove superfluous flush_scheduled_work()

PATCH In review Takashi Iwai 4 participants 5 messages Mar 22, 2022 – Apr 5, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ASoC: intel: atom: Remove superfluous flush_scheduled_work()

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.

---
 sound/soc/intel/atom/sst/sst.c | 1 -
 1 file changed, 1 deletion(-)
sound/soc/intel/atom/sst/sst.c +0 -1
index e21e11dac000..3a42d68c0247 100644
@@ -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);
Signature · 1 line
2.31.1
#1 lore raw
Quoted 16 lines · Takashi Iwai

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.

---
  sound/soc/intel/atom/sst/sst.c | 1 -
  1 file changed, 1 deletion(-)
sound/soc/intel/atom/sst/sst.c +0 -0
index e21e11dac000..3a42d68c0247 100644

sound/soc/intel/atom/sst/sst.c void sst_context_cleanup(struct intel_sst_drv *ctx) · line 363

Quoted 4 lines
sound/soc/intel/atom/sst/sst.c +0 -1
@@ -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);

?

Quoted 2 lines
sound/soc/intel/atom/sst/sst.c +0 -0
  	cpu_latency_qos_remove_request(ctx->qos);
  	kfree(ctx->fw_sg_list.src);
#2 lore raw
Quoted 26 lines · Pierre-Louis Bossart
Quoted 16 lines · Takashi Iwai

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.

---
  sound/soc/intel/atom/sst/sst.c | 1 -

  1 file changed, 1 deletion(-)
sound/soc/intel/atom/sst/sst.c +0 -0
index e21e11dac000..3a42d68c0247 100644

sound/soc/intel/atom/sst/sst.c void sst_context_cleanup(struct intel_sst_drv *ctx) · line 363

Quoted 4 lines
sound/soc/intel/atom/sst/sst.c +0 -1
@@ -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

Quoted 8 lines

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);

?

Never mind, answering to my own question, destroy_workqueue() calls drain_workqueue() which calls flush_workqueue() internally

Quoted 3 lines
Quoted 3 lines
sound/soc/intel/atom/sst/sst.c +0 -0
       cpu_latency_qos_remove_request(ctx->qos);
       kfree(ctx->fw_sg_list.src);
maintainer Reviewed-by on v1 1/1
#3 lore raw
In reply to Takashi Iwai
Quoted 7 lines · Takashi Iwai

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.

Thanks for the contribution, Takashi! LGTM so:

Quoted 15 lines
  sound/soc/intel/atom/sst/sst.c | 1 -
  1 file changed, 1 deletion(-)
sound/soc/intel/atom/sst/sst.c +0 -1
index e21e11dac000..3a42d68c0247 100644
@@ -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);
maintainer
#4 lore raw
In reply to Takashi Iwai
Quoted 6 lines · Takashi Iwai

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.

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: intel: atom: Remove superfluous flush_scheduled_work()

      commit: 290186e14c3bbef07a6c68e689f26bf076259ee4

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark