[PIC/FIXUP] pirq reinit fail

don't reinit pirq's list if cascade

Signed-off-by: GuEe-GUI <2991707448@qq.com>
This commit is contained in:
GuEe-GUI 2024-09-11 12:54:03 +08:00 committed by Rbb666
parent 2a8aba4c8b
commit 584f4b869d
1 changed files with 13 additions and 4 deletions

View File

@ -177,15 +177,24 @@ static void config_pirq(struct rt_pic *pic, struct rt_pic_irq *pirq, int irq, in
{ {
rt_ubase_t level = rt_spin_lock_irqsave(&pirq->rw_lock); rt_ubase_t level = rt_spin_lock_irqsave(&pirq->rw_lock);
if (pirq->irq < 0)
{
rt_list_init(&pirq->list);
rt_list_init(&pirq->children_nodes);
rt_list_init(&pirq->isr.list);
}
else if (pirq->pic != pic)
{
RT_ASSERT(rt_list_isempty(&pirq->list) == RT_TRUE);
RT_ASSERT(rt_list_isempty(&pirq->children_nodes) == RT_TRUE);
RT_ASSERT(rt_list_isempty(&pirq->isr.list) == RT_TRUE);
}
pirq->irq = irq; pirq->irq = irq;
pirq->hwirq = hwirq; pirq->hwirq = hwirq;
pirq->pic = pic; pirq->pic = pic;
rt_list_init(&pirq->list);
rt_list_init(&pirq->children_nodes);
rt_list_init(&pirq->isr.list);
rt_spin_unlock_irqrestore(&pirq->rw_lock, level); rt_spin_unlock_irqrestore(&pirq->rw_lock, level);
} }