kernel: Warn when an IRQ's affinity notifier gets overwritten

An IRQ affinity notifier getting overwritten can point to some annoying
issues which need to be resolved, like multiple pm_qos objects being
registered to the same IRQ. Print out a warning when this happens to aid
debugging.

Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
This commit is contained in:
Sultan Alsawaf 2020-08-14 21:09:13 -07:00 committed by Ksawlii
parent 2e3484e48b
commit bffb1b52f3

View file

@ -483,6 +483,8 @@ irq_set_affinity_notifier(unsigned int irq, struct irq_affinity_notify *notify)
raw_spin_unlock_irqrestore(&desc->lock, flags);
if (old_notify) {
if (notify)
WARN(1, "overwriting previous IRQ affinity notifier\n");
if (cancel_work_sync(&old_notify->work)) {
/* Pending work had a ref, put that one too */
kref_put(&old_notify->kref, old_notify->release);