You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by bt...@apache.org on 2020/10/17 08:24:42 UTC

[incubator-nuttx] 02/02: arch: cxd56xx: Fix IRQ request handling in cxd56_cpupause.c

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

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

commit 9e6a40d305f87e09b247e6c9d865812e274082c0
Author: Masayuki Ishikawa <ma...@gmail.com>
AuthorDate: Thu Oct 8 12:54:32 2020 +0900

    arch: cxd56xx: Fix IRQ request handling in cxd56_cpupause.c
    
    Summary:
    - During Wi-Fi audio streaming test, I noticed data corruption in tcb
    - Finally, I found an issue in IRQ request handing with IPI
    - This commit fixes this issue
    
    Impact:
    - Affects SMP only
    
    Testing:
    - Tested with spresense:wifi_smp
    
    Signed-off-by: Masayuki Ishikawa <Ma...@jp.sony.com>
---
 arch/arm/src/cxd56xx/cxd56_cpupause.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/arch/arm/src/cxd56xx/cxd56_cpupause.c b/arch/arm/src/cxd56xx/cxd56_cpupause.c
index 89b296b..c8bd410 100644
--- a/arch/arm/src/cxd56xx/cxd56_cpupause.c
+++ b/arch/arm/src/cxd56xx/cxd56_cpupause.c
@@ -210,6 +210,13 @@ bool up_cpu_pausereq(int cpu)
 
 int up_cpu_paused(int cpu)
 {
+  /* Fistly, check if this IPI is to enable/disable IRQ */
+
+  if (handle_irqreq(cpu))
+    {
+      return OK;
+    }
+
   FAR struct tcb_s *tcb = this_task();
 
   /* Update scheduler parameters */
@@ -283,13 +290,6 @@ int arm_pause_handler(int irq, void *c, FAR void *arg)
 
   putreg32(0, CXD56_CPU_P2_INT + (4 * cpu));
 
-  /* Check if this IPI is to enable/disable IRQ */
-
-  if (handle_irqreq(cpu))
-    {
-      return OK;
-    }
-
   /* Check for false alarms.  Such false could occur as a consequence of
    * some deadlock breaking logic that might have already serviced the SG2
    * interrupt by calling up_cpu_paused.