Unverified Commit 8d0189c1 authored by Felix Gu's avatar Felix Gu Committed by Mark Brown
Browse files

spi: amlogic-spisg: initialize completion before requesting IRQ



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: cef9991e ("spi: Add Amlogic SPISG driver")
Signed-off-by: default avatarFelix Gu <ustc.gu@gmail.com>
Link: https://patch.msgid.link/20260428-amlogic-spisg-v1-1-8eecc3b446d6@gmail.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent f5c6a272
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -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;