lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 30 Oct 2014 15:27:54 +0100
From:	Thierry Reding <thierry.reding@...il.com>
To:	Laurent Pinchart <laurent.pinchart+renesas@...asonboard.com>
Cc:	linux-i2c@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 0/3] Delay I2C OF IRQ mapping until probe time

On Thu, Oct 30, 2014 at 03:59:35PM +0200, Laurent Pinchart wrote:
> 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@...51000 {
>                 ...
>                 #interrupt-cells = <2>;
>                 interrupt-controller;
>                 clocks = <&mstp9_clks R8A7790_CLK_GPIO1>;
>         };
> 
>         iic2: i2c@...20000 {
>                 #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@...50994 {
>                 ...
>         };
> 
> The i2c@...20000 node is probed before the gpio@...51000 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(-)

The series:

Reviewed-by: Thierry Reding <treding@...dia.com>

Content of type "application/pgp-signature" skipped

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ