From: do <dosilasolfamiredo@o2.pl>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] Re: Bogus External Interrupt
Date: Tue, 07 Mar 2006 21:26:01 +0100 [thread overview]
Message-ID: <dukq8o$rb8$1@sea.gmane.org> (raw)
In-Reply-To: <44085CFF.2030200@smiths-aerospace.com>
Jerry Van Baren napisa?(a):
> 2) (Likely your problem): The ISR cleared the interrupt improperly so
> that the processor (re)latched the interrupt that was cleared. When you
> exit the ISR, the processor has a pending interrupt so it re-enters the
> ISR, but doesn't find anything to do. Typically this is caused by
> clearing the processor side of the interrupt and _then_ clearing the
> source. You should clear the source _first_ and then the processor (or,
> for a multi-level interrupt, clear from the furthest out inward).
>
> This should be a non-fatal error, but should be understood and fixed.
>
I think that the procesor relatched the interrupt that was cleared by
the m8260_mask_and_ack(irq) procedure in external_interrupt servicing
function. Thank you for your suggestions.
One of the solutions can be splitting this procedure in two, for
example: m8260_mask_irq(irq) and m8260_ack_irq(irq). The first can be
used for masking interrupt before ISR (mask register usage), and second
for ack after ISR (pending interrupt register usage), when the reason of
interrupt is cleared. There can be also enabled other interrupts for
multi-level.
Best regards!
PS. I hope that the following patch (although not perfect) can be
helpful for others:
diff -uNr u-boot-org/cpu/mpc8260/interrupts.c
u-boot/cpu/mpc8260/interrupts.c
--- u-boot-org/cpu/mpc8260/interrupts.c 2006-01-25 23:13:34.000000000 +0100
+++ u-boot/cpu/mpc8260/interrupts.c 2006-03-06 11:35:53.000000000 +0100
@@ -92,6 +92,20 @@
simr[word] = ppc_cached_irq_mask[word];
}
+static void m8260_ack_irq (unsigned int irq_nr)
+{
+ volatile immap_t *immr = (immap_t *) CFG_IMMR;
+ int bit, word;
+ volatile uint *sipnr;
+
+ bit = irq_to_siubit[irq_nr];
+ word = irq_to_siureg[irq_nr];
+
+ sipnr = &(immr->im_intctl.ic_sipnrh);
+ sipnr[word] = 1 << (31 - bit);
+}
+
+
static void m8260_unmask_irq (unsigned int irq_nr)
{
volatile immap_t *immr = (immap_t *) CFG_IMMR;
@@ -180,10 +194,8 @@
irq = m8260_get_irq (regs);
- m8260_mask_and_ack (irq);
-
- enable_interrupts ();
-
+ m8260_mask_irq(irq); /* enable_interrupts(); */ /* for multi-level*/
+
if (irq_handlers[irq].handler != NULL)
(*irq_handlers[irq].handler) (irq_handlers[irq].arg);
else {
@@ -194,7 +206,11 @@
*/
unmask = 0;
}
-
+
+ m8260_ack_irq(irq);
+
+
if (unmask)
m8260_unmask_irq (irq);
}
prev parent reply other threads:[~2006-03-07 20:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-02 22:07 [U-Boot-Users] Bogus External Interrupt do
2006-03-03 15:13 ` Jerry Van Baren
2006-03-07 20:26 ` do [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='dukq8o$rb8$1@sea.gmane.org' \
--to=dosilasolfamiredo@o2.pl \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox