arch/risc-v: Add missing DMB to mtimer / setmtimecmp

The memory mapped mtimecmp lives in I/O space so must add barrier
to make sure the value sticks. Otherwise a new IRQ might fire
at once.
This commit is contained in:
Ville Juven 2022-04-12 13:38:59 +03:00 committed by Xiang Xiao
parent c843cb8a52
commit 48fa6c1280

View File

@ -25,6 +25,8 @@
#include <nuttx/irq.h>
#include <nuttx/kmalloc.h>
#include <arch/barriers.h>
#include "riscv_mtimer.h"
#include "riscv_internal.h"
@ -107,6 +109,10 @@ static void riscv_mtimer_set_mtimecmp(struct riscv_mtimer_lowerhalf_s *priv,
putreg32(value, priv->mtimecmp);
putreg32(value >> 32, priv->mtimecmp + 4);
#endif
/* Make sure it sticks */
__DMB();
}
/****************************************************************************