Port-arm archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: pic/arm lost blocked irqs



On Mon, Aug 30, 2010 at 7:30 AM, KIYOHARA Takashi
<kiyohara%kk.iij4u.or.jp@localhost> wrote:
> Hi! all,
>
>
> My Overo board happen hangup. ÂThis reason is lost blocked irqs
> in pic/arm/pic.c:pic_deliver_irqs().
>
> Â Â Â Â Â Â Â Âblocked_irqs = pending_irqs;
> Â Â Â Â Â Â Â Âdo {
>
> Â Â Â Â Â Â Â Â:
> Â Â Â Â Â Â Â Â Â Â Â Âif (is != NULL) {
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Âcpsie(I32_bit);
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Âpic_dispatch(is, frame);
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Âcpsid(I32_bit);
> Â Â Â Â Â Â Â Â Â Â Â Â} else {
> Â Â Â Â Â Â Â Â:
> Â Â Â Â Â Â Â Â Â Â Â Âpending_irqs = pic_find_pending_irqs_by_ipl(pic,
> Â Â Â Â Â Â Â Â Â Â Â Â Â Âirq_base, *ipending, ipl);
> Â Â Â Â Â Â Â Â} while (pending_irqs);
> Â Â Â Â Â Â Â Âif (blocked_irqs) {
> Â Â Â Â Â Â Â Â Â Â Â Âatomic_or_32(iblocked, blocked_irqs);
> Â Â Â Â Â Â Â Â Â Â Â Âatomic_or_32(&pic_blocked_pics, __BIT(pic->pic_id));
> Â Â Â Â Â Â Â Â}
>
> arm/pic accepts other interrupt while executing pic_dispatch() and
> interrupt-handler.
> And, the interrupt newly generated is masked, and remarked ipending.
>
> The interrupt of same ipl that ipending is done is processed by this
> loop. ÂHowever, because blocked_irqs is not changed in the loop.
> Therefor some masked interrupts forgot unmask.
>
>
> Index: pic.c
> ===================================================================
> RCS file: /cvsroot/src/sys/arch/arm/pic/pic.c,v
> retrieving revision 1.4
> diff -u -r1.4 pic.c
> --- pic.c    30 Dec 2008 05:43:14 -0000   Â1.4
> +++ pic.c    29 Aug 2010 14:30:39 -0000
> @@ -229,7 +229,7 @@
> Â#endif
> Â Â Â Â Â Â Â Â}
> Â Â Â Â Â Â Â Âprogress = true;
> - Â Â Â Â Â Â Â blocked_irqs = pending_irqs;
> + Â Â Â Â Â Â Â blocked_irqs = 0;
> Â Â Â Â Â Â Â Âdo {
> Â Â Â Â Â Â Â Â Â Â Â Âirq = ffs(pending_irqs) - 1;
> Â Â Â Â Â Â Â Â Â Â Â ÂKASSERT(irq >= 0);
> @@ -240,9 +240,9 @@
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Âcpsie(I32_bit);
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Âpic_dispatch(is, frame);
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Âcpsid(I32_bit);
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â blocked_irqs |= __BIT(irq);
> Â Â Â Â Â Â Â Â Â Â Â Â} else {
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â ÂKASSERT(0);
> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â blocked_irqs &= ~__BIT(irq);
> Â Â Â Â Â Â Â Â Â Â Â Â}
> Â Â Â Â Â Â Â Â Â Â Â Âpending_irqs = pic_find_pending_irqs_by_ipl(pic,
> Â Â Â Â Â Â Â Â Â Â Â Â Â Âirq_base, *ipending, ipl);
>
>
> Is my understanding wrong?
> Thanks,
> --
> kiyohara
>

i saw hangups in interrupt handling too with the dm9000 driver
i have tried to port. maybe it wasnt my mistake then?

-- 
NetBSD - Simplicity is prerequisite for reliability


Home | Main Index | Thread Index | Old Index