[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAL_JsqJvYnBtaOwaRbNo5Eqp51yxhJpnSYQWEGfKjtZKjm7R4g@mail.gmail.com>
Date: Wed, 1 Mar 2023 15:00:25 -0600
From: Rob Herring <robh+dt@...nel.org>
To: Jean-Jacques Hiblot <jjhiblot@...phandler.com>
Cc: saravanak@...gle.com, clement.leger@...tlin.com,
Geert Uytterhoeven <geert+renesas@...der.be>,
Magnus Damm <magnus.damm@...il.com>,
Russell King <linux@...linux.org.uk>,
Michael Ellerman <mpe@...erman.id.au>,
Nicholas Piggin <npiggin@...il.com>,
Christophe Leroy <christophe.leroy@...roup.eu>,
zajec5@...il.com, Daniel Lezcano <daniel.lezcano@...aro.org>,
Thomas Gleixner <tglx@...utronix.de>,
Claudiu Beznea <claudiu.beznea@...rochip.com>,
Marc Zyngier <maz@...nel.org>, afaerber@...e.de,
Manivannan Sadhasivam <mani@...nel.org>,
Palmer Dabbelt <palmer@...belt.com>,
Paul Walmsley <paul.walmsley@...ive.com>,
Chen-Yu Tsai <wens@...e.org>,
Jernej Skrabec <jernej.skrabec@...il.com>,
Samuel Holland <samuel@...lland.org>,
Frank Rowand <frowand.list@...il.com>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Nishanth Menon <nm@...com>, ssantosh@...nel.org,
mathias.nyman@...el.com, gregkh@...uxfoundation.org,
thierry.reding@...il.com, jonathanh@...dia.com,
linux-renesas-soc@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
linuxppc-dev@...ts.ozlabs.org, linux-wireless@...r.kernel.org,
linux-actions@...ts.infradead.org, linux-riscv@...ts.infradead.org,
linux-sunxi@...ts.linux.dev, devicetree@...r.kernel.org,
linux-pci@...r.kernel.org, linux-usb@...r.kernel.org,
linux-tegra@...r.kernel.org
Subject: Re: [PATCH 3/3] of: irq: release the node after looking up for "interrupts-extended"
On Wed, Mar 1, 2023 at 12:53 PM Jean-Jacques Hiblot
<jjhiblot@...phandler.com> wrote:
>
> When of_parse_phandle_with_args() succeeds, a get() is performed on
> out_irq->np. And another get() is performed in of_irq_parse_raw(),
> resulting in the refcount being incremented twice.
> Fixing this by calling put() after of_irq_parse_raw().
This looks like a band-aid to me. It only makes sense that the caller
of of_irq_parse_raw() already holds a ref to out_irq->np. So the first
of_node_get() in it looks wrong. It looks like the refcounting was
originally balanced, but commit 2f53a713c4b6 ("of/irq: Fix device_node
refcount in of_irq_parse_raw()") dropped the put on exit after 'got
it!'. I'm not sure if just adding it back would be correct or not
though.
All this needs some test cases to be sure we get things right...
Rob
Powered by blists - more mailing lists