Skip to content

Commit 43900ed

Browse files
Eugeniy Paltsevvineetgarc
authored andcommitted
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 <[email protected]> Signed-off-by: Eugeniy Paltsev <[email protected]> Signed-off-by: Vineet Gupta <[email protected]>
1 parent 8f3d9f3 commit 43900ed

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

arch/arc/kernel/setup.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <linux/clocksource.h>
1212
#include <linux/console.h>
1313
#include <linux/module.h>
14+
#include <linux/sizes.h>
1415
#include <linux/cpu.h>
1516
#include <linux/of_clk.h>
1617
#include <linux/of_fdt.h>
@@ -424,12 +425,12 @@ static void arc_chk_core_config(void)
424425
if ((unsigned int)__arc_dccm_base != cpu->dccm.base_addr)
425426
panic("Linux built with incorrect DCCM Base address\n");
426427

427-
if (CONFIG_ARC_DCCM_SZ != cpu->dccm.sz)
428+
if (CONFIG_ARC_DCCM_SZ * SZ_1K != cpu->dccm.sz)
428429
panic("Linux built with incorrect DCCM Size\n");
429430
#endif
430431

431432
#ifdef CONFIG_ARC_HAS_ICCM
432-
if (CONFIG_ARC_ICCM_SZ != cpu->iccm.sz)
433+
if (CONFIG_ARC_ICCM_SZ * SZ_1K != cpu->iccm.sz)
433434
panic("Linux built with incorrect ICCM Size\n");
434435
#endif
435436

0 commit comments

Comments
 (0)