]> git.baikalelectronics.ru Git - kernel.git/commit
spi: remove some spidev oops-on-rmmod paths
authorDavid Brownell <david-b@pacbell.net>
Fri, 23 May 2008 20:05:03 +0000 (13:05 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 24 May 2008 16:56:14 +0000 (09:56 -0700)
commitbcbea033e609c900ffae4999d6ce0641e63c953d
tree0d83e4176f9a8178a98631097fbf839a53702d94
parente7ec5e99a247136baa49f6cd3e929547b5e838a7
spi: remove some spidev oops-on-rmmod paths

Somehow the spidev code forgot to include a critical mechanism: when the
underlying device is removed (e.g.  spi_master rmmod), open file
descriptors must be prevented from issuing new I/O requests to that
device.  On penalty of the oopsing reported by Sebastian Siewior
<bigeasy@tglx.de> ...

This is a partial fix, adding handshaking between the lower level (SPI
messaging) and the file operations using the spi_dev.  (It also fixes an
issue where reads and writes didn't return the number of bytes sent or
received.)

There's still a refcounting issue to be addressed (separately).

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Reported-by: Sebastian Siewior <bigeasy@tglx.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/spi/spidev.c