public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Laxman Dewangan <ldewangan@nvidia.com>,
	Javier Martinez Canillas <javier@osg.samsung.com>,
	Mark Brown <broonie@kernel.org>
Cc: linux-kernel@vger.kernel.org
Subject: Applied "regmap: irq: dispose all virtual irq before removing domain" to the regmap tree
Date: Tue, 09 Feb 2016 16:16:07 +0000	[thread overview]
Message-ID: <E1aTAxT-00083s-I8@debutante> (raw)
In-Reply-To: <1455020907-4564-2-git-send-email-ldewangan@nvidia.com>

The patch

   regmap: irq: dispose all virtual irq before removing domain

has been applied to the regmap tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From 46189518d73080f4e4ea269a3b0f4b8583f486bd Mon Sep 17 00:00:00 2001
From: Laxman Dewangan <ldewangan@nvidia.com>
Date: Tue, 9 Feb 2016 17:58:22 +0530
Subject: [PATCH] regmap: irq: dispose all virtual irq before removing domain

It is require to dispose all virtual irq of hwirq on chip
created on given irq domain before removing this irq domain.
Hence dispose all mapped irqs before deleting the irq domains
in regmap_del_irq_chip();

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
Tested-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 drivers/base/regmap/regmap-irq.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/drivers/base/regmap/regmap-irq.c b/drivers/base/regmap/regmap-irq.c
index 9b0d202414d0..7e1e9e86c70b 100644
--- a/drivers/base/regmap/regmap-irq.c
+++ b/drivers/base/regmap/regmap-irq.c
@@ -655,13 +655,34 @@ EXPORT_SYMBOL_GPL(regmap_add_irq_chip);
  *
  * @irq: Primary IRQ for the device
  * @d:   regmap_irq_chip_data allocated by regmap_add_irq_chip()
+ *
+ * This function also dispose all mapped irq on chip.
  */
 void regmap_del_irq_chip(int irq, struct regmap_irq_chip_data *d)
 {
+	unsigned int virq;
+	int hwirq;
+
 	if (!d)
 		return;
 
 	free_irq(irq, d);
+
+	/* Dispose all virtual irq from irq domain before removing it */
+	for (hwirq = 0; hwirq < d->chip->num_irqs; hwirq++) {
+		/* Ignore hwirq if holes in the IRQ list */
+		if (!d->chip->irqs[hwirq].mask)
+			continue;
+
+		/*
+		 * Find the virtual irq of hwirq on chip and if it is
+		 * there then dispose it
+		 */
+		virq = irq_find_mapping(d->domain, hwirq);
+		if (virq)
+			irq_dispose_mapping(virq);
+	}
+
 	irq_domain_remove(d->domain);
 	kfree(d->type_buf);
 	kfree(d->type_buf_def);
-- 
2.7.0.rc3

  parent reply	other threads:[~2016-02-09 16:16 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-09 12:28 [PATCH V6 0/6] rtc: max77686: make max77686 rtc driver as IP driver Laxman Dewangan
2016-02-09 12:28 ` [PATCH V6 1/6] regmap: irq: dispose all virtual irq before removing domain Laxman Dewangan
2016-02-09 13:27   ` Javier Martinez Canillas
2016-02-09 13:58     ` Laxman Dewangan
2016-02-09 14:24       ` Javier Martinez Canillas
2016-02-09 15:14     ` Mark Brown
2016-02-09 15:05       ` Laxman Dewangan
2016-02-09 15:21         ` Javier Martinez Canillas
2016-02-09 14:50   ` Javier Martinez Canillas
2016-02-09 16:16   ` Mark Brown [this message]
2016-02-09 12:28 ` [PATCH V6 2/6] rtc: max77686: fix checkpatch error Laxman Dewangan
2016-02-09 12:28 ` [PATCH V6 3/6] rtc: max77686: use rtc regmap to access RTC registers Laxman Dewangan
2016-02-09 12:28 ` [PATCH V6 4/6] rtc: max77686: avoid reference of parent device info multiple places Laxman Dewangan
2016-02-09 12:28 ` [PATCH V6 5/6] mfd: max77686: do not set i2c client data for rtc i2c client Laxman Dewangan
2016-02-09 12:28 ` [PATCH V6 6/6] rtc: max77686: move initialisation of rtc regmap, irq chip locally Laxman Dewangan

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=E1aTAxT-00083s-I8@debutante \
    --to=broonie@kernel.org \
    --cc=javier@osg.samsung.com \
    --cc=ldewangan@nvidia.com \
    --cc=linux-kernel@vger.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