mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-10 06:09:23 -04:00
genirq: Honour IRQ's affinity hint during migration
An IRQ affinity is broken during hotplug/isolation when there are no online and un-isolated CPUs in the current affinity mask. An online and un-isolated CPU from the irq_default_affinity mask (i.e /proc/irq/default_smp_affinity) is used as the current affinity. However Individual IRQs can have their affinity hint set via irq_set_affinity_hint() API. When such hint is available, use it instead of the irq_default_affinity which is a system level setting. Change-Id: I53a537582ec4e1aed0c59b49f4fd5b6ca7c0c332 Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org> Signed-off-by: Satya Durga Srinivasu Prabhala <satyap@codeaurora.org>
This commit is contained in:
parent
fe605a9890
commit
1c71817e0f
1 changed files with 6 additions and 2 deletions
|
|
@ -116,6 +116,8 @@ static bool migrate_one_irq(struct irq_desc *desc)
|
|||
affinity = &available_cpus;
|
||||
|
||||
if (cpumask_any_and(affinity, cpu_online_mask) >= nr_cpu_ids) {
|
||||
const struct cpumask *default_affinity;
|
||||
|
||||
/*
|
||||
* If the interrupt is managed, then shut it down and leave
|
||||
* the affinity untouched.
|
||||
|
|
@ -125,6 +127,8 @@ static bool migrate_one_irq(struct irq_desc *desc)
|
|||
irq_shutdown_and_deactivate(desc);
|
||||
return false;
|
||||
}
|
||||
|
||||
default_affinity = desc->affinity_hint ? : irq_default_affinity;
|
||||
/*
|
||||
* The order of preference for selecting a fallback CPU is
|
||||
*
|
||||
|
|
@ -134,9 +138,9 @@ static bool migrate_one_irq(struct irq_desc *desc)
|
|||
*/
|
||||
cpumask_andnot(&available_cpus, cpu_online_mask,
|
||||
cpu_isolated_mask);
|
||||
if (cpumask_intersects(&available_cpus, irq_default_affinity))
|
||||
if (cpumask_intersects(&available_cpus, default_affinity))
|
||||
cpumask_and(&available_cpus, &available_cpus,
|
||||
irq_default_affinity);
|
||||
default_affinity);
|
||||
else if (cpumask_empty(&available_cpus))
|
||||
affinity = cpu_online_mask;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue