[1/2] arm: irq: Notify affinity change when migrating IRQs during hotplug

Message ID 1408553988-63924-1-git-send-email-lina.iyer@linaro.org
State New
Headers show

Commit Message

Lina Iyer Aug. 20, 2014, 4:59 p.m.
From: Praveen Chidambaram <pchidamb@codeaurora.org>

Hotplug causes IRQs affine to a core that is being taken down to migrate
to an online core. This is done by directly calling the irq_set_affinity
associated with the irq_chip structure. Instead using the
irq_set_affinity_locked() api lets the notifications bubble through.

Signed-off-by: Praveen Chidambaram <pchidamb@codeaurora.org>
Signed-off-by: Lina Iyer <lina.iyer@linaro.org>
---
 arch/arm/kernel/irq.c | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

Comments

Kevin Hilman Aug. 27, 2014, 5:09 p.m. | #1
Lina Iyer <lina.iyer@linaro.org> writes:

> From: Praveen Chidambaram <pchidamb@codeaurora.org>
>
> Hotplug causes IRQs affine to a core that is being taken down to migrate
> to an online core. This is done by directly calling the irq_set_affinity
> associated with the irq_chip structure. Instead using the
> irq_set_affinity_locked() api lets the notifications bubble through.

changelog nit: and why do you want/need the notification to bubble
through?   IOW, you're explaining "what" the patch does, but not "why",
which typically includes a summary of the problem being solved.  (I know
the background from the other series, but other reviewers may not know
the history there.)

Also, please post these to linux-arm-kernel.

Thanks,

Kevin
--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Lina Iyer Aug. 27, 2014, 10:51 p.m. | #2
On Wed, Aug 27, 2014 at 10:09:10AM -0700, Kevin Hilman wrote:
>Lina Iyer <lina.iyer@linaro.org> writes:
>
>> From: Praveen Chidambaram <pchidamb@codeaurora.org>
>>
>> Hotplug causes IRQs affine to a core that is being taken down to migrate
>> to an online core. This is done by directly calling the irq_set_affinity
>> associated with the irq_chip structure. Instead using the
>> irq_set_affinity_locked() api lets the notifications bubble through.
>
>changelog nit: and why do you want/need the notification to bubble
>through?   IOW, you're explaining "what" the patch does, but not "why",
>which typically includes a summary of the problem being solved.  (I know
>the background from the other series, but other reviewers may not know
>the history there.)
Okay. I seem to be making the mistake of not explaining things very
well, in context.
Let me elaborate and resend.
>
>Also, please post these to linux-arm-kernel.
>
>Thanks,
>
>Kevin
--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/arch/arm/kernel/irq.c b/arch/arm/kernel/irq.c
index 2c42576..8835ef2 100644
--- a/arch/arm/kernel/irq.c
+++ b/arch/arm/kernel/irq.c
@@ -157,7 +157,6 @@  static bool migrate_one_irq(struct irq_desc *desc)
 {
 	struct irq_data *d = irq_desc_get_irq_data(desc);
 	const struct cpumask *affinity = d->affinity;
-	struct irq_chip *c;
 	bool ret = false;
 
 	/*
@@ -167,17 +166,12 @@  static bool migrate_one_irq(struct irq_desc *desc)
 	if (irqd_is_per_cpu(d) || !cpumask_test_cpu(smp_processor_id(), affinity))
 		return false;
 
-	if (cpumask_any_and(affinity, cpu_online_mask) >= nr_cpu_ids) {
-		affinity = cpu_online_mask;
+	if (cpumask_any_and(affinity, cpu_online_mask) >= nr_cpu_ids)
 		ret = true;
-	}
-
-	c = irq_data_get_irq_chip(d);
-	if (!c->irq_set_affinity)
-		pr_debug("IRQ%u: unable to set affinity\n", d->irq);
-	else if (c->irq_set_affinity(d, affinity, true) == IRQ_SET_MASK_OK && ret)
-		cpumask_copy(d->affinity, affinity);
 
+	affinity = cpu_online_mask;
+	ret = (irq_set_affinity_locked(d, affinity, true) == IRQ_SET_MASK_OK)
+			&& ret;
 	return ret;
 }