All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Ellerman <mpe@ellerman.id.au>
To: Geert Uytterhoeven <geert+renesas@glider.be>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Bryan Wu <cooloney@gmail.com>, Richard Purdie <rpurdie@rpsys.net>,
	Jingoo Han <jg1.han@samsung.com>,
	Lee Jones <lee.jones@linaro.org>
Cc: devicetree@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
	linux-kernel@vger.kernel.org,
	Geert Uytterhoeven <geert+renesas@glider.be>
Subject: Re: [1/3] powerpc/pmac: Fix DT refcount imbalance in pmac_pic_probe_oldstyle
Date: Fri, 30 Jan 2015 15:09:04 +1100 (AEDT)	[thread overview]
Message-ID: <20150130040904.8F89D1402A7@ozlabs.org> (raw)
In-Reply-To: <1421243519-6257-2-git-send-email-geert+renesas@glider.be>

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.

So this is a logic change AFAICS, and I have no idea what machines we'd need to
test on to check it.

So I think an of_node_get(master) would be safer and also fix the refcounting.

cheers

WARNING: multiple messages have this Message-ID (diff)
From: Michael Ellerman <mpe-Gsx/Oe8HsFggBc27wqDAHg@public.gmane.org>
To: Benjamin Herrenschmidt
	<benh-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r@public.gmane.org>,
	Bryan Wu <cooloney-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Richard Purdie <rpurdie-Fm38FmjxZ/leoWH0uzbU5w@public.gmane.org>,
	Jingoo Han <jg1.han-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
	Lee Jones <lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linuxppc-dev-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Geert Uytterhoeven
	<geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org>
Subject: Re: [1/3] powerpc/pmac: Fix DT refcount imbalance in pmac_pic_probe_oldstyle
Date: Fri, 30 Jan 2015 15:09:04 +1100 (AEDT)	[thread overview]
Message-ID: <20150130040904.8F89D1402A7@ozlabs.org> (raw)
In-Reply-To: <1421243519-6257-2-git-send-email-geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org>

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.

So this is a logic change AFAICS, and I have no idea what machines we'd need to
test on to check it.

So I think an of_node_get(master) would be safer and also fix the refcounting.

cheers
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2015-01-30  4:09 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-14 13:51 [PATCH 0/3] Use of_get_child_by_name() instead of of_find_node_by_name() Geert Uytterhoeven
2015-01-14 13:51 ` [PATCH 1/3] powerpc/pmac: Fix DT refcount imbalance in pmac_pic_probe_oldstyle Geert Uytterhoeven
2015-01-14 13:51   ` Geert Uytterhoeven
2015-01-30  4:09   ` Michael Ellerman [this message]
2015-01-30  4:09     ` [1/3] " Michael Ellerman
2015-01-30  9:00     ` Geert Uytterhoeven
2015-01-30  9:00       ` Geert Uytterhoeven
2015-01-30  9:00       ` Geert Uytterhoeven
2015-02-03  1:12       ` Michael Ellerman
2015-02-03  1:12         ` Michael Ellerman
2015-02-03  1:12         ` Michael Ellerman
2015-01-14 13:51 ` [PATCH 2/3] leds: leds-mc13783: Use of_get_child_by_name() instead of refcount hack Geert Uytterhoeven
2015-01-14 18:42   ` Bryan Wu
     [not found] ` <1421243519-6257-1-git-send-email-geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org>
2015-01-14 13:51   ` [PATCH 3/3] backlight: 88pm860x_bl: " Geert Uytterhoeven
2015-01-14 13:51     ` Geert Uytterhoeven
2015-01-14 13:51     ` Geert Uytterhoeven
     [not found]     ` <1421243519-6257-4-git-send-email-geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org>
2015-01-18 12:46       ` Lee Jones
2015-01-18 12:46         ` Lee Jones
2015-01-18 12:46         ` Lee Jones

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=20150130040904.8F89D1402A7@ozlabs.org \
    --to=mpe@ellerman.id.au \
    --cc=benh@kernel.crashing.org \
    --cc=cooloney@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=geert+renesas@glider.be \
    --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 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.