]> git.baikalelectronics.ru Git - kernel.git/commit
spi: spi-mxs: Fix race in setup method
authorTrent Piepho <tpiepho@gmail.com>
Tue, 1 Oct 2013 20:15:25 +0000 (13:15 -0700)
committerMark Brown <broonie@linaro.org>
Fri, 18 Oct 2013 00:00:31 +0000 (01:00 +0100)
commit76a6db6e5b5171cefd95caaab73ca3440ab7528a
tree365c0f4bce04f8c6b26099521256e3cfa07e8c00
parent8423bea6c948fc3f2f126d5252b0456a5d226f7f
spi: spi-mxs: Fix race in setup method

Despite many warnings in the SPI documentation and code, the spi-mxs
driver sets shared chip registers in the ->setup method.  This method can
be called when transfers are in progress on other slaves controlled by the
master.  Setting registers or any other shared state will corrupt those
transfers.

So fix mxs_spi_setup() to not call mxs_spi_setup_transfer().
mxs_spi_setup_transfer() is already called for each transfer when they
are actually performed in mxs_spi_transfer_one(), so the call in
mxs_spi_setup() isn't necessary to setup anything.

Signed-off-by: Trent Piepho <tpiepho@gmail.com>
Cc: Marek Vasut <marex@denx.de>
Cc: Fabio Estevam <fabio.estevam@freescale.com>
Cc: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
drivers/spi/spi-mxs.c