OpenCloudOS-Kernel/include/linux/spi
Mark Brown ef4d96ec4a spi: Split bus and I/O locking
The current SPI code attempts to use bus_lock_mutex for two purposes. One
is to implement spi_bus_lock() which grants exclusive access to the bus.
The other is to serialize access to the physical hardware. This duplicate
purpose causes confusion which leads to cases where access is not locked
when a caller holds the bus lock mutex. Fix this by splitting out the I/O
functionality into a new io_mutex.

This means taking both mutexes in the DMA path, replacing the existing
mutex with the new I/O one in the message pump (the mutex now always
being taken in the message pump) and taking the bus lock mutex in
spi_sync(), allowing __spi_sync() to have no mutex handling.

While we're at it hoist the mutex further up the message pump before we
power up the device so that all power up/down of the block is covered by
it and there are no races with in-line pumping of messages.

Reported-by: Rich Felker <dalias@libc.org>
Tested-by: Rich Felker <dalias@libc.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-07-25 11:47:52 +01:00
..
ad7877.h
adi_spi3.h
ads7846.h
at73c213.h
at86rf230.h at86rf230: add support for external xtal trim 2015-02-27 18:42:44 +01:00
cc2520.h cc2520: fix CC2591 handling 2015-05-31 13:40:53 +02:00
corgi_lcd.h
ds1305.h
eeprom.h eeprom: at25: Remove in kernel API for accessing the EEPROM 2016-03-01 16:55:48 -08:00
flash.h
ifx_modem.h
l4f00242t03.h spi: Remove FSF mailing addresses 2014-12-22 15:32:42 +00:00
libertas_spi.h
lms283gf05.h spi: Remove FSF mailing addresses 2014-12-22 15:32:42 +00:00
max7301.h
mc33880.h
mcp23s08.h
mmc_spi.h
mxs-spi.h spi: Remove FSF mailing addresses 2014-12-22 15:32:42 +00:00
pxa2xx_spi.h ARM: pxa: Remove unused clock_enable field from struct pxa2xx_spi_master 2015-09-20 19:37:20 +02:00
rspi.h spi: Remove FSF mailing addresses 2014-12-22 15:32:42 +00:00
s3c24xx.h
sh_hspi.h spi: Remove FSF mailing addresses 2014-12-22 15:32:42 +00:00
sh_msiof.h spi: sh-msiof: Configure MSIOF sync signal timing in device tree 2014-12-24 12:31:17 +00:00
spi.h spi: Split bus and I/O locking 2016-07-25 11:47:52 +01:00
spi_bitbang.h spi: bitbang: Replace spinlock by mutex 2015-09-17 12:13:40 +01:00
spi_gpio.h
spi_oc_tiny.h
tdo24m.h
tle62x0.h spi: Remove FSF mailing addresses 2014-12-22 15:32:42 +00:00
tsc2005.h spi: Remove FSF mailing addresses 2014-12-22 15:32:42 +00:00
xilinx_spi.h