Update some comments
This commit is contained in:
parent
7dbc25b02b
commit
7bec4ffeec
@ -112,31 +112,32 @@ static inline void irq_waitlock(int cpu)
|
|||||||
|
|
||||||
while (up_testset(&g_cpu_irqlock) == SP_LOCKED)
|
while (up_testset(&g_cpu_irqlock) == SP_LOCKED)
|
||||||
{
|
{
|
||||||
/* The deadlock condition would occur if CPUn:
|
/* A deadlock condition would occur if CPUn:
|
||||||
*
|
*
|
||||||
* 1. Holds the g_cpu_irqlock, and
|
* 1. Holds the g_cpu_irqlock, and
|
||||||
* 2. Is trying to interrupt CPUm
|
* 2. Is trying to interrupt CPUm, but
|
||||||
|
* 3. CPUm is spinning trying acquaire the g_cpu_irqlock.
|
||||||
*
|
*
|
||||||
* The protocol for CPUn to pause CPUm is as follows
|
* The protocol for CPUn to pause CPUm is as follows
|
||||||
*
|
*
|
||||||
* 1. The up_cpu_pause() implementation on CPUn locks both
|
* 1. The up_cpu_pause() implementation on CPUn locks both
|
||||||
* g_cpu_wait[m] and g_cpu_paused[m]. CPUn then waits
|
* g_cpu_wait[m] and g_cpu_paused[m]. CPUn then waits
|
||||||
* spinning on g_cpu_wait[m].
|
* spinning on g_cpu_wait[m].
|
||||||
* 2. When CPUm receives the interrupt it (1) unlocks
|
* 2. When CPUm receives the interrupt it (1) unlocks
|
||||||
* g_cpu_paused[m] and (2) locks g_cpu_wait[m]. The
|
* g_cpu_paused[m] and (2) locks g_cpu_wait[m]. The
|
||||||
* first unblocks CPUn and the second blocks CPUm in the
|
* first unblocks CPUn and the second blocks CPUm in the
|
||||||
* interrupt handler.
|
* interrupt handler.
|
||||||
*
|
*
|
||||||
* The problem in the deadlock case is that CPUm cannot receive
|
* The problem in the deadlock case is that CPUm cannot receive
|
||||||
* the interrupt because it is locked up spinning. He we break
|
* the interrupt because it is locked up spinning. Here we break
|
||||||
* the deadlock here be handling the pause interrupt request
|
* the deadlock here be handling the pause interrupt request
|
||||||
* while waiting.
|
* while waiting.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (up_cpu_pausereq(cpu))
|
if (up_cpu_pausereq(cpu))
|
||||||
{
|
{
|
||||||
/* Yes.. some CPU is requesting to pause us! Handle the
|
/* Yes.. some other CPU is requesting to pause this CPU! Handle
|
||||||
* pause interrupt now.
|
* the pause interrupt now.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
DEBUGVERIFY(up_cpu_paused(cpu));
|
DEBUGVERIFY(up_cpu_paused(cpu));
|
||||||
|
Loading…
Reference in New Issue
Block a user