linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] Delay I2C OF IRQ mapping until probe time
@ 2014-10-30 13:59 Laurent Pinchart
       [not found] ` <1414677578-27412-1-git-send-email-laurent.pinchart+renesas-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org>
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Laurent Pinchart @ 2014-10-30 13:59 UTC (permalink / raw)
  To: linux-i2c; +Cc: linux-kernel, Thierry Reding

Hello,

I recently ran into an issue with the OF IRQ parsing code in the I2C core
(of_i2c_register_devices in drivers/i2c/i2c-core.c).

My DT contains the following nodes.

        gpio1: gpio@e6051000 {
                ...
                #interrupt-cells = <2>;
                interrupt-controller;
                clocks = <&mstp9_clks R8A7790_CLK_GPIO1>;
        };

        iic2: i2c@e6520000 {
                #address-cells = <1>;
                #size-cells = <0>;
                ...
                hdmi@39 {
                        compatible = "adi,adv7511w";
                        reg = <0x39>;
                        interrupt-parent = <&gpio1>;
                        interrupts = <15 IRQ_TYPE_EDGE_FALLING>;
                        ...
                };
        };

        mstp9_clks: mstp9_clks@e6150994 {
                ...
        };

The i2c@e6520000 node is probed before the gpio@e6051000 node. The
of_i2c_register_devices() function tries to register all children, including
hdmi@39. It tries to parse and map the I2C client IRQ by calling
irq_of_parse_and_map(), which returns 0 as the interrupt controller isn't
probed yet. The adv7511 driver later probes the hdmi@39 device and gets
client->irq set to 0.

As we can't control the probe order in the general case we need to rely on
deferred probing. This patch series is an attempt to do so, by moving IRQ
mapping from device registration time to device probe time were probing can be
deferred.

Laurent Pinchart (3):
  of/irq: Export of_irq_get()
  i2c: core: Dispose OF IRQ mapping at client removal time
  i2c: core: Map OF IRQ at probe time

 drivers/i2c/i2c-core.c | 14 ++++++++++++--
 drivers/of/irq.c       |  1 +
 2 files changed, 13 insertions(+), 2 deletions(-)

-- 
Regards,

Laurent Pinchart

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

end of thread, other threads:[~2014-11-17 11:24 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-30 13:59 [PATCH 0/3] Delay I2C OF IRQ mapping until probe time Laurent Pinchart
     [not found] ` <1414677578-27412-1-git-send-email-laurent.pinchart+renesas-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org>
2014-10-30 13:59   ` [PATCH 1/3] of/irq: Export of_irq_get() Laurent Pinchart
2014-10-30 14:16     ` Wolfram Sang
2014-10-30 14:17       ` Laurent Pinchart
2014-10-31 18:20         ` Wolfram Sang
2014-10-31 20:58           ` Rob Herring
2014-11-04 15:55       ` Grant Likely
     [not found]     ` <1414677578-27412-2-git-send-email-laurent.pinchart+renesas-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org>
2014-11-07 18:05       ` Wolfram Sang
2014-10-30 14:27   ` [PATCH 0/3] Delay I2C OF IRQ mapping until probe time Thierry Reding
2014-10-30 13:59 ` [PATCH 2/3] i2c: core: Dispose OF IRQ mapping at client removal time Laurent Pinchart
     [not found]   ` <1414677578-27412-3-git-send-email-laurent.pinchart+renesas-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org>
2014-10-30 14:25     ` Thierry Reding
2014-11-07 18:03     ` Wolfram Sang
2014-10-30 13:59 ` [PATCH 3/3] i2c: core: Map OF IRQ at probe time Laurent Pinchart
     [not found]   ` <1414677578-27412-4-git-send-email-laurent.pinchart+renesas-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org>
2014-11-07 18:05     ` Wolfram Sang
2014-11-17 11:24   ` Geert Uytterhoeven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).