From 3e3c23e042017eae98774549356e4127dee0a82f Mon Sep 17 00:00:00 2001 From: "Luis R. Rodriguez" Date: Fri, 20 Jul 2012 12:23:52 -0700 Subject: [PATCH] compat: backport irq_set_status_flags() and irq_clear_status_flags() This further backports this patch: commit 442471848f5abb55b99cba1229301655f67492b4 Author: Thomas Gleixner Date: Tue Sep 28 10:40:18 2010 +0200 genirq: Provide status modifier Provide a irq_desc.status modifier function to cleanup the direct access to irq_desc in arch and driver code. Signed-off-by: Thomas Gleixner Reviewed-by: Ingo Molnar The reason is that although irq_modify_status() was backported the commit ee9c8a: commit ee9c8a04666ba15762f736f9030e6e8df02ca1a5 Author: Grazvydas Ignotas Date: Fri May 18 03:04:08 2012 +0300 wl1251: fix oops on early interrupt commit f380f2c4a12e913356bd49f8790ec1063c4fe9f8 upstream. This driver disables interrupt just after requesting it and enables it later, after interface is up. However currently there is a time window between request_irq() and disable_irq() where if interrupt arrives, the driver oopses because it's not yet ready to process it. This can be reproduced by inserting the module, associating and removing the module multiple times. Eliminate this race by setting IRQF_NOAUTOEN flag before request_irq(). Signed-off-by: Grazvydas Ignotas Signed-off-by: John W. Linville Signed-off-by: Greg Kroah-Hartman was backported and merged into v3.4.6 therefore requiring these set of calls onto older kernels as well. This should be merged into the compat linux-3.4.y branch so that a respective compat-wireless based on v3.4.6 can be made. mcgrof@tux ~/compat (git::master)$ ckmake -t Trying kernel 3.4.0-030400rc1-generic [OK] Trying kernel 3.3.7-030307-generic [OK] Trying kernel 3.2.2-030202-generic [OK] Trying kernel 3.1.10-030110-generic [OK] Trying kernel 3.0.18-030018-generic [OK] Trying kernel 2.6.39-02063904-generic [OK] Trying kernel 2.6.38-02063808-generic [OK] Trying kernel 2.6.37-02063706-generic [OK] Trying kernel 2.6.36-02063604-generic [OK] Trying kernel 2.6.35-02063512-generic [OK] Trying kernel 2.6.34-02063410-generic [OK] Trying kernel 2.6.33-02063305-generic [OK] Trying kernel 2.6.32-02063255-generic [OK] Trying kernel 2.6.31-02063113-generic [OK] Trying kernel 2.6.30-02063010-generic [OK] Trying kernel 2.6.29-02062906-generic [OK] Trying kernel 2.6.28-02062810-generic [OK] Trying kernel 2.6.27-020627-generic [OK] Trying kernel 2.6.26-020626-generic [OK] Trying kernel 2.6.25-020625-generic [OK] Trying kernel 2.6.24-020624-generic [OK] real 2m28.330s user 4m28.170s sys 0m47.580s Signed-off-by: Luis R. Rodriguez --- include/linux/compat-2.6.37.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/linux/compat-2.6.37.h b/include/linux/compat-2.6.37.h index 266772aba670..b87aa2f03f5d 100644 --- a/include/linux/compat-2.6.37.h +++ b/include/linux/compat-2.6.37.h @@ -21,6 +21,16 @@ void irq_modify_status(unsigned int irq, unsigned long clr, unsigned long set); +static inline void irq_set_status_flags(unsigned int irq, unsigned long set) +{ + irq_modify_status(irq, 0, set); +} + +static inline void irq_clear_status_flags(unsigned int irq, unsigned long clr) +{ + irq_modify_status(irq, clr, 0); +} + static inline int proto_ports_offset(int proto) { switch (proto) { -- 2.30.2