mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Avi Weiss <thnkslprpt@gmail.com>
To: tglx@kernel.org
Cc: radu@rendec.net, maz@kernel.org, linux-kernel@vger.kernel.org,
	Avi Weiss <thnkslprpt@gmail.com>
Subject: [PATCH] irqdomain: Count mappings when pushing and popping domains
Date: Sat, 31 Oct 2026 22:15:11 +0200	[thread overview]
Message-ID: <20261031201510.4188963-2-thnkslprpt@gmail.com> (raw)

irq_domain_push_irq() installs a mapping in the pushed domain without
incrementing its mapcount, so debugfs reports no mapped interrupts for
a domain that has active mappings.

Increment mapcount after a successful push and decrement it when the
domain is popped, as done by the normal hierarchy mapping paths.

Fixes: 495c38d3001f ("irqdomain: Add irq_domain_{push,pop}_irq() functions")
Signed-off-by: Avi Weiss <thnkslprpt@gmail.com>
---
 kernel/irq/irqdomain.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c
index 4fdcb6df5306..fd71ce24fca4 100644
--- a/kernel/irq/irqdomain.c
+++ b/kernel/irq/irqdomain.c
@@ -1816,6 +1816,7 @@ int irq_domain_push_irq(struct irq_domain *domain, int virq, void *arg)
 	}
 
 	irq_domain_fix_revmap(parent_irq_data);
+	domain->mapcount++;
 	irq_domain_set_mapping(domain, irq_data->hwirq, irq_data);
 error:
 	mutex_unlock(&domain->root->mutex);
@@ -1877,6 +1878,7 @@ int irq_domain_pop_irq(struct irq_domain *domain, int virq)
 
 	irq_data->parent_data = NULL;
 
+	domain->mapcount--;
 	irq_domain_clear_mapping(domain, irq_data->hwirq);
 	irq_domain_free_irqs_hierarchy(domain, virq, 1);
 

base-commit: 36aad21d50d1af3f6954bb0c988257a908202477
-- 
2.43.0


                 reply	other threads:[~2026-10-31 20:15 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261031201510.4188963-2-thnkslprpt@gmail.com \
    --to=thnkslprpt@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maz@kernel.org \
    --cc=radu@rendec.net \
    --cc=tglx@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®