Skip to content

CCM size checks in arch/arc/kernel/setup.c fail due to incorrect units #18

@pmgreco

Description

@pmgreco

In the file arch/arc/kernel/setup.c the CCM size checks are incorrectly using mismatched units (KiB checked against bytes), and will always fail. The CONFIG_ARC_DCCM_SZ and CONFIG_ARC_ICCM_SZ are in KiB (indicated by both defaults and comments in Kconfig, and well as used in vmlinux.lds.S), but setup uses units of bytes for cpu->dccm.sz and cpu->iccm.sz.

Seems like the correct fix is to add TO_KB() to the size checks, as follows:

if (CONFIG_ARC_DCCM_SZ != TO_KB(cpu->dccm.sz))
	panic("Linux built with incorrect DCCM Size\n");

#endif

#ifdef CONFIG_ARC_HAS_ICCM
if (CONFIG_ARC_ICCM_SZ != TO_KB(cpu->iccm.sz))
panic("Linux built with incorrect ICCM Size\n");
#endif

Can one of your developers who support ARC for Linux make and submit the appropriate patch(es) to mainline kernel(s)?

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions