linux/drivers
Wolfgang Ocker aaacf4bb51 spi: avoid spidev crash when device is removed
I saw a kernel oops in spidev_remove() when a spidev device was registered
and I unloaded the SPI master driver:

Unable to handle kernel paging request for data at address 0x00000004
Faulting instruction address: 0xc01c0c50
Oops: Kernel access of bad area, sig: 11 [#1]
CDSPR
Modules linked in: spi_ppc4xx(-)
NIP: c01c0c50 LR: c01bf9e4 CTR: c01c0c34
REGS: cec89c30 TRAP: 0300   Not tainted  (2.6.27.3izt)
MSR: 00021000 <ME>  CR: 24000228  XER: 20000007
DEAR: 00000004, ESR: 00800000
TASK = cf889040[2070] 'rmmod' THREAD: cec88000
GPR00: 00000000 cec89ce0 cf889040 cec8e000 00000004 cec8e000 ffffffff 00000000
GPR08: 0000001c c0336380 00000000 c01c0c34 00000001 1001a338 100e0000 100df49c
GPR16: 100b54c0 100df49c 100ddd20 100f05a8 100b5340 100efd68 00000000 00000000
GPR24: 100ec008 100f0428 c0327788 c0327794 cec8e0ac cec8e000 c0336380 00000000
NIP [c01c0c50] spidev_remove+0x1c/0xe4
LR [c01bf9e4] spi_drv_remove+0x2c/0x3c
Call Trace:
[cec89d00] [c01bf9e4] spi_drv_remove+0x2c/0x3c
[cec89d10] [c01859a0] __device_release_driver+0x78/0xb4
[cec89d20] [c0185ab0] device_release_driver+0x28/0x44
[cec89d40] [c0184be8] bus_remove_device+0xac/0xd8
[cec89d60] [c0183094] device_del+0x100/0x194
[cec89d80] [c0183140] device_unregister+0x18/0x30
[cec89da0] [c01bf30c] __unregister+0x20/0x34
[cec89db0] [c0182778] device_for_each_child+0x38/0x74
[cec89de0] [c01bf2d0] spi_unregister_master+0x28/0x44
[cec89e00] [c01bfeac] spi_bitbang_stop+0x1c/0x58
[cec89e20] [d908a5e0] spi_ppc4xx_of_remove+0x24/0x7c [spi_ppc4xx]
[...]

IMHO a call to spi_set_drvdata() is missing in spidev_probe(). The patch
below helped.

Signed-off-by: Wolfgang Ocker <weo@reccoware.de>
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-12-01 19:55:24 -08:00
..
accessibility
acpi toshiba_acpi: close race in toshiba_acpi driver 2008-11-28 14:21:53 -05:00
amba
ata libata: blacklist Seagate drives which time out FLUSH_CACHE when used with NCQ 2008-12-01 13:49:27 -05:00
atm
auxdisplay
base sysfs: Fix return values for sysdev_store_{ulong,int} 2008-10-29 15:03:49 -07:00
block Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc 2008-11-30 16:44:18 -08:00
bluetooth bpa10x: free sk_buff with kfree_skb 2008-10-31 00:40:19 -07:00
cdrom gdrom: Fix compile error 2008-10-28 17:46:02 +09:00
char drivers/char/tty_io.c: Avoid panic when no console is configured. 2008-12-01 08:19:10 -08:00
clocksource
connector
cpufreq
cpuidle regression: disable timer peek-ahead for 2.6.28 2008-11-09 16:28:42 -08:00
crypto fix talitos 2008-11-30 10:03:36 -08:00
dca [4/4] dca: fixup initialization dependency 2008-11-10 15:01:03 -08:00
dio
dma dmaengine: struct device - replace bus_id with dev_name(), dev_set_name() 2008-11-11 13:12:33 -07:00
edac i5000-edac: hold reference to mci kobject 2008-11-12 17:17:16 -08:00
eisa
firewire firewire: fw-sbp2: another iPod mini quirk entry 2008-11-25 21:38:31 +01:00
firmware trivial: dmi_scan typo 2008-11-07 08:25:43 -08:00
gpio gpiolib: extend gpio label column width in debugfs file 2008-11-19 18:49:57 -08:00
gpu drm/i915: Fix copy'n'pasteo that broke VT switch if flushing was non-empty. 2008-12-01 10:23:21 +10:00
hid HID: Apple ALU wireless keyboards are bluetooth devices 2008-11-28 15:09:26 +01:00
hwmon hwmon: applesmc: make applesmc load automatically on startup 2008-12-01 19:55:24 -08:00
i2c i2c-parport: Fix misplaced parport_release call 2008-11-28 15:24:39 +01:00
ide icside section warnings 2008-11-30 10:03:36 -08:00
idle i7300_idle: Kconfig, show menu only on x86_64 2008-10-28 00:14:47 -04:00
ieee1394 ieee1394: sbp2: fix race condition in state change 2008-11-29 17:07:56 +01:00
infiniband Merge branches 'ehca' and 'mlx4' into for-linus 2008-12-01 10:11:50 -08:00
input Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input 2008-11-30 11:05:21 -08:00
isdn tricky one: hisax sections 2008-11-30 10:03:37 -08:00
leds remove unused #include <version.h>'s 2008-11-01 09:50:12 -07:00
lguest
macintosh rackmeter section fixes 2008-11-30 10:03:37 -08:00
mca
md dm: avoid destroying table in dm_any_congested 2008-11-13 23:39:14 +00:00
media V4L/DVB (9624): CVE-2008-5033: fix OOPS on tvaudio when controlling bass/treble 2008-11-14 14:39:47 -02:00
memstick
message trivial: MPT fusion - remove long dead code 2008-11-07 08:25:43 -08:00
mfd mfd: Correct WM8350 I2C return code usage 2008-11-16 19:58:47 +01:00
misc ACPI: thinkpad-acpi: fix fan sleep/resume path 2008-11-26 19:24:22 -05:00
mmc mmc: struct device - replace bus_id with dev_name(), dev_set_name() 2008-11-08 21:37:46 +01:00
mtd Merge branch 'linux-next' of git://git.infradead.org/~dedekind/ubi-2.6 2008-11-30 11:34:17 -08:00
net Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband 2008-12-01 11:01:54 -08:00
nubus
of OF-device: Don't overwrite numa_node in device registration 2008-10-31 16:12:01 +11:00
oprofile oprofile: fix memory ordering 2008-10-27 19:15:41 +01:00
parisc
parport parport_serial: fix array overflow 2008-12-01 19:55:24 -08:00
pci pci_setup() is init, not devinit 2008-11-30 10:03:37 -08:00
pcmcia pcmcia: ensure correct logging in do_io_probe 2008-11-09 21:47:47 +01:00
pnp drivers: remove duplicated #include 2008-11-04 08:18:19 -08:00
power
ps3 powerpc/ps3: Fix compile error in ps3-lpm.c 2008-11-05 19:59:08 +11:00
rapidio rapidio section noise 2008-11-30 10:03:37 -08:00
regulator regulator: Use menuconfig in Kconfig 2008-11-09 14:49:23 +00:00
rtc Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6 2008-11-17 07:54:47 -08:00
s390 Merge branch 'for-linus' of git://git390.osdl.marist.edu/pub/scm/linux-2.6 2008-11-15 11:38:02 -08:00
sbus Revert "of_platform_driver noise on sparce" 2008-12-01 07:55:14 -08:00
scsi gdth section fixes 2008-11-30 10:03:36 -08:00
serial Merge branch 'merge' of git://git.secretlab.ca/git/linux-2.6-mpc52xx into merge 2008-11-24 11:53:44 +11:00
sh
sn
spi spi: avoid spidev crash when device is removed 2008-12-01 19:55:24 -08:00
ssb SSB: hide empty sub menu 2008-11-10 13:50:17 -08:00
staging Don't ask twice about not including staging drivers 2008-11-09 12:47:04 -08:00
tc
telephony telephony: trivial: fix up email address 2008-11-11 09:30:23 -08:00
thermal
uio saner FASYNC handling on file close 2008-11-01 09:49:46 -07:00
usb Add kref to fake tty used by USB console 2008-12-01 08:19:10 -08:00
uwb
video Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc 2008-11-30 16:44:18 -08:00
virtio
w1 W1_MASTER_DS1WM should depend on HAVE_CLK 2008-11-30 10:03:36 -08:00
watchdog Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc 2008-11-11 09:24:31 -08:00
xen xen: fix scrub_page() 2008-11-17 19:11:26 +01:00
zorro
Kconfig regulator: Build on non-ARM platforms 2008-10-28 21:47:17 +00:00
Makefile Merge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/dvrabel/uwb 2008-10-26 16:35:46 -07:00