Linux SPI subsystem development
 help / color / mirror / Atom feed
* [PATCH] spi: amlogic-spisg: initialize completion before requesting IRQ
@ 2026-04-27 17:42 Felix Gu
  2026-04-28  0:57 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Felix Gu @ 2026-04-27 17:42 UTC (permalink / raw)
  To: Sunny Luo, Xianwei Zhao, Mark Brown
  Cc: linux-amlogic, linux-spi, linux-kernel, Felix Gu

Move init_completion(&spisg->completion) to before devm_request_irq()
to avoid a potential race condition where an interrupt could fire
before the completion structure is initialized.

Fixes: cef9991e04ae ("spi: Add Amlogic SPISG driver")
Signed-off-by: Felix Gu <ustc.gu@gmail.com>
---
 drivers/spi/spi-amlogic-spisg.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/spi/spi-amlogic-spisg.c b/drivers/spi/spi-amlogic-spisg.c
index 19c5eba412ef..f9de2d2c9213 100644
--- a/drivers/spi/spi-amlogic-spisg.c
+++ b/drivers/spi/spi-amlogic-spisg.c
@@ -794,6 +794,7 @@ static int aml_spisg_probe(struct platform_device *pdev)
 
 	dma_set_max_seg_size(&pdev->dev, SPISG_BLOCK_MAX);
 
+	init_completion(&spisg->completion);
 	ret = devm_request_irq(&pdev->dev, irq, aml_spisg_irq, 0, NULL, spisg);
 	if (ret) {
 		dev_err(&pdev->dev, "irq request failed\n");
@@ -806,8 +807,6 @@ static int aml_spisg_probe(struct platform_device *pdev)
 		goto out_clk;
 	}
 
-	init_completion(&spisg->completion);
-
 	pm_runtime_put(&spisg->pdev->dev);
 
 	return 0;

---
base-commit: 7080e32d3f09d8688c4a87d81bdcc71f7f606b16
change-id: 20260428-amlogic-spisg-e5594ea3eb48

Best regards,
-- 
Felix Gu <ustc.gu@gmail.com>


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] spi: amlogic-spisg: initialize completion before requesting IRQ
  2026-04-27 17:42 [PATCH] spi: amlogic-spisg: initialize completion before requesting IRQ Felix Gu
@ 2026-04-28  0:57 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2026-04-28  0:57 UTC (permalink / raw)
  To: Sunny Luo, Xianwei Zhao, Felix Gu; +Cc: linux-amlogic, linux-spi, linux-kernel

On Tue, 28 Apr 2026 01:42:00 +0800, Felix Gu wrote:
> spi: amlogic-spisg: initialize completion before requesting IRQ

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-7.1

Thanks!

[1/1] spi: amlogic-spisg: initialize completion before requesting IRQ
      https://git.kernel.org/broonie/spi/c/8d0189c1ea98

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-04-28  3:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-27 17:42 [PATCH] spi: amlogic-spisg: initialize completion before requesting IRQ Felix Gu
2026-04-28  0:57 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox