linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Michael Ellerman <mpe@ellerman.id.au>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: "devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	Bryan Wu <cooloney@gmail.com>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Jingoo Han <jg1.han@samsung.com>,
	"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Richard Purdie <rpurdie@rpsys.net>,
	Lee Jones <lee.jones@linaro.org>
Subject: Re: [1/3] powerpc/pmac: Fix DT refcount imbalance in pmac_pic_probe_oldstyle
Date: Tue, 03 Feb 2015 12:12:32 +1100	[thread overview]
Message-ID: <1422925952.4625.3.camel@ellerman.id.au> (raw)
In-Reply-To: <CAMuHMdUwQ=K7SnFvpaHzL2dCyNXGR3w-_SzFOEWb3cYCiQJfHg@mail.gmail.com>

On Fri, 2015-01-30 at 10:00 +0100, Geert Uytterhoeven wrote:
> Hi Michael,
> 
> On Fri, Jan 30, 2015 at 5:09 AM, Michael Ellerman <mpe@ellerman.id.au> wrote:
> > On Wed, 2015-14-01 at 13:51:57 UTC, Geert Uytterhoeven wrote:
> >> of_find_node_by_name() calls of_node_put() on its "from" parameter,
> >> which must not be done on "master", as it's still in use, and will be
> >> released manually later.  This may cause a zero kref refcount.
> >> Use of_get_child_by_name() instead to fix this.
> >
> > But of_find_node_by_name() searches *all* nodes, not just the children of the
> > parameter.
> 
> That's correct. However, I guess the second mac-io will just be a direct child.

Yeah OK, I don't have a system or an example device tree to check.

> > So this is a logic change AFAICS, and I have no idea what machines we'd need to
> > test on to check it.
> 
> Originally it comes from arch/ppc/platforms/pmac_pic.c, added in 2002 in
> full-history-linux commit 5ea3254844ae344a
> ("Import arch/ppc and include/asm-ppc changes from linuxppc_2_5 tree").
> 
> I've also checked my linuxppc mail archives from 1997-2002, but couldn't find
> the actual patch and a description.
> 
> So I don't know on which machines it's needed.

Yep. Ben or Paul might know, but even then their memory may not be perfect :)
 
> > So I think an of_node_get(master) would be safer and also fix the refcounting.
> 
> If no one can confirm the above, that may indeed be the best solution.

I think so. Given how few of these machines are around it's easy to break them
with an inadvertent change like this, so I think it's better to be safe.

Wanna send a patch for that?

cheers

      reply	other threads:[~2015-02-03  1:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1421243519-6257-1-git-send-email-geert+renesas@glider.be>
2015-01-14 13:51 ` [PATCH 1/3] powerpc/pmac: Fix DT refcount imbalance in pmac_pic_probe_oldstyle Geert Uytterhoeven
2015-01-30  4:09   ` [1/3] " Michael Ellerman
2015-01-30  9:00     ` Geert Uytterhoeven
2015-02-03  1:12       ` Michael Ellerman [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1422925952.4625.3.camel@ellerman.id.au \
    --to=mpe@ellerman.id.au \
    --cc=cooloney@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=geert+renesas@glider.be \
    --cc=geert@linux-m68k.org \
    --cc=jg1.han@samsung.com \
    --cc=lee.jones@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=rpurdie@rpsys.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).