Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

s390/cache: fix data/instruction cache output

The sysfs and procfs output of the instruction and data caches were
wrong: the output of the data cache provided that instruction cache
values and vice versa.
Fix this by using the correct type indication when issueing the
ecag instruction.

Reported-by: Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>

authored by

Heiko Carstens and committed by
Martin Schwidefsky
d18f99c2 c985cb37

+6 -3
+6 -3
arch/s390/kernel/cache.c
··· 59 59 60 60 enum { 61 61 CACHE_TI_UNIFIED = 0, 62 - CACHE_TI_INSTRUCTION = 0, 63 - CACHE_TI_DATA, 62 + CACHE_TI_DATA = 0, 63 + CACHE_TI_INSTRUCTION, 64 64 }; 65 65 66 66 struct cache_info { ··· 121 121 cache = kzalloc(sizeof(*cache), GFP_KERNEL); 122 122 if (!cache) 123 123 return -ENOMEM; 124 - ti = type == CACHE_TYPE_DATA ? CACHE_TI_DATA : CACHE_TI_UNIFIED; 124 + if (type == CACHE_TYPE_INSTRUCTION) 125 + ti = CACHE_TI_INSTRUCTION; 126 + else 127 + ti = CACHE_TI_UNIFIED; 125 128 cache->size = ecag(EXTRACT_SIZE, level, ti); 126 129 cache->line_size = ecag(EXTRACT_LINE_SIZE, level, ti); 127 130 cache->associativity = ecag(EXTRACT_ASSOCIATIVITY, level, ti);