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: 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: 7347a6c7af8d ("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>

authored by

Johan Hovold and committed by
Mark Brown
dbb6b012 3c49a4d8

+7 -1
+7 -1
drivers/spi/spi-cavium-thunderx.c
··· 70 70 71 71 pci_set_drvdata(pdev, host); 72 72 73 - ret = devm_spi_register_controller(dev, host); 73 + ret = spi_register_controller(host); 74 74 if (ret) 75 75 goto error; 76 76 ··· 90 90 if (!p) 91 91 return; 92 92 93 + spi_controller_get(host); 94 + 95 + spi_unregister_controller(host); 96 + 93 97 /* Put everything in a known state. */ 94 98 writeq(0, p->register_base + OCTEON_SPI_CFG(p)); 99 + 100 + spi_controller_put(host); 95 101 } 96 102 97 103 static const struct pci_device_id thunderx_spi_pci_id_table[] = {