Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit 1baafd4

Browse files
Neeraj UpadhyayTreehugger Robot
authored andcommitted
ANDROID: irq: manage: Export irq_do_set_affinity symbol
Vendor kernel modules may implement irq balancers, which could take irq desc lock of an irq and then based on current affinity mask or affinity hint, reconfigure the affinity of that irq. For example : For an irq, for which affinity is broken i.e. all the cpus in its affinity mask have gone offline. For such irqs, we might want to reset the affinity, when the original set of affined cpus, come back online. desc->affinity_hint can be used for figuring out the original affinity. So, the sequence for doing this becomes: desc = irq_to_desc(i); raw_spin_lock(&desc->lock); affinity = desc->affinity_hint; raw_spin_unlock(&desc->lock); irq_set_affinity_hint(i, affinity); Here, we need to release the desc lock before calling the exported api irq_set_affinity_hint(). This creates a window where, after unlocking desc lock and before calling irq_set_affinity_hint(), where this setting can race with other irq_set_affinity_hint() callers. So, export irq_do_set_affinity() symbol to provide an api, which can be called with desc lock held. Bug: 187157600 Change-Id: Ifad88bfaa1e7eec09c3fe5a9dd7d1d421362b41e Signed-off-by: Neeraj Upadhyay <neeraju@codeaurora.org> (cherry picked from commit 9f7014a) Signed-off-by: Guru Das Srinagesh <quic_gurus@quicinc.com>
1 parent d24f7e8 commit 1baafd4

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

kernel/irq/manage.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,7 @@ int irq_do_set_affinity(struct irq_data *data, const struct cpumask *mask,
291291

292292
return ret;
293293
}
294+
EXPORT_SYMBOL_GPL(irq_do_set_affinity);
294295

295296
#ifdef CONFIG_GENERIC_PENDING_IRQ
296297
static inline int irq_set_affinity_pending(struct irq_data *data,

0 commit comments

Comments
 (0)