You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ma...@apache.org on 2022/04/11 22:55:09 UTC

[incubator-nuttx] 03/08: arch: cxd56xx: Fix critical section in scu driver

This is an automated email from the ASF dual-hosted git repository.

masayuki pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 39f7c4aea0d32c0d95a30b69c8cafda2e1f700a6
Author: SPRESENSE <41...@users.noreply.github.com>
AuthorDate: Mon Apr 11 19:05:59 2022 +0900

    arch: cxd56xx: Fix critical section in scu driver
    
    Add critical section to scu one-shot sequencer.
---
 arch/arm/src/cxd56xx/cxd56_scu.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/arm/src/cxd56xx/cxd56_scu.c b/arch/arm/src/cxd56xx/cxd56_scu.c
index f84e7a4cb0..dd605b2ae3 100644
--- a/arch/arm/src/cxd56xx/cxd56_scu.c
+++ b/arch/arm/src/cxd56xx/cxd56_scu.c
@@ -939,8 +939,11 @@ static void seq_setstartphase(int sid, int phase)
 static void seq_startseq(int sid)
 {
   uint32_t val;
+  irqstate_t flags;
+  flags = enter_critical_section();
   val = getreg32(SCU_START_MODE0);
   putreg32(val | (1 << sid), SCU_START_MODE0);
+  leave_critical_section(flags);
 }
 
 /****************************************************************************
@@ -957,8 +960,11 @@ static void seq_startseq(int sid)
 static void seq_stopseq(int sid)
 {
   uint32_t val;
+  irqstate_t flags;
+  flags = enter_critical_section();
   val = getreg32(SCU_START_MODE0);
   putreg32(val & ~(1 << sid), SCU_START_MODE0);
+  leave_critical_section(flags);
 }
 
 /****************************************************************************