spi: cavium-thunderx: fix controller deregistration

Make sure to deregister the controller before disabling it to avoid
hanging or leaking resources associated with the queue when the queue
non-empty.

Fixes: 7347a6c7af ("spi: octeon: Add ThunderX driver")
Cc: stable@vger.kernel.org	# 4.9
Cc: Jan Glauber <jan.glauber@gmail.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://patch.msgid.link/20260409120419.388546-10-johan@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Johan Hovold 2026-04-09 14:04:08 +02:00 committed by Mark Brown
parent 3c49a4d879
commit dbb6b01267
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0
1 changed files with 7 additions and 1 deletions

View File

@ -70,7 +70,7 @@ static int thunderx_spi_probe(struct pci_dev *pdev,
pci_set_drvdata(pdev, host);
ret = devm_spi_register_controller(dev, host);
ret = spi_register_controller(host);
if (ret)
goto error;
@ -90,8 +90,14 @@ static void thunderx_spi_remove(struct pci_dev *pdev)
if (!p)
return;
spi_controller_get(host);
spi_unregister_controller(host);
/* Put everything in a known state. */
writeq(0, p->register_base + OCTEON_SPI_CFG(p));
spi_controller_put(host);
}
static const struct pci_device_id thunderx_spi_pci_id_table[] = {