]> git.baikalelectronics.ru Git - kernel.git/commit
spi: fsi: Fix contention in the FSI2SPI engine
authorEddie James <eajames@linux.ibm.com>
Tue, 26 Oct 2021 19:33:27 +0000 (14:33 -0500)
committerMark Brown <broonie@kernel.org>
Wed, 27 Oct 2021 10:31:27 +0000 (11:31 +0100)
commit923bc67f9efcfc2bd6c16820a72b93c7184fc0e0
tree8ace7d35db1fcbdf5ab0c98980cf8703b3243c06
parent65453b6c0c43c632a5910f455e6395a1749409d8
spi: fsi: Fix contention in the FSI2SPI engine

There was nothing to protect multiple SPI controllers on the same FSI2SPI
device from being accessed through the FSI2SPI device at the same time.
For example, multiple writes to the command and data registers might occur
for different SPI controllers, resulting in complete chaos in the SPI
engine. To prevent this, add a FSI2SPI device level mutex and lock it in
the SPI register read and write functions.

Fixes: d765405d8bb0 ("spi: Add FSI-attached SPI controller driver")
Signed-off-by: Eddie James <eajames@linux.ibm.com>
Link: https://lore.kernel.org/r/20211026193327.52420-1-eajames@linux.ibm.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-fsi.c