android_kernel_xiaomi_sm8350/drivers/spi
David Brownell e48880e02e spi: bugfix spi_add_device() with duplicate chipselects
When reviewing a recent patch I noticed a potential trouble spot in the
registration of new SPI devices.  The SPI master driver is told to set
the device up before adding it to the driver model, so that it's always
properly set up when probe() is called.  (This is important, because in
the case of inverted chipselects, this device can make the bus misbehave
until it's properly deselected.  It's got to be set up even if no driver
binds to the device.)

The trouble spot is that it doesn't first verify that no other device
has been added using that chipselect.  If such a device has been added,
its configuration gets trashed.  (Fortunately this has not been a common
error!)

The fix here adds an explicit check, and a mutex to protect the relevant
critical region.

[akpm@linux-foundation.org: make the lock local to spi_add_device()]
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-08-15 08:35:44 -07:00
..
at25.c
atmel_spi.c [ARM] Move include/asm-arm/arch-* to arch/arm/*/include/mach 2008-08-07 09:55:48 +01:00
atmel_spi.h
au1550_spi.c dma-mapping: add the device argument to dma_mapping_error() 2008-07-26 12:00:03 -07:00
Kconfig spi: new orion_spi driver 2008-08-05 14:33:46 -07:00
Makefile spi: new orion_spi driver 2008-08-05 14:33:46 -07:00
mpc52xx_psc_spi.c mpc52xx_psc_spi: fix block transfer 2008-07-28 16:30:21 -07:00
omap2_mcspi.c [ARM] Move include/asm-arm/arch-* to arch/arm/*/include/mach 2008-08-07 09:55:48 +01:00
omap_uwire.c [ARM] Move include/asm-arm/arch-* to arch/arm/*/include/mach 2008-08-07 09:55:48 +01:00
orion_spi.c spi: new orion_spi driver 2008-08-05 14:33:46 -07:00
pxa2xx_spi.c [ARM] Move include/asm-arm/arch-* to arch/arm/*/include/mach 2008-08-07 09:55:48 +01:00
spi_bfin5xx.c spi_bfin5xx: use PIO for full duplex, not DMA 2008-05-01 08:04:01 -07:00
spi_bitbang.c spi: replace remaining __FUNCTION__ occurrences 2008-04-28 08:58:31 -07:00
spi_butterfly.c
spi_imx.c [ARM] Move include/asm-arm/arch-* to arch/arm/*/include/mach 2008-08-07 09:55:48 +01:00
spi_lm70llp.c
spi_mpc83xx.c spi: spi_mpc83xx clockrate fixes 2008-07-24 10:47:30 -07:00
spi_s3c24xx_gpio.c [ARM] Move include/asm-arm/arch-* to arch/arm/*/include/mach 2008-08-07 09:55:48 +01:00
spi_s3c24xx.c [ARM] Move include/asm-arm/arch-* to arch/arm/*/include/mach 2008-08-07 09:55:48 +01:00
spi_sh_sci.c spi: fix platform driver hotplug/coldplug 2008-04-11 08:06:43 -07:00
spi_txx9.c spi: fix platform driver hotplug/coldplug 2008-04-11 08:06:43 -07:00
spi.c spi: bugfix spi_add_device() with duplicate chipselects 2008-08-15 08:35:44 -07:00
spidev.c spidev: BKL removal 2008-07-24 10:47:30 -07:00
tle62x0.c
xilinx_spi.c xilinx_spi: test below 0 on unsigned irq in xilinx_spi_probe() 2008-07-24 10:47:30 -07:00