aboutsummaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/irq/compat.h11
-rw-r--r--kernel/irq/internals.h4
-rw-r--r--kernel/irq/manage.c11
-rw-r--r--kernel/irq/settings.h2
4 files changed, 24 insertions, 4 deletions
diff --git a/kernel/irq/compat.h b/kernel/irq/compat.h
index 5e33aadadac..6bbaf66aca8 100644
--- a/kernel/irq/compat.h
+++ b/kernel/irq/compat.h
@@ -46,6 +46,15 @@ static inline void irq_compat_clr_move_pending(struct irq_desc *desc)
{
desc->status &= ~IRQ_MOVE_PENDING;
}
+static inline void irq_compat_set_affinity(struct irq_desc *desc)
+{
+ desc->status |= IRQ_AFFINITY_SET;
+}
+
+static inline void irq_compat_clr_affinity(struct irq_desc *desc)
+{
+ desc->status &= ~IRQ_AFFINITY_SET;
+}
#else
static inline void irq_compat_set_progress(struct irq_desc *desc) { }
static inline void irq_compat_clr_progress(struct irq_desc *desc) { }
@@ -57,5 +66,7 @@ static inline void irq_compat_set_masked(struct irq_desc *desc) { }
static inline void irq_compat_clr_masked(struct irq_desc *desc) { }
static inline void irq_compat_set_move_pending(struct irq_desc *desc) { }
static inline void irq_compat_clr_move_pending(struct irq_desc *desc) { }
+static inline void irq_compat_set_affinity(struct irq_desc *desc) { }
+static inline void irq_compat_clr_affinity(struct irq_desc *desc) { }
#endif
diff --git a/kernel/irq/internals.h b/kernel/irq/internals.h
index a80b44d2735..6776453c454 100644
--- a/kernel/irq/internals.h
+++ b/kernel/irq/internals.h
@@ -150,3 +150,7 @@ static inline void irqd_set(struct irq_data *d, unsigned int mask)
d->state_use_accessors |= mask;
}
+static inline bool irqd_has_set(struct irq_data *d, unsigned int mask)
+{
+ return d->state_use_accessors & mask;
+}
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index 550ae97a004..8246afc8195 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -164,7 +164,8 @@ int irq_set_affinity(unsigned int irq, const struct cpumask *mask)
kref_get(&desc->affinity_notify->kref);
schedule_work(&desc->affinity_notify->work);
}
- desc->status |= IRQ_AFFINITY_SET;
+ irq_compat_set_affinity(desc);
+ irqd_set(&desc->irq_data, IRQD_AFFINITY_SET);
raw_spin_unlock_irqrestore(&desc->lock, flags);
return ret;
}
@@ -272,12 +273,14 @@ setup_affinity(unsigned int irq, struct irq_desc *desc, struct cpumask *mask)
* Preserve an userspace affinity setup, but make sure that
* one of the targets is online.
*/
- if (desc->status & (IRQ_AFFINITY_SET)) {
+ if (irqd_has_set(&desc->irq_data, IRQD_AFFINITY_SET)) {
if (cpumask_intersects(desc->irq_data.affinity,
cpu_online_mask))
set = desc->irq_data.affinity;
- else
- desc->status &= ~IRQ_AFFINITY_SET;
+ else {
+ irq_compat_clr_affinity(desc);
+ irqd_clear(&desc->irq_data, IRQD_AFFINITY_SET);
+ }
}
cpumask_and(mask, cpu_online_mask, set);
diff --git a/kernel/irq/settings.h b/kernel/irq/settings.h
index ba0fffe410a..da5acb446b1 100644
--- a/kernel/irq/settings.h
+++ b/kernel/irq/settings.h
@@ -29,6 +29,8 @@ enum {
#define IRQ_PER_CPU GOT_YOU_MORON
#undef IRQ_NO_BALANCING
#define IRQ_NO_BALANCING GOT_YOU_MORON
+#undef IRQ_AFFINITY_SET
+#define IRQ_AFFINITY_SET GOT_YOU_MORON
#undef IRQF_MODIFY_MASK
#define IRQF_MODIFY_MASK GOT_YOU_MORON