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

* Re: [RFC] Revert "i2c: core: Dispose OF IRQ mapping at client removal time"
       [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
  0 siblings, 1 reply; 3+ messages in thread
From: Wolfram Sang @ 2015-03-12  9:23 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: laurent.pinchart+renesas-ryLnwIuWjnjg/C1BVhZhaw,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA

[-- Attachment #1: Type: text/plain, Size: 698 bytes --]

Hi,

thanks for the patch

On Wed, Mar 11, 2015 at 06:35:36PM +0100, Jakub Kicinski wrote:
> 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>

There was another issue with this patch so I was going to revert it
today anyhow. However, you were first, so I'll take your patch, adapt
the commit message and send it out for -rc4.

Thanks,

   Wolfram


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [RFC] Revert "i2c: core: Dispose OF IRQ mapping at client removal time"
  2015-03-12  9:23   ` Wolfram Sang
@ 2015-03-12 11:02     ` Jakub Kicinski
  0 siblings, 0 replies; 3+ messages in thread
From: Jakub Kicinski @ 2015-03-12 11:02 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: laurent.pinchart+renesas-ryLnwIuWjnjg/C1BVhZhaw,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA

On Thu, 12 Mar 2015 10:23:26 +0100, Wolfram Sang wrote:
> On Wed, Mar 11, 2015 at 06:35:36PM +0100, Jakub Kicinski wrote:
> > 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>
> 
> There was another issue with this patch so I was going to revert it
> today anyhow. However, you were first, so I'll take your patch, adapt
> the commit message and send it out for -rc4.

Perfect, I didn't expect to get this done so quickly :)
Will I see the patch in your tree at kernel.org? [1]

Also please consider queuing this up for stable, the unfortunate patch
got it's way into 3.18 as well as 3.19.

[1]
https://git.kernel.org/cgit/linux/kernel/git/wsa/linux.git/log/?h=i2c/for-current

^ permalink raw reply	[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.