Skip to content

Commit 8d0189c

Browse files
outman119broonie
authored andcommitted
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: cef9991 ("spi: Add Amlogic SPISG driver") Signed-off-by: Felix Gu <ustc.gu@gmail.com> Link: https://patch.msgid.link/20260428-amlogic-spisg-v1-1-8eecc3b446d6@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent f5c6a27 commit 8d0189c

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

drivers/spi/spi-amlogic-spisg.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -794,6 +794,7 @@ static int aml_spisg_probe(struct platform_device *pdev)
794794

795795
dma_set_max_seg_size(&pdev->dev, SPISG_BLOCK_MAX);
796796

797+
init_completion(&spisg->completion);
797798
ret = devm_request_irq(&pdev->dev, irq, aml_spisg_irq, 0, NULL, spisg);
798799
if (ret) {
799800
dev_err(&pdev->dev, "irq request failed\n");
@@ -806,8 +807,6 @@ static int aml_spisg_probe(struct platform_device *pdev)
806807
goto out_clk;
807808
}
808809

809-
init_completion(&spisg->completion);
810-
811810
pm_runtime_put(&spisg->pdev->dev);
812811

813812
return 0;

0 commit comments

Comments
 (0)