Skip to content

Commit

Permalink
arch: lc823450: Fix the pause handler for SMP
Browse files Browse the repository at this point in the history
Summary:
- Apply the same logic added to cxd56_cpupause.c

Impact:
- SMP only

Testing:
- Tested with lc823450-xgevk:rndis
- Run smp and ostest

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
  • Loading branch information
masayuki2009 authored and xiaoxiang781216 committed Nov 20, 2020
1 parent 1978dcc commit 42dea9e
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions arch/arm/src/lc823450/lc823450_cpupause.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ int up_cpu_paused(int cpu)
int lc823450_pause_handler(int irq, void *c, FAR void *arg)
{
int cpu = up_cpu_index();
int ret = OK;

/* Clear : Pause IRQ */

Expand All @@ -211,10 +212,21 @@ int lc823450_pause_handler(int irq, void *c, FAR void *arg)

if (spin_islocked(&g_cpu_paused[cpu]))
{
return up_cpu_paused(cpu);
/* NOTE: up_cpu_paused() needs to be executed in a critical section
* to ensure that this CPU holds g_cpu_irqlock. However, adding
* a critical section in up_cpu_paused() is not a good idea,
* because it is also called in enter_critical_section() to break
* a deadlock
*/

irqstate_t flags = enter_critical_section();

ret = up_cpu_paused(cpu);

leave_critical_section(flags);
}

return OK;
return ret;
}

/****************************************************************************
Expand Down

0 comments on commit 42dea9e

Please sign in to comment.