Revert "Xtensa SMP: Avoid a nasty situation in SMP by assuring that up_release_pending() is not re-entered."

This reverts commit 733a57b4df.
This commit is contained in:
Gregory Nutt
2016-12-25 07:12:46 -06:00
parent 49fae0ac6b
commit b87fc91466
2 changed files with 57 additions and 84 deletions
-6
View File
@@ -229,9 +229,6 @@ int up_cpu_pause(int cpu)
* handler from returning until up_cpu_resume() is called; g_cpu_paused
* is a handshake that will prefent this function from returning until
* the CPU is actually paused.
*
* REVISIT: OR should there be logic to just skip this if the other CPU
* is already paused.
*/
DEBUGASSERT(!spin_islocked(&g_cpu_wait[cpu]) &&
@@ -300,9 +297,6 @@ int up_cpu_resume(int cpu)
/* Release the spinlock. Releasing the spinlock will cause the SGI2
* handler on 'cpu' to continue and return from interrupt to the newly
* established thread.
*
* REVISIT: Should there be a more positive handshake to assure that the
* resumption is complete before returning.
*/
DEBUGASSERT(spin_islocked(&g_cpu_wait[cpu]) &&
@@ -39,7 +39,6 @@
#include <nuttx/config.h>
#include <stdbool.h>
#include <sched.h>
#include <debug.h>
@@ -69,24 +68,9 @@
void up_release_pending(void)
{
struct tcb_s *rtcb = this_task();
#ifdef CONFIG_SMP
static bool busy = false;
#endif
sinfo("From TCB=%p\n", rtcb);
/* In SMP configurations, this function will be called as part of leaving
* the critical section. In that case, it may be re-entered as part of
* the sched_addreadytorun() processing. We have to guard against that
* case.
*/
#ifdef CONFIG_SMP
if (!busy)
{
busy = true;
#endif
/* Merge the g_pendingtasks list into the ready-to-run task list */
/* sched_lock(); */
@@ -172,9 +156,4 @@ void up_release_pending(void)
xtensa_context_restore(rtcb->xcp.regs);
}
}
#ifdef CONFIG_SMP
busy = false;
}
#endif
}