Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

spi: ti-qspi: fix controller deregistration

Make sure to deregister the controller before disabling underlying
resources like clocks during driver unbind.

Note that the controller is suspended before disabling and releasing
resources since commit 3ac066e2227c ("spi: spi-ti-qspi: Suspend the
queue before removing the device") which avoids issues like unclocked
accesses but prevents SPI device drivers from doing I/O during
deregistration.

Fixes: 3b3a80019ff1 ("spi: ti-qspi: one only one interrupt handler")
Cc: stable@vger.kernel.org # 3.13
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://patch.msgid.link/20260410081757.503099-24-johan@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Johan Hovold and committed by
Mark Brown
0c18a1ba ad7310e9

+6 -8
+6 -8
drivers/spi/spi-ti-qspi.c
··· 888 888 qspi->mmap_enabled = false; 889 889 qspi->current_cs = -1; 890 890 891 - ret = devm_spi_register_controller(&pdev->dev, host); 891 + ret = spi_register_controller(host); 892 892 if (!ret) 893 893 return 0; 894 894 ··· 903 903 static void ti_qspi_remove(struct platform_device *pdev) 904 904 { 905 905 struct ti_qspi *qspi = platform_get_drvdata(pdev); 906 - int rc; 907 906 908 - rc = spi_controller_suspend(qspi->host); 909 - if (rc) { 910 - dev_alert(&pdev->dev, "spi_controller_suspend() failed (%pe)\n", 911 - ERR_PTR(rc)); 912 - return; 913 - } 907 + spi_controller_get(qspi->host); 908 + 909 + spi_unregister_controller(qspi->host); 914 910 915 911 pm_runtime_put_sync(&pdev->dev); 916 912 pm_runtime_disable(&pdev->dev); 917 913 918 914 ti_qspi_dma_cleanup(qspi); 915 + 916 + spi_controller_put(qspi->host); 919 917 } 920 918 921 919 static const struct dev_pm_ops ti_qspi_pm_ops = {