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

ARC: Fix ICCM & DCCM runtime size checks

As of today the ICCM and DCCM size checks are incorrectly using
mismatched units (KiB checked against bytes). The CONFIG_ARC_DCCM_SZ
and CONFIG_ARC_ICCM_SZ are in KiB, but the size calculated in
runtime and stored in cpu->dccm.sz and cpu->iccm.sz is in bytes.

Fix that.

Reported-by: Paul Greco <pmgreco@us.ibm.com>
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>

authored by

Eugeniy Paltsev and committed by
Vineet Gupta
43900edf 8f3d9f35

+3 -2
+3 -2
arch/arc/kernel/setup.c
··· 11 11 #include <linux/clocksource.h> 12 12 #include <linux/console.h> 13 13 #include <linux/module.h> 14 + #include <linux/sizes.h> 14 15 #include <linux/cpu.h> 15 16 #include <linux/of_clk.h> 16 17 #include <linux/of_fdt.h> ··· 425 424 if ((unsigned int)__arc_dccm_base != cpu->dccm.base_addr) 426 425 panic("Linux built with incorrect DCCM Base address\n"); 427 426 428 - if (CONFIG_ARC_DCCM_SZ != cpu->dccm.sz) 427 + if (CONFIG_ARC_DCCM_SZ * SZ_1K != cpu->dccm.sz) 429 428 panic("Linux built with incorrect DCCM Size\n"); 430 429 #endif 431 430 432 431 #ifdef CONFIG_ARC_HAS_ICCM 433 - if (CONFIG_ARC_ICCM_SZ != cpu->iccm.sz) 432 + if (CONFIG_ARC_ICCM_SZ * SZ_1K != cpu->iccm.sz) 434 433 panic("Linux built with incorrect ICCM Size\n"); 435 434 #endif 436 435