Skip to content

Commit b9402e3

Browse files
committed
parisc: Check for valid stride size for cache flushes
Report if the calculated cache stride size is zero, otherwise the cache flushing routine will never finish and hang the machine. This can be reproduced with a testcase in qemu, where the firmware reports wrong cache values. Signed-off-by: Helge Deller <[email protected]>
1 parent 2751153 commit b9402e3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

arch/parisc/kernel/cache.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,10 @@ parisc_cache_init(void)
264264
icache_stride = CAFL_STRIDE(cache_info.ic_conf);
265265
#undef CAFL_STRIDE
266266

267+
/* stride needs to be non-zero, otherwise cache flushes will not work */
268+
WARN_ON(cache_info.dc_size && dcache_stride == 0);
269+
WARN_ON(cache_info.ic_size && icache_stride == 0);
270+
267271
if ((boot_cpu_data.pdc.capabilities & PDC_MODEL_NVA_MASK) ==
268272
PDC_MODEL_NVA_UNSUPPORTED) {
269273
printk(KERN_WARNING "parisc_cache_init: Only equivalent aliasing supported!\n");

0 commit comments

Comments
 (0)