linux/drivers/spi
Atsushi Nemoto 1e9a51dca1 [PATCH] SPI: alternative fix for spi_busnum_to_master
If a SPI master device exists, udev (udevtrigger) causes kernel crash, due
to wrong kobj pointer in kobject_uevent_env().  This problem was not in
2.6.19.

The backtrace (on MIPS) was:
[<8024db6c>] kobject_uevent_env+0x54c/0x5e8
[<802a8264>] store_uevent+0x1c/0x3c  (in drivers/class.c)
[<801cb14c>] subsys_attr_store+0x2c/0x50
[<801cb80c>] flush_write_buffer+0x38/0x5c
[<801cb900>] sysfs_write_file+0xd0/0x190
[<80181444>] vfs_write+0xc4/0x1a0
[<80181cdc>] sys_write+0x54/0xa0
[<8010dae4>] stack_done+0x20/0x3c

flush_write_buffer() passes kobject of spi_master_class.subsys to
subsys_addr_store(), then subsys_addr_store() passes a pointer to a struct
subsystem to store_uevent() which expects a pointer to a struct
class_device.  The problem seems subsys_attr_store() called instead of
class_device_attr_store().

This mismatch was caused by commit
3bd0f69435, which overrides kset of master
class.  This made spi_master_class.subsys.kset.ktype NULL so
subsys_sysfs_ops is used instead of class_dev_sysfs_ops.

The commit was to fix spi_busnum_to_master().  Here is a patch fixes
this function in other way, just searching children list of
class_device.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-01-26 13:50:58 -08:00
..
Kconfig
Makefile
pxa2xx_spi.c [PATCH] spi: fix error setting the spi mode in pxa2xx_spi.c 2007-01-26 13:50:57 -08:00
spi_bitbang.c [PATCH] slab: remove SLAB_KERNEL 2006-12-07 08:39:24 -08:00
spi_butterfly.c [PATCH] spi: check platform_device_register_simple() error 2006-12-07 08:39:42 -08:00
spi_mpc83xx.c [PATCH] SPI: define null tx_buf to mean "shift out zeroes" 2006-12-30 10:56:42 -08:00
spi_s3c24xx_gpio.c [PATCH] spi_s3c24xx_gpio: use right header 2006-12-30 10:56:43 -08:00
spi_s3c24xx.c [PATCH] S3C24XX: fix passing spi chipselect to select routine 2007-01-26 13:50:57 -08:00
spi.c [PATCH] SPI: alternative fix for spi_busnum_to_master 2007-01-26 13:50:58 -08:00