From eaf4e78745e19945e2772e0005ce06998510d106 Mon Sep 17 00:00:00 2001 From: Sultan Alsawaf Date: Fri, 14 Aug 2020 21:09:13 -0700 Subject: [PATCH] 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 --- kernel/irq/manage.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c index 3b3ad6b08873..7ddb41dc77c5 100755 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c @@ -330,6 +330,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);