Skip to content

Commit ea3a47e

Browse files
dcpleungnashif
authored andcommitted
soc: intel_adsp/hda: fix range checking
intel_adsp_hda_set_buffer() asserts when the HDA buffer is outside of RAM space. However, it uses CONFIG_SRAM_SIZE as if it is bytes. In reality, CONFIG_SRAM_SIZE is in KB so we need to multiply it by 1024, or simply use marco KB(). Fixes #74250 Signed-off-by: Daniel Leung <[email protected]>
1 parent c1a462e commit ea3a47e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

soc/intel/intel_adsp/common/include/intel_adsp_hda.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include <zephyr/cache.h>
99
#include <zephyr/kernel.h>
1010
#include <zephyr/device.h>
11+
#include <zephyr/sys/util.h>
1112
#include <adsp_shim.h>
1213
#include <adsp_memory.h>
1314
#include <adsp_shim.h>
@@ -172,7 +173,7 @@ static inline int intel_adsp_hda_set_buffer(uint32_t base,
172173
# define _INTEL_ADSP_SIZE CONFIG_KERNEL_VM_SIZE
173174
#else
174175
# define _INTEL_ADSP_BASE CONFIG_SRAM_BASE_ADDRESS
175-
# define _INTEL_ADSP_SIZE CONFIG_SRAM_SIZE
176+
# define _INTEL_ADSP_SIZE KB(CONFIG_SRAM_SIZE)
176177
#endif
177178

178179
__ASSERT(aligned_addr >= _INTEL_ADSP_BASE

0 commit comments

Comments
 (0)