]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
spi: cadence-quadspi: Implement refcount to handle unbind during busy
authorKhairul Anuar Romli <khairul.anuar.romli@altera.com>
Mon, 29 Sep 2025 19:42:54 +0000 (15:42 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 2 Oct 2025 11:48:39 +0000 (13:48 +0200)
commitb7ec8a2b094a33d0464958c2cbf75b8f229098b0
tree1ad6537acf98ccc8e9f0717e47cbefa0016aa977
parent4109506b7eba2bc304027b1d5fadced0217a09e1
spi: cadence-quadspi: Implement refcount to handle unbind during busy

[ Upstream commit 7446284023e8ef694fb392348185349c773eefb3 ]

driver support indirect read and indirect write operation with
assumption no force device removal(unbind) operation. However
force device removal(removal) is still available to root superuser.

Unbinding driver during operation causes kernel crash. This changes
ensure driver able to handle such operation for indirect read and
indirect write by implementing refcount to track attached devices
to the controller and gracefully wait and until attached devices
remove operation completed before proceed with removal operation.

Signed-off-by: Khairul Anuar Romli <khairul.anuar.romli@altera.com>
Reviewed-by: Matthew Gerlach <matthew.gerlach@altera.com>
Reviewed-by: Niravkumar L Rabara <nirav.rabara@altera.com>
Link: https://patch.msgid.link/8704fd6bd2ff4d37bba4a0eacf5eba3ba001079e.1756168074.git.khairul.anuar.romli@altera.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Stable-dep-of: 30dbc1c8d50f ("spi: cadence-qspi: defer runtime support on socfpga if reset bit is enabled")
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/spi/spi-cadence-quadspi.c