All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC] Revert "i2c: core: Dispose OF IRQ mapping at client removal time"
@ 2015-03-11 17:35 Jakub Kicinski
       [not found] ` <1426095336-16108-1-git-send-email-kubakici-5tc4TXWwyLM@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Jakub Kicinski @ 2015-03-11 17:35 UTC (permalink / raw)
  To: laurent.pinchart+renesas-ryLnwIuWjnjg/C1BVhZhaw,
	wsa-z923LK4zBo2bacvFa/9K2g
  Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA, Jakub Kicinski

This reverts commit e4df3a0b6228
("i2c: core: Dispose OF IRQ mapping at client removal time")

Calling irq_dispose_mapping() will destroy the mapping and
disassociate the IRQ from the IRQ chip to which it belongs.
There should be no real need to dispose of the mapping in
the first place.

Signed-off-by: Jakub Kicinski <kubakici-5tc4TXWwyLM@public.gmane.org>
---
Hi there!

reverted patch makes it impossible to rebind to a device or reload the driver.

I'm using GPIO IRQs, the GPIO IRQ controllers create mappings for all their
interrupts by themselves and bind them the controller chip with
irq_set_chip_and_handler() at boot time. When i2c calls of_irq_get() this
mapping is simply reused (irq_create_mapping() checks for an existing mapping).

If the mapping is destroyed by i2c on .remove(), nothing can bind the mapping
back to the chip therefore __irq_set_trigger() will fail to set the type.

I'm testing with sc16is7xx on a RaspberryPi.
---
 drivers/i2c/i2c-core.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index e9eae57a2b50..63663332391d 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -679,9 +679,6 @@ static int i2c_device_remove(struct device *dev)
 		status = driver->remove(client);
 	}
 
-	if (dev->of_node)
-		irq_dispose_mapping(client->irq);
-
 	dev_pm_domain_detach(&client->dev, true);
 	return status;
 }
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-03-12 11:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-11 17:35 [RFC] Revert "i2c: core: Dispose OF IRQ mapping at client removal time" Jakub Kicinski
     [not found] ` <1426095336-16108-1-git-send-email-kubakici-5tc4TXWwyLM@public.gmane.org>
2015-03-12  9:23   ` Wolfram Sang
2015-03-12 11:02     ` Jakub Kicinski

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.