diff options
author | Heiko Carstens <heiko.carstens@de.ibm.com> | 2012-10-18 13:13:41 +0200 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2012-10-18 17:50:11 +0200 |
commit | d18f99c28bab882f42949363658da5cf1d2f624f (patch) | |
tree | 00eced6af35a5d0f3bde159d4689b32fdcb739f7 /arch/s390 | |
parent | c985cb37f1b39c2c8035af741a2a0b79f1fbaca7 (diff) | |
download | blackbird-op-linux-d18f99c28bab882f42949363658da5cf1d2f624f.tar.gz blackbird-op-linux-d18f99c28bab882f42949363658da5cf1d2f624f.zip |
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>
Diffstat (limited to 'arch/s390')
-rw-r--r-- | arch/s390/kernel/cache.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/arch/s390/kernel/cache.c b/arch/s390/kernel/cache.c index 8df8d8a19c98..64b24650e4f8 100644 --- a/arch/s390/kernel/cache.c +++ b/arch/s390/kernel/cache.c @@ -59,8 +59,8 @@ enum { enum { CACHE_TI_UNIFIED = 0, - CACHE_TI_INSTRUCTION = 0, - CACHE_TI_DATA, + CACHE_TI_DATA = 0, + CACHE_TI_INSTRUCTION, }; struct cache_info { @@ -121,7 +121,10 @@ static int __init cache_add(int level, int private, int type) cache = kzalloc(sizeof(*cache), GFP_KERNEL); if (!cache) return -ENOMEM; - ti = type == CACHE_TYPE_DATA ? CACHE_TI_DATA : CACHE_TI_UNIFIED; + if (type == CACHE_TYPE_INSTRUCTION) + ti = CACHE_TI_INSTRUCTION; + else + ti = CACHE_TI_UNIFIED; cache->size = ecag(EXTRACT_SIZE, level, ti); cache->line_size = ecag(EXTRACT_LINE_SIZE, level, ti); cache->associativity = ecag(EXTRACT_ASSOCIATIVITY, level, ti); |