Skip to contentSkip to conversation

irqchip: atmel-aic-common: prevent clobbering of priority when changing IRQ type

PATCH New Nicolas Ferre 2 participants 3 messages Jan 7, 2015 2 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw

PATCH 1/1 irqchip: atmel-aic-common: prevent clobbering of priority when changing IRQ type

Le 07/01/2015 04:09, Jason Cooper a ?crit :

Quoted 10 lines

atmel maintainers,

Quoted 7 lines · gavinli at thegavinli.com

From: Gavin Li <[email protected]>

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.

Quoted 7 lines
Quoted 4 lines
---
 drivers/irqchip/irq-atmel-aic-common.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Please give an Acked-by if this looks good to you. I'd like to get it pushed fairly soon.

Hi Jason,

After a private message with Boris, here is our:

It is indeed a pretty important fix.

(I added the linux-arm-kernel mailing-list for the record).

Moreover, can you please add a stable tag like:
Cc: <[email protected]> # 3.17+

Thanks a lot Gavin Li for having spotted this bug!

Bye,

Quoted 26 lines
Quoted 25 lines
drivers/irqchip/irq-atmel-aic-common.c +2 -2
index cc4f9d8..fa22e5b 100644
@@ -28,7 +28,7 @@
 #define AT91_AIC_IRQ_MIN_PRIORITY	0
 #define AT91_AIC_IRQ_MAX_PRIORITY	7
 
-#define AT91_AIC_SRCTYPE		GENMASK(7, 6)
+#define AT91_AIC_SRCTYPE		GENMASK(6, 5)
 #define AT91_AIC_SRCTYPE_LOW		(0 << 5)
 #define AT91_AIC_SRCTYPE_FALLING	(1 << 5)
 #define AT91_AIC_SRCTYPE_HIGH		(2 << 5)
@@ -74,7 +74,7 @@ int aic_common_set_type(struct irq_data *d, unsigned type, unsigned *val)
 		return -EINVAL;
 	}
 
-	*val &= AT91_AIC_SRCTYPE;
+	*val &= ~AT91_AIC_SRCTYPE;
 	*val |= aic_type;
 
 	return 0;
Signature · 1 line
2.2.1
Signature · 1 line
Nicolas Ferre
#3 lore raw

PATCH 1/1 irqchip: atmel-aic-common: prevent clobbering of priority when changing IRQ type

Quoted 21 lines · Nicolas Ferre

Le 07/01/2015 04:09, Jason Cooper a ?crit :

Quoted 10 lines

atmel maintainers,

Quoted 7 lines · gavinli at thegavinli.com

From: Gavin Li <[email protected]>

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.

Quoted 7 lines
Quoted 4 lines
---
 drivers/irqchip/irq-atmel-aic-common.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Please give an Acked-by if this looks good to you. I'd like to get it pushed fairly soon.

Hi Jason,

Quoted 7 lines

After a private message with Boris, here is our:

It is indeed a pretty important fix.

(I added the linux-arm-kernel mailing-list for the record).

:) oops. I completely missed that it was originally (and this version) off-list. Gavin, in the future, please include the mailinglist when sending.

Quoted 2 lines

Moreover, can you please add a stable tag like:
Cc: <[email protected]> # 3.17+

Will do.

thx,

Jason.

Applied
#4 lore raw
In reply to a message not in the archive

Gavin,

Quoted 11 lines · gavinli at thegavinli.com

From: Gavin Li <[email protected]>

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.

---
 drivers/irqchip/irq-atmel-aic-common.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Well done. For a first patch this is really good. The only thing you missed was who/which MLs to Cc. In the future, you can use ./scripts/get_maintainer.pl to find this info.

Applied to irqchip/urgent with Acks from the atmel maintainers and Cc'd to stable for v3.17+

This will be in linux-next tonight if Stephen builds one.

thx,

Jason.