aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2011-02-09 08:54:49 -0500
committerThomas Gleixner <tglx@linutronix.de>2011-02-19 06:58:21 -0500
commitf9e4989eb8183a1f33581fa1b99274287b0639d2 (patch)
tree3b69372623761448a044a24627ceba973e25c4f1 /kernel
parent1ccb4e612f68ceefb888c2c6c1def6294ea8666d (diff)
genirq: Force wrapped access to desc->status in core code
Force the usage of wrappers by another nasty CPP substitution. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/irq/handle.c6
-rw-r--r--kernel/irq/irqdesc.c4
-rw-r--r--kernel/irq/settings.h3
3 files changed, 8 insertions, 5 deletions
diff --git a/kernel/irq/handle.c b/kernel/irq/handle.c
index 6e34bdbeb26a..cb62e2d0df4e 100644
--- a/kernel/irq/handle.c
+++ b/kernel/irq/handle.c
@@ -55,7 +55,7 @@ irqreturn_t
55handle_irq_event_percpu(struct irq_desc *desc, struct irqaction *action) 55handle_irq_event_percpu(struct irq_desc *desc, struct irqaction *action)
56{ 56{
57 irqreturn_t ret, retval = IRQ_NONE; 57 irqreturn_t ret, retval = IRQ_NONE;
58 unsigned int status = 0, irq = desc->irq_data.irq; 58 unsigned int random = 0, irq = desc->irq_data.irq;
59 59
60 do { 60 do {
61 trace_irq_handler_entry(irq, action); 61 trace_irq_handler_entry(irq, action);
@@ -98,7 +98,7 @@ handle_irq_event_percpu(struct irq_desc *desc, struct irqaction *action)
98 98
99 /* Fall through to add to randomness */ 99 /* Fall through to add to randomness */
100 case IRQ_HANDLED: 100 case IRQ_HANDLED:
101 status |= action->flags; 101 random |= action->flags;
102 break; 102 break;
103 103
104 default: 104 default:
@@ -109,7 +109,7 @@ handle_irq_event_percpu(struct irq_desc *desc, struct irqaction *action)
109 action = action->next; 109 action = action->next;
110 } while (action); 110 } while (action);
111 111
112 if (status & IRQF_SAMPLE_RANDOM) 112 if (random & IRQF_SAMPLE_RANDOM)
113 add_interrupt_randomness(irq); 113 add_interrupt_randomness(irq);
114 114
115 if (!noirqdebug) 115 if (!noirqdebug)
diff --git a/kernel/irq/irqdesc.c b/kernel/irq/irqdesc.c
index 78866d050bc9..3387fbd7f2f4 100644
--- a/kernel/irq/irqdesc.c
+++ b/kernel/irq/irqdesc.c
@@ -79,7 +79,7 @@ static void desc_set_defaults(unsigned int irq, struct irq_desc *desc, int node)
79 desc->irq_data.chip_data = NULL; 79 desc->irq_data.chip_data = NULL;
80 desc->irq_data.handler_data = NULL; 80 desc->irq_data.handler_data = NULL;
81 desc->irq_data.msi_desc = NULL; 81 desc->irq_data.msi_desc = NULL;
82 desc->status = _IRQ_DEFAULT_INIT_FLAGS; 82 irq_settings_clr_and_set(desc, ~0, _IRQ_DEFAULT_INIT_FLAGS);
83 desc->istate = IRQS_DISABLED; 83 desc->istate = IRQS_DISABLED;
84 desc->handle_irq = handle_bad_irq; 84 desc->handle_irq = handle_bad_irq;
85 desc->depth = 1; 85 desc->depth = 1;
@@ -247,7 +247,6 @@ int __init early_irq_init(void)
247 247
248struct irq_desc irq_desc[NR_IRQS] __cacheline_aligned_in_smp = { 248struct irq_desc irq_desc[NR_IRQS] __cacheline_aligned_in_smp = {
249 [0 ... NR_IRQS-1] = { 249 [0 ... NR_IRQS-1] = {
250 .status = _IRQ_DEFAULT_INIT_FLAGS,
251 .istate = IRQS_DISABLED, 250 .istate = IRQS_DISABLED,
252 .handle_irq = handle_bad_irq, 251 .handle_irq = handle_bad_irq,
253 .depth = 1, 252 .depth = 1,
@@ -271,6 +270,7 @@ int __init early_irq_init(void)
271 desc[i].irq_data.irq = i; 270 desc[i].irq_data.irq = i;
272 desc[i].irq_data.chip = &no_irq_chip; 271 desc[i].irq_data.chip = &no_irq_chip;
273 desc[i].kstat_irqs = alloc_percpu(unsigned int); 272 desc[i].kstat_irqs = alloc_percpu(unsigned int);
273 irq_settings_clr_and_set(desc, ~0, _IRQ_DEFAULT_INIT_FLAGS);
274 alloc_masks(desc + i, GFP_KERNEL, node); 274 alloc_masks(desc + i, GFP_KERNEL, node);
275 desc_smp_init(desc + i, node); 275 desc_smp_init(desc + i, node);
276 lockdep_set_class(&desc[i].lock, &irq_desc_lock_class); 276 lockdep_set_class(&desc[i].lock, &irq_desc_lock_class);
diff --git a/kernel/irq/settings.h b/kernel/irq/settings.h
index 216b6f200e7c..47bcd3b9f399 100644
--- a/kernel/irq/settings.h
+++ b/kernel/irq/settings.h
@@ -148,3 +148,6 @@ static inline bool irq_settings_is_nested_thread(struct irq_desc *desc)
148{ 148{
149 return desc->status & _IRQ_NESTED_THREAD; 149 return desc->status & _IRQ_NESTED_THREAD;
150} 150}
151
152/* Nothing should touch desc->status from now on */
153#define status USE_THE_PROPER_WRAPPERS_YOU_MORON