Commit 449af2873ea16ef0da68bf64dcef78048d4427d1
Committed by
Greg Kroah-Hartman
1 parent
24f1a316c4
irqchip: atmel-aic-common: Prevent clobbering of priority when changing IRQ type
commit 91d1179212161f220938198b742c328ad38fd0a3 upstream. This patch makes the bitmask for AIC_SRCTYPE consistent with that of its valid values, and prevents the priority field at bits 2:0 from being clobbered by an incorrect AND with the AIC_SRCTYPE mask. Signed-off-by: Gavin Li <gavinli@thegavinli.com> Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com> Link: https://lkml.kernel.org/r/1420598843-8409-1-git-send-email-gavinli@thegavinli.com Signed-off-by: Jason Cooper <jason@lakedaemon.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Showing 1 changed file with 2 additions and 2 deletions Side-by-side Diff
drivers/irqchip/irq-atmel-aic-common.c
... | ... | @@ -28,7 +28,7 @@ |
28 | 28 | #define AT91_AIC_IRQ_MIN_PRIORITY 0 |
29 | 29 | #define AT91_AIC_IRQ_MAX_PRIORITY 7 |
30 | 30 | |
31 | -#define AT91_AIC_SRCTYPE GENMASK(7, 6) | |
31 | +#define AT91_AIC_SRCTYPE GENMASK(6, 5) | |
32 | 32 | #define AT91_AIC_SRCTYPE_LOW (0 << 5) |
33 | 33 | #define AT91_AIC_SRCTYPE_FALLING (1 << 5) |
34 | 34 | #define AT91_AIC_SRCTYPE_HIGH (2 << 5) |
... | ... | @@ -74,7 +74,7 @@ |
74 | 74 | return -EINVAL; |
75 | 75 | } |
76 | 76 | |
77 | - *val &= AT91_AIC_SRCTYPE; | |
77 | + *val &= ~AT91_AIC_SRCTYPE; | |
78 | 78 | *val |= aic_type; |
79 | 79 | |
80 | 80 | return 0; |