linux-kernel-test/drivers
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
..
accessibility
acpi Remove newline from the description of module parameters 2008-08-01 12:46:41 -07:00
amba
ata avr32: Use <mach/foo.h> instead of <asm/arch/foo.h> 2008-08-05 14:36:57 +02:00
atm atm: fix direct casts of pointers to u32 in the InterPhase driver 2008-07-30 16:33:05 -07:00
auxdisplay
base Merge branch 'core-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2008-08-01 11:52:39 -07:00
block xen-blkfront.c: make blkif_ioctl() static 2008-08-06 12:30:04 +02:00
bluetooth [Bluetooth] Add full quirk implementation for btusb driver 2008-08-07 22:26:56 +02:00
cdrom cdrom: don't check CDC_PLAY_AUDIO in cdrom_count_tracks() 2008-08-05 18:17:02 +02:00
char crypto: padlock - fix VIA PadLock instruction usage with irq_ts_save/restore() 2008-08-13 22:02:26 +10:00
clocksource
connector
cpufreq [CPUFREQ] Fix -Wshadow warning in conservative governor. 2008-08-08 16:00:48 -04:00
cpuidle cpuidle: make sysfs attributes sysdev class attributes 2008-08-12 16:07:28 -07:00
crypto crypto: padlock - fix VIA PadLock instruction usage with irq_ts_save/restore() 2008-08-13 22:02:26 +10:00
dca
dio
dma Merge branch 'for-linus-merged' of master.kernel.org:/home/rmk/linux-2.6-arm 2008-08-08 11:38:42 -07:00
edac
eisa
firewire Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6 2008-08-06 12:03:43 -07:00
firmware firmware/memmap: cleanup 2008-08-12 16:07:31 -07:00
gpio
gpu Remove newline from the description of module parameters 2008-08-01 12:46:41 -07:00
hid
hwmon coretemp: recognize Nehalem CPUs 2008-08-15 08:35:44 -07:00
i2c USB: isp1301: fix compilation 2008-08-13 17:32:56 -07:00
ide [ARM] Move include/asm-arm/arch-* to arch/arm/*/include/mach 2008-08-07 09:55:48 +01:00
ieee1394
infiniband Merge branches 'ehca' and 'ipoib' into for-linus 2008-08-12 13:52:54 -07:00
input Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6 2008-08-13 20:48:25 -07:00
isdn Add DIP switch readout for HFC-4S IOB4ST 2008-08-02 16:40:37 +02:00
leds [ARM] Move include/asm-arm/arch-* to arch/arm/*/include/mach 2008-08-07 09:55:48 +01:00
lguest lguest: use get_user_pages_fast() instead of get_user_pages() 2008-08-12 17:52:53 +10:00
macintosh remove unnecessary <linux/hdreg.h> includes 2008-08-05 18:16:58 +02:00
mca
md Merge branch 'for-linus' of git://neil.brown.name/md 2008-08-01 11:56:07 -07:00
media Merge Linus' latest into master 2008-08-08 19:18:18 +01:00
memstick
message
mfd mfd: tc6393 cleanup and update 2008-08-10 23:32:07 +02:00
misc GRU: fix preprocessor symbol for sparse 2008-08-12 16:07:29 -07:00
mmc mfd: have TMIO drivers and subdevices depend on ARM 2008-08-10 23:30:34 +02:00
mtd mfd: have TMIO drivers and subdevices depend on ARM 2008-08-10 23:30:34 +02:00
net Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6 2008-08-13 20:48:46 -07:00
nubus
of
oprofile
parisc
parport
pci PCI: Limit VPD length for Broadcom 5708S 2008-08-07 17:47:37 -07:00
pcmcia [ARM] Move include/asm-arm/arch-* to arch/arm/*/include/mach 2008-08-07 09:55:48 +01:00
pnp PNP: fix formatting of dbg_pnp_show_resources() output 2008-08-01 12:46:41 -07:00
power [ARM] Move include/asm-arm/arch-* to arch/arm/*/include/mach 2008-08-07 09:55:48 +01:00
ps3
rapidio
regulator
rtc rtc-isl1208: fix double removal of a sysfs entry 2008-08-12 16:07:28 -07:00
s390 [S390] qeth: avoid use of include/asm-s390 2008-08-01 16:39:36 +02:00
sbus sparc/drivers: use linux/of_device.h instead of asm/of_device.h 2008-08-11 14:30:53 -07:00
scsi make struct scsi_dh_devlist's static 2008-08-11 12:20:31 -07:00
serial Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6 2008-08-13 20:48:25 -07:00
sh sh: Fix up broken kerneldoc comments. 2008-08-04 12:51:06 +09:00
sn
spi spi: bugfix spi_add_device() with duplicate chipselects 2008-08-15 08:35:44 -07:00
ssb
tc
telephony
thermal
uio
usb usb: musb: pass configuration specifics via pdata 2008-08-13 17:33:01 -07:00
video freescale DIU: bug fix: add sanity check for AOI position 2008-08-15 08:35:43 -07:00
virtio
w1
watchdog ALi M7101 PMU also available on Sun Netra's too 2008-08-12 16:07:31 -07:00
xen
zorro
Kconfig
Makefile USB: Add MUSB and TUSB support 2008-08-13 17:33:00 -07:00