aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2011-02-05 09:20:04 -0500
committerThomas Gleixner <tglx@linutronix.de>2011-02-19 06:58:18 -0500
commitf230b6d5c48f8d12f4dfa1f8b5ab0b0320076d21 (patch)
treed4d30f77ab196930dd2d2982e90b1f2b5fd9bbe2 /kernel
parent91c499178139d6597e68db19638e4135510a34b8 (diff)
genirq: Add IRQ_MOVE_PENDING to irq_data.state
chip implementations need to know about it. Keep status in sync until all users are fixed. Accessor function: irqd_is_setaffinity_pending(irqdata) Coders who access them directly will be tracked down and slapped with stinking trouts. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/irq/compat.h11
-rw-r--r--kernel/irq/internals.h15
-rw-r--r--kernel/irq/manage.c4
-rw-r--r--kernel/irq/migration.c6
-rw-r--r--kernel/irq/proc.c2
-rw-r--r--kernel/irq/settings.h2
6 files changed, 34 insertions, 6 deletions
diff --git a/kernel/irq/compat.h b/kernel/irq/compat.h
index 593abecbcc44..5e33aadadacc 100644
--- a/kernel/irq/compat.h
+++ b/kernel/irq/compat.h
@@ -37,6 +37,15 @@ static inline void irq_compat_clr_masked(struct irq_desc *desc)
37{ 37{
38 desc->status &= ~IRQ_MASKED; 38 desc->status &= ~IRQ_MASKED;
39} 39}
40static inline void irq_compat_set_move_pending(struct irq_desc *desc)
41{
42 desc->status |= IRQ_MOVE_PENDING;
43}
44
45static inline void irq_compat_clr_move_pending(struct irq_desc *desc)
46{
47 desc->status &= ~IRQ_MOVE_PENDING;
48}
40#else 49#else
41static inline void irq_compat_set_progress(struct irq_desc *desc) { } 50static inline void irq_compat_set_progress(struct irq_desc *desc) { }
42static inline void irq_compat_clr_progress(struct irq_desc *desc) { } 51static inline void irq_compat_clr_progress(struct irq_desc *desc) { }
@@ -46,5 +55,7 @@ static inline void irq_compat_set_pending(struct irq_desc *desc) { }
46static inline void irq_compat_clr_pending(struct irq_desc *desc) { } 55static inline void irq_compat_clr_pending(struct irq_desc *desc) { }
47static inline void irq_compat_set_masked(struct irq_desc *desc) { } 56static inline void irq_compat_set_masked(struct irq_desc *desc) { }
48static inline void irq_compat_clr_masked(struct irq_desc *desc) { } 57static inline void irq_compat_clr_masked(struct irq_desc *desc) { }
58static inline void irq_compat_set_move_pending(struct irq_desc *desc) { }
59static inline void irq_compat_clr_move_pending(struct irq_desc *desc) { }
49#endif 60#endif
50 61
diff --git a/kernel/irq/internals.h b/kernel/irq/internals.h
index cef0849dcfa5..e93e6090cd47 100644
--- a/kernel/irq/internals.h
+++ b/kernel/irq/internals.h
@@ -125,6 +125,21 @@ static inline void chip_bus_sync_unlock(struct irq_desc *desc)
125} 125}
126 126
127/* 127/*
128 * Manipulation functions for irq_data.state
129 */
130static inline void irqd_set_move_pending(struct irq_data *d)
131{
132 d->state_use_accessors |= IRQD_SETAFFINITY_PENDING;
133 irq_compat_set_move_pending(irq_data_to_desc(d));
134}
135
136static inline void irqd_clr_move_pending(struct irq_data *d)
137{
138 d->state_use_accessors &= ~IRQD_SETAFFINITY_PENDING;
139 irq_compat_clr_move_pending(irq_data_to_desc(d));
140}
141
142/*
128 * Debugging printout: 143 * Debugging printout:
129 */ 144 */
130 145
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index ccc9389909ff..9a99c471d470 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -107,7 +107,7 @@ static inline bool irq_can_move_pcntxt(struct irq_desc *desc)
107} 107}
108static inline bool irq_move_pending(struct irq_desc *desc) 108static inline bool irq_move_pending(struct irq_desc *desc)
109{ 109{
110 return desc->status & IRQ_MOVE_PENDING; 110 return irqd_is_setaffinity_pending(&desc->irq_data);
111} 111}
112static inline void 112static inline void
113irq_copy_pending(struct irq_desc *desc, const struct cpumask *mask) 113irq_copy_pending(struct irq_desc *desc, const struct cpumask *mask)
@@ -156,7 +156,7 @@ int irq_set_affinity(unsigned int irq, const struct cpumask *mask)
156 ret = 0; 156 ret = 0;
157 } 157 }
158 } else { 158 } else {
159 desc->status |= IRQ_MOVE_PENDING; 159 irqd_set_move_pending(&desc->irq_data);
160 irq_copy_pending(desc, mask); 160 irq_copy_pending(desc, mask);
161 } 161 }
162 162
diff --git a/kernel/irq/migration.c b/kernel/irq/migration.c
index 6f2f98480354..9485ae081dcd 100644
--- a/kernel/irq/migration.c
+++ b/kernel/irq/migration.c
@@ -9,7 +9,7 @@ void move_masked_irq(int irq)
9 struct irq_desc *desc = irq_to_desc(irq); 9 struct irq_desc *desc = irq_to_desc(irq);
10 struct irq_chip *chip = desc->irq_data.chip; 10 struct irq_chip *chip = desc->irq_data.chip;
11 11
12 if (likely(!(desc->status & IRQ_MOVE_PENDING))) 12 if (likely(!irqd_is_setaffinity_pending(&desc->irq_data)))
13 return; 13 return;
14 14
15 /* 15 /*
@@ -20,7 +20,7 @@ void move_masked_irq(int irq)
20 return; 20 return;
21 } 21 }
22 22
23 desc->status &= ~IRQ_MOVE_PENDING; 23 irqd_clr_move_pending(&desc->irq_data);
24 24
25 if (unlikely(cpumask_empty(desc->pending_mask))) 25 if (unlikely(cpumask_empty(desc->pending_mask)))
26 return; 26 return;
@@ -58,7 +58,7 @@ void move_native_irq(int irq)
58 struct irq_desc *desc = irq_to_desc(irq); 58 struct irq_desc *desc = irq_to_desc(irq);
59 bool masked; 59 bool masked;
60 60
61 if (likely(!(desc->status & IRQ_MOVE_PENDING))) 61 if (likely(!irqd_is_setaffinity_pending(&desc->irq_data)))
62 return; 62 return;
63 63
64 if (unlikely(desc->istate & IRQS_DISABLED)) 64 if (unlikely(desc->istate & IRQS_DISABLED))
diff --git a/kernel/irq/proc.c b/kernel/irq/proc.c
index 26449239bb46..afe4e6803148 100644
--- a/kernel/irq/proc.c
+++ b/kernel/irq/proc.c
@@ -25,7 +25,7 @@ static int irq_affinity_proc_show(struct seq_file *m, void *v)
25 const struct cpumask *mask = desc->irq_data.affinity; 25 const struct cpumask *mask = desc->irq_data.affinity;
26 26
27#ifdef CONFIG_GENERIC_PENDING_IRQ 27#ifdef CONFIG_GENERIC_PENDING_IRQ
28 if (desc->status & IRQ_MOVE_PENDING) 28 if (irqd_is_setaffinity_pending(&desc->irq_data))
29 mask = desc->pending_mask; 29 mask = desc->pending_mask;
30#endif 30#endif
31 seq_cpumask(m, mask); 31 seq_cpumask(m, mask);
diff --git a/kernel/irq/settings.h b/kernel/irq/settings.h
index ef09824e4b32..bb104a2dce73 100644
--- a/kernel/irq/settings.h
+++ b/kernel/irq/settings.h
@@ -20,3 +20,5 @@ enum {
20#define IRQ_MASKED GOT_YOU_MORON 20#define IRQ_MASKED GOT_YOU_MORON
21#undef IRQ_WAKEUP 21#undef IRQ_WAKEUP
22#define IRQ_WAKEUP GOT_YOU_MORON 22#define IRQ_WAKEUP GOT_YOU_MORON
23#undef IRQ_MOVE_PENDING
24#define IRQ_MOVE_PENDING GOT_YOU_MORON