Skip to content

Commit dc9a7dd

Browse files
krzkgregkh
authored andcommitted
spi: spi-fsl-dspi: Fix imprecise abort on VF500 during probe
commit d8ffee2 upstream. Registers of DSPI should not be accessed before enabling its clock. On Toradex Colibri VF50 on Iris carrier board this could be seen during bootup as imprecise abort: Unhandled fault: imprecise external abort (0x1c06) at 0x00000000 Internal error: : 1c06 [#1] ARM Modules linked in: CPU: 0 PID: 1 Comm: swapper Not tainted 4.14.39-dirty #97 Hardware name: Freescale Vybrid VF5xx/VF6xx (Device Tree) Backtrace: [<804166a8>] (regmap_write) from [<80466b5c>] (dspi_probe+0x1f0/0x8dc) [<8046696c>] (dspi_probe) from [<8040107c>] (platform_drv_probe+0x54/0xb8) [<80401028>] (platform_drv_probe) from [<803ff53c>] (driver_probe_device+0x280/0x2f8) [<803ff2bc>] (driver_probe_device) from [<803ff674>] (__driver_attach+0xc0/0xc4) [<803ff5b4>] (__driver_attach) from [<803fd818>] (bus_for_each_dev+0x70/0xa4) [<803fd7a8>] (bus_for_each_dev) from [<803fee74>] (driver_attach+0x24/0x28) [<803fee50>] (driver_attach) from [<803fe980>] (bus_add_driver+0x1a0/0x218) [<803fe7e0>] (bus_add_driver) from [<803fffe8>] (driver_register+0x80/0x100) [<803fff68>] (driver_register) from [<80400fdc>] (__platform_driver_register+0x48/0x50) [<80400f94>] (__platform_driver_register) from [<8091cf7c>] (fsl_dspi_driver_init+0x1c/0x20) [<8091cf60>] (fsl_dspi_driver_init) from [<8010195c>] (do_one_initcall+0x4c/0x174) [<80101910>] (do_one_initcall) from [<80900e8c>] (kernel_init_freeable+0x144/0x1d8) [<80900d48>] (kernel_init_freeable) from [<805ff6a8>] (kernel_init+0x10/0x114) [<805ff698>] (kernel_init) from [<80107be8>] (ret_from_fork+0x14/0x2c) Cc: <[email protected]> Fixes: 5ee67b5 ("spi: dspi: clear SPI_SR before enable interrupt") Signed-off-by: Krzysztof Kozlowski <[email protected]> Signed-off-by: Mark Brown <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 23554ca commit dc9a7dd

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

drivers/spi/spi-fsl-dspi.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1006,30 +1006,30 @@ static int dspi_probe(struct platform_device *pdev)
10061006
goto out_master_put;
10071007
}
10081008

1009+
dspi->clk = devm_clk_get(&pdev->dev, "dspi");
1010+
if (IS_ERR(dspi->clk)) {
1011+
ret = PTR_ERR(dspi->clk);
1012+
dev_err(&pdev->dev, "unable to get clock\n");
1013+
goto out_master_put;
1014+
}
1015+
ret = clk_prepare_enable(dspi->clk);
1016+
if (ret)
1017+
goto out_master_put;
1018+
10091019
dspi_init(dspi);
10101020
dspi->irq = platform_get_irq(pdev, 0);
10111021
if (dspi->irq < 0) {
10121022
dev_err(&pdev->dev, "can't get platform irq\n");
10131023
ret = dspi->irq;
1014-
goto out_master_put;
1024+
goto out_clk_put;
10151025
}
10161026

10171027
ret = devm_request_irq(&pdev->dev, dspi->irq, dspi_interrupt, 0,
10181028
pdev->name, dspi);
10191029
if (ret < 0) {
10201030
dev_err(&pdev->dev, "Unable to attach DSPI interrupt\n");
1021-
goto out_master_put;
1022-
}
1023-
1024-
dspi->clk = devm_clk_get(&pdev->dev, "dspi");
1025-
if (IS_ERR(dspi->clk)) {
1026-
ret = PTR_ERR(dspi->clk);
1027-
dev_err(&pdev->dev, "unable to get clock\n");
1028-
goto out_master_put;
1031+
goto out_clk_put;
10291032
}
1030-
ret = clk_prepare_enable(dspi->clk);
1031-
if (ret)
1032-
goto out_master_put;
10331033

10341034
if (dspi->devtype_data->trans_mode == DSPI_DMA_MODE) {
10351035
ret = dspi_request_dma(dspi, res->start);

0 commit comments

Comments
 (0)