From: Valentine Barshak <vbarshak@ru•mvista.com>
To: linuxppc-dev@ozlabs•org
Cc: dwg@au1•ibm.com
Subject: [PATCH 1/2] PowerPC: 4xx uic: add mask_ack callback
Date: Tue, 13 Nov 2007 23:25:21 +0300 [thread overview]
Message-ID: <20071113202521.GA26295@ru.mvista.com> (raw)
In-Reply-To: <20071113201559.GA26172@ru.mvista.com>
This adds uic_mask_ack_irq() callback to PowerPC 4xx uic code
to avoid kernel crash. It is used for edge-triggered interrupts
by handle_uic_irq().
Signed-off-by: Valentine Barshak <vbarshak@ru•mvista.com>
---
arch/powerpc/sysdev/uic.c | 18 +++++++++++++++++-
1 files changed, 17 insertions(+), 1 deletion(-)
--- linux-2.6.orig/arch/powerpc/sysdev/uic.c 2007-11-13 18:42:33.000000000 +0300
+++ linux-2.6/arch/powerpc/sysdev/uic.c 2007-11-13 22:28:01.000000000 +0300
@@ -97,6 +97,22 @@ static void uic_ack_irq(unsigned int vir
spin_unlock_irqrestore(&uic->lock, flags);
}
+static void uic_mask_ack_irq(unsigned int virq)
+{
+ struct uic *uic = get_irq_chip_data(virq);
+ unsigned int src = uic_irq_to_hw(virq);
+ unsigned long flags;
+ u32 er, sr;
+
+ sr = 1 << (31-src);
+ spin_lock_irqsave(&uic->lock, flags);
+ er = mfdcr(uic->dcrbase + UIC_ER);
+ er &= ~sr;
+ mtdcr(uic->dcrbase + UIC_ER, er);
+ mtdcr(uic->dcrbase + UIC_SR, sr);
+ spin_unlock_irqrestore(&uic->lock, flags);
+}
+
static int uic_set_irq_type(unsigned int virq, unsigned int flow_type)
{
struct uic *uic = get_irq_chip_data(virq);
@@ -152,7 +168,7 @@ static struct irq_chip uic_irq_chip = {
.typename = " UIC ",
.unmask = uic_unmask_irq,
.mask = uic_mask_irq,
-/* .mask_ack = uic_mask_irq_and_ack, */
+ .mask_ack = uic_mask_ack_irq,
.ack = uic_ack_irq,
.set_type = uic_set_irq_type,
};
next prev parent reply other threads:[~2007-11-13 20:29 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-13 20:15 [PATCH 0/2] PowerPC: 4xx uic updates Valentine Barshak
2007-11-13 20:25 ` Valentine Barshak [this message]
2007-11-14 0:57 ` [PATCH 1/2] PowerPC: 4xx uic: add mask_ack callback David Gibson
2007-11-13 20:27 ` [PATCH 2/2] PowerPC: make 4xx uic use generic edge and level irq handlers Valentine Barshak
2007-11-14 2:13 ` David Gibson
2007-11-14 3:43 ` Benjamin Herrenschmidt
2007-11-14 12:31 ` Valentine Barshak
2007-11-14 14:00 ` [PATCH 2/2] PowerPC: make 4xx uic use generic level irq handler Valentine Barshak
2007-11-14 2:05 ` [PATCH 0/2] PowerPC: 4xx uic updates Josh Boyer
2007-11-14 2:14 ` David Gibson
2007-11-14 3:40 ` Benjamin Herrenschmidt
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=20071113202521.GA26295@ru.mvista.com \
--to=vbarshak@ru$(echo .)mvista.com \
--cc=dwg@au1$(echo .)ibm.com \
--cc=linuxppc-dev@ozlabs$(echo .)org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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