aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/sysdev/uic.c
diff options
context:
space:
mode:
authorValentine Barshak <vbarshak@ru.mvista.com>2007-11-13 15:25:21 -0500
committerJosh Boyer <jwboyer@linux.vnet.ibm.com>2007-11-19 09:22:03 -0500
commitb8b799a497e4a4bfd5fca8abc526e908b26c71e8 (patch)
tree82ed79a7ba809a3fde7fb8f0a57efcd50af27e13 /arch/powerpc/sysdev/uic.c
parent2ae24c521a9793e36b1a2311fa64915c2e7b1b7b (diff)
[POWERPC] 4xx: UIC add mask_ack callback
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> Acked-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
Diffstat (limited to 'arch/powerpc/sysdev/uic.c')
-rw-r--r--arch/powerpc/sysdev/uic.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/arch/powerpc/sysdev/uic.c b/arch/powerpc/sysdev/uic.c
index 5149716c734d..847a5496b869 100644
--- a/arch/powerpc/sysdev/uic.c
+++ b/arch/powerpc/sysdev/uic.c
@@ -97,6 +97,22 @@ static void uic_ack_irq(unsigned int virq)
97 spin_unlock_irqrestore(&uic->lock, flags); 97 spin_unlock_irqrestore(&uic->lock, flags);
98} 98}
99 99
100static void uic_mask_ack_irq(unsigned int virq)
101{
102 struct uic *uic = get_irq_chip_data(virq);
103 unsigned int src = uic_irq_to_hw(virq);
104 unsigned long flags;
105 u32 er, sr;
106
107 sr = 1 << (31-src);
108 spin_lock_irqsave(&uic->lock, flags);
109 er = mfdcr(uic->dcrbase + UIC_ER);
110 er &= ~sr;
111 mtdcr(uic->dcrbase + UIC_ER, er);
112 mtdcr(uic->dcrbase + UIC_SR, sr);
113 spin_unlock_irqrestore(&uic->lock, flags);
114}
115
100static int uic_set_irq_type(unsigned int virq, unsigned int flow_type) 116static int uic_set_irq_type(unsigned int virq, unsigned int flow_type)
101{ 117{
102 struct uic *uic = get_irq_chip_data(virq); 118 struct uic *uic = get_irq_chip_data(virq);
@@ -152,7 +168,7 @@ static struct irq_chip uic_irq_chip = {
152 .typename = " UIC ", 168 .typename = " UIC ",
153 .unmask = uic_unmask_irq, 169 .unmask = uic_unmask_irq,
154 .mask = uic_mask_irq, 170 .mask = uic_mask_irq,
155/* .mask_ack = uic_mask_irq_and_ack, */ 171 .mask_ack = uic_mask_ack_irq,
156 .ack = uic_ack_irq, 172 .ack = uic_ack_irq,
157 .set_type = uic_set_irq_type, 173 .set_type = uic_set_irq_type,
158}; 174};