]> git.baikalelectronics.ru Git - kernel.git/commit
s390/cacheinfo: don't use smp_processor_id() in preemptible context
authorHeiko Carstens <heiko.carstens@de.ibm.com>
Mon, 9 Feb 2015 11:54:16 +0000 (12:54 +0100)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Tue, 10 Feb 2015 09:15:57 +0000 (10:15 +0100)
commit49bd30ac6eec6378daf99b6a96d6244416ccafc3
tree3afaaeec8ecc47be92aa209b715c84522ff9c1f5
parent0a08813f792c369e9dacd18d036e721b62121f4f
s390/cacheinfo: don't use smp_processor_id() in preemptible context

show_cacheinfo() needs to access the cacheinfo structure of any online
cpu. This was done with using smp_processor_id() as in index while in
preemtible context.
This means the cpu could be offline and the data be gone when it would
be accessed.
Better use any online cpu address and protect the data by get_online_cpus()
and put_online_cpus().

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
arch/s390/kernel/cache.c