From: Michael Ellerman <mpe@ellerman.id.au>
To: Rob Herring <robh+dt@kernel.org>
Cc: devicetree@vger.kernel.org, tlfalcon@linux.vnet.ibm.com,
Frank Rowand <frowand.list@gmail.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
mwb@linux.vnet.ibm.com, minkim@us.ibm.com,
Tyrel Datwyler <tyreld@linux.vnet.ibm.com>,
linuxppc-dev <linuxppc-dev@lists.ozlabs.org>
Subject: Re: [PATCH v03] powerpc/mobility: Fix node detach/rename problem
Date: Thu, 13 Dec 2018 13:56:38 +1100 [thread overview]
Message-ID: <87a7law2vt.fsf@concordia.ellerman.id.au> (raw)
In-Reply-To: <CAL_Jsq+t--486MiSsHnKcVy=q2wVvJgUmtAV6Vy2WwSNKymELA@mail.gmail.com>
Rob Herring <robh+dt@kernel.org> writes:
> On Tue, Dec 11, 2018 at 7:29 AM Michael Ellerman <mpe@ellerman.id.au> wrote:
...
>> diff --git a/drivers/of/base.c b/drivers/of/base.c
>> index 09692c9b32a7..d8e4534c0686 100644
>> --- a/drivers/of/base.c
>> +++ b/drivers/of/base.c
>> @@ -1190,6 +1190,10 @@ struct device_node *of_find_node_by_phandle(phandle handle)
>> if (phandle_cache[masked_handle] &&
>> handle == phandle_cache[masked_handle]->phandle)
>> np = phandle_cache[masked_handle];
>> +
>> + /* If we find a detached node, remove it */
>> + if (of_node_check_flag(np, OF_DETACHED))
>> + np = phandle_cache[masked_handle] = NULL;
>
> I'm wondering if we should explicitly remove the node from the cache
> when we set OF_DETACHED. Otherwise, it could be possible that the node
> pointer has been freed already.
Yeah good point.
> Or maybe we need both?
That's probably best, it could even be a WARN_ON() if we find one in
of_find_node_by_phandle().
cheers
next prev parent reply other threads:[~2018-12-13 2:58 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-10 21:37 [PATCH v03] powerpc/mobility: Fix node detach/rename problem Michael Bringmann
2018-12-11 13:29 ` Michael Ellerman
2018-12-11 15:26 ` Michael Bringmann
2018-12-11 16:07 ` Rob Herring
2018-12-12 22:00 ` Frank Rowand
2018-12-13 2:57 ` Michael Ellerman
2018-12-14 21:58 ` Michael Bringmann
2018-12-13 2:56 ` Michael Ellerman [this message]
2018-12-11 16:43 ` Michael Bringmann
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=87a7law2vt.fsf@concordia.ellerman.id.au \
--to=mpe@ellerman.id.au \
--cc=devicetree@vger.kernel.org \
--cc=frowand.list@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=minkim@us.ibm.com \
--cc=mwb@linux.vnet.ibm.com \
--cc=robh+dt@kernel.org \
--cc=tlfalcon@linux.vnet.ibm.com \
--cc=tyreld@linux.vnet.ibm.com \
/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).