[S390] cio/crw: add/fix locking
authorHeiko Carstens <heiko.carstens@de.ibm.com>
Thu, 26 Mar 2009 14:24:09 +0000 (15:24 +0100)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Thu, 26 Mar 2009 14:24:13 +0000 (15:24 +0100)
commit98c1c6825247c71e3d8a9a5439ba21fce7563014
tree6e2311aff5eefba2aaad2f09b1c11b7b2b0eceae
parente74fe0cec92439115630b51195444b89b910800a
[S390] cio/crw: add/fix locking

The crw_unregister_handler uses xchg + synchronize_sched when
unregistering a crw_handler.
This doesn't protect crw_collect_info to potentially jump to NULL since
it has unlocked code like this:

if (crw_handlers[i])
        crw_handlers[i](NULL, NULL, 1);

So add a mutex which protects the crw handler array for changes.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
drivers/s390/cio/crw.c