]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
powerpc/cpm2: Fix set interrupt type
authorpaulfax <paulfax@conspiracy.net>
Tue, 27 Jan 2009 08:44:07 +0000 (02:44 -0600)
committerKumar Gala <galak@kernel.crashing.org>
Fri, 6 Feb 2009 16:44:02 +0000 (10:44 -0600)
This is a simple change to correct problems when using set_irq_type
on platforms using CPM2.  This code corrects the problem on most platform
but may have issues on 8272 derived platforms for some interrupts.

On 8272 PC2 & 3 are missing and PC 23 & 29 are added, which this patch
does not address.

Signed-off-by: Paul Bilke <paul@conspiracy.net>
Reviewed-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
arch/powerpc/sysdev/cpm2_pic.c

index b16ca3ed65d25bbee94aaeb82809c6810e60db97..78f1f7cca0a017ba6ee17d83065ba1544f0dbb71 100644 (file)
@@ -165,7 +165,7 @@ static int cpm2_set_irq_type(unsigned int virq, unsigned int flow_type)
                        edibit = (14 - (src - CPM2_IRQ_EXT1));
        else
                if (src >= CPM2_IRQ_PORTC15 && src <= CPM2_IRQ_PORTC0)
-                       edibit = (31 - (src - CPM2_IRQ_PORTC15));
+                       edibit = (31 - (CPM2_IRQ_PORTC0 - src));
                else
                        return (flow_type & IRQ_TYPE_LEVEL_LOW) ? 0 : -EINVAL;