<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/drivers/of/dynamic.c, branch v5.4.108</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v5.4.108</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v5.4.108'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2019-01-10T22:24:44Z</updated>
<entry>
<title>of: Remove struct device_node.type pointer</title>
<updated>2019-01-10T22:24:44Z</updated>
<author>
<name>Rob Herring</name>
<email>robh@kernel.org</email>
</author>
<published>2018-12-11T20:31:05Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=8ce5f84157530ffa64b3e0acf00b9261f41c8da8'/>
<id>urn:sha1:8ce5f84157530ffa64b3e0acf00b9261f41c8da8</id>
<content type='text'>
Now that all users of device_node.type pointer have been removed in
favor of accessor functions, we can remove it.

Cc: Frank Rowand &lt;frowand.list@gmail.com&gt;
Cc: devicetree@vger.kernel.org
Signed-off-by: Rob Herring &lt;robh@kernel.org&gt;
</content>
</entry>
<entry>
<title>of: __of_detach_node() - remove node from phandle cache</title>
<updated>2018-12-21T18:42:36Z</updated>
<author>
<name>Frank Rowand</name>
<email>frank.rowand@sony.com</email>
</author>
<published>2018-12-18T19:40:03Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=5801169a2ed20003f771acecf3ac00574cf10a38'/>
<id>urn:sha1:5801169a2ed20003f771acecf3ac00574cf10a38</id>
<content type='text'>
Non-overlay dynamic devicetree node removal may leave the node in
the phandle cache.  Subsequent calls to of_find_node_by_phandle()
will incorrectly find the stale entry.  Remove the node from the
cache.

Add paranoia checks in of_find_node_by_phandle() as a second level
of defense (do not return cached node if detached, do not add node
to cache if detached).

Fixes: 0b3ce78e90fc ("of: cache phandle nodes to reduce cost of of_find_node_by_phandle()")
Reported-by: Michael Bringmann &lt;mwb@linux.vnet.ibm.com&gt;
Cc: stable@vger.kernel.org # v4.17+
Signed-off-by: Frank Rowand &lt;frank.rowand@sony.com&gt;
Signed-off-by: Rob Herring &lt;robh@kernel.org&gt;
</content>
</entry>
<entry>
<title>of: overlay: set node fields from properties when add new overlay node</title>
<updated>2018-11-09T06:12:17Z</updated>
<author>
<name>Frank Rowand</name>
<email>frank.rowand@sony.com</email>
</author>
<published>2018-10-13T02:21:16Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=f96278810150fc39085d1872e5b39ea06366d03e'/>
<id>urn:sha1:f96278810150fc39085d1872e5b39ea06366d03e</id>
<content type='text'>
Overlay nodes added by add_changeset_node() do not have the node
fields name, phandle, and type set.

The node passed to __of_attach_node() when the add node changeset
entry is processed does not contain any properties.  The node's
properties are located in add property changeset entries that will
be processed after the add node changeset is applied.

Set the node's fields in the node contained in the add node
changeset entry and do not set them to incorrect values in
add_changeset_node().

A visible symptom that is fixed by this patch is the names of nodes
added by overlays that have an entry in /sys/bus/platform/drivers/*/
will contain the unit-address but the node-name will be &lt;NULL&gt;,  for
example, "fc4ab000.&lt;NULL&gt;".  After applying the patch the name, in
this example, for node restart@fc4ab000 is "fc4ab000.restart".

Tested-by: Alan Tull &lt;atull@kernel.org&gt;
Signed-off-by: Frank Rowand &lt;frank.rowand@sony.com&gt;
</content>
</entry>
<entry>
<title>of: overlay: add missing of_node_get() in __of_attach_node_sysfs</title>
<updated>2018-11-09T06:10:53Z</updated>
<author>
<name>Frank Rowand</name>
<email>frank.rowand@sony.com</email>
</author>
<published>2018-10-05T03:26:05Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=5b2c2f5a0ea3a43e0dee78059e34c7cb54136dcc'/>
<id>urn:sha1:5b2c2f5a0ea3a43e0dee78059e34c7cb54136dcc</id>
<content type='text'>
There is a matching of_node_put() in __of_detach_node_sysfs()

Remove misleading comment from function header comment for
of_detach_node().

This patch may result in memory leaks from code that directly calls
the dynamic node add and delete functions directly instead of
using changesets.

This commit should result in powerpc systems that dynamically
allocate a node, then later deallocate the node to have a
memory leak when the node is deallocated.

The next commit will fix the leak.

Tested-by: Alan Tull &lt;atull@kernel.org&gt;
Acked-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt; (powerpc)
Signed-off-by: Frank Rowand &lt;frank.rowand@sony.com&gt;
</content>
</entry>
<entry>
<title>of: overlay: add tests to validate kfrees from overlay removal</title>
<updated>2018-11-09T06:10:35Z</updated>
<author>
<name>Frank Rowand</name>
<email>frank.rowand@sony.com</email>
</author>
<published>2018-10-05T03:24:17Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=144552c786925314c1e7cb8f91a71dae1aca8798'/>
<id>urn:sha1:144552c786925314c1e7cb8f91a71dae1aca8798</id>
<content type='text'>
Add checks:
  - attempted kfree due to refcount reaching zero before overlay
    is removed
  - properties linked to an overlay node when the node is removed
  - node refcount &gt; one during node removal in a changeset destroy,
    if the node was created by the changeset

After applying this patch, several validation warnings will be
reported from the devicetree unittest during boot due to
pre-existing devicetree bugs. The warnings will be similar to:

  OF: ERROR: of_node_release(), unexpected properties in /testcase-data/overlay-node/test-bus/test-unittest11
  OF: ERROR: memory leak, expected refcount 1 instead of 2, of_node_get()/of_node_put() unbalanced - destroy cset entry: attach overlay node /testcase-data-2/substation@100/
  hvac-medium-2

Tested-by: Alan Tull &lt;atull@kernel.org&gt;
Signed-off-by: Frank Rowand &lt;frank.rowand@sony.com&gt;
</content>
</entry>
<entry>
<title>of: overlay: do not include path in full_name of added nodes</title>
<updated>2018-03-05T21:38:34Z</updated>
<author>
<name>Frank Rowand</name>
<email>frank.rowand@sony.com</email>
</author>
<published>2018-02-26T22:01:23Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=b89dae1852869d6bb3e4a8e3c6bdaf86dc2ef9da'/>
<id>urn:sha1:b89dae1852869d6bb3e4a8e3c6bdaf86dc2ef9da</id>
<content type='text'>
Struct device_node full_name no longer includes the full path name
when the devicetree is created from a flattened device tree (FDT).
The overlay node creation code was not modified to reflect this
change.  Fix the node full_name generated by overlay code to contain
only the basename.

Unittests call an overlay internal function to create new nodes.
Fix up these calls to provide basename only instead of the full
path.

Fixes: a7e4cfb0a7ca ("of/fdt: only store the device node basename
in full_name")

Signed-off-by: Frank Rowand &lt;frank.rowand@sony.com&gt;
Signed-off-by: Rob Herring &lt;robh@kernel.org&gt;
</content>
</entry>
<entry>
<title>of: Use SPDX license tag for DT files</title>
<updated>2018-01-08T14:22:45Z</updated>
<author>
<name>Rob Herring</name>
<email>robh@kernel.org</email>
</author>
<published>2017-12-27T18:55:14Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=af6074fc9aa4b29517375634189ada1869eea598'/>
<id>urn:sha1:af6074fc9aa4b29517375634189ada1869eea598</id>
<content type='text'>
Convert remaining DT files to use SPDX-License-Identifier tags.

Cc: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
Cc: Guennadi Liakhovetski &lt;g.liakhovetski@gmx.de&gt;
Cc: Paul Mackerras &lt;paulus@samba.org&gt;
Cc: Pantelis Antoniou &lt;pantelis.antoniou@konsulko.com&gt;
Reviewed-by: Frank Rowand &lt;frank.rowand@sony.com&gt;
Reviewed-by: Philippe Ombredanne &lt;pombredanne@nexb.com&gt;
Signed-off-by: Rob Herring &lt;robh@kernel.org&gt;
</content>
</entry>
<entry>
<title>of: Spelling s/changset/changeset/</title>
<updated>2017-12-06T20:56:32Z</updated>
<author>
<name>Geert Uytterhoeven</name>
<email>geert+renesas@glider.be</email>
</author>
<published>2017-11-28T08:25:23Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=e9d92e40ac9dea5a9a185fc11227f492f0b74fc7'/>
<id>urn:sha1:e9d92e40ac9dea5a9a185fc11227f492f0b74fc7</id>
<content type='text'>
Signed-off-by: Geert Uytterhoeven &lt;geert+renesas@glider.be&gt;
Signed-off-by: Rob Herring &lt;robh@kernel.org&gt;
</content>
</entry>
<entry>
<title>of: dynamic: fix memory leak related to properties of __of_node_dup</title>
<updated>2017-10-23T16:18:44Z</updated>
<author>
<name>Lixin Wang</name>
<email>alan.1.wang@nokia-sbell.com</email>
</author>
<published>2017-10-23T03:19:53Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=070ea018fa092f2ef41bef57896665a25f05d2d8'/>
<id>urn:sha1:070ea018fa092f2ef41bef57896665a25f05d2d8</id>
<content type='text'>
If a node with no properties is dynamically added, then a property is
dynamically added to the node, then the property is dynamically removed,
the result will be node-&gt;properties == NULL and node-&gt;deadprops != NULL.

Add a separate function to release the properties in both lists.

Signed-off-by: Lixin Wang &lt;alan.1.wang@nokia-sbell.com&gt;
Reviewed-by: Frank Rowand &lt;frank.rowand@sony.com&gt;
Signed-off-by: Rob Herring &lt;robh@kernel.org&gt;
</content>
</entry>
<entry>
<title>of: overlay: detect cases where device tree may become corrupt</title>
<updated>2017-10-18T01:47:14Z</updated>
<author>
<name>Frank Rowand</name>
<email>frank.rowand@sony.com</email>
</author>
<published>2017-10-17T23:36:26Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=24789c5ce5a373dd55640f9cd79117fcc3ccc46d'/>
<id>urn:sha1:24789c5ce5a373dd55640f9cd79117fcc3ccc46d</id>
<content type='text'>
When an attempt to apply an overlay changeset fails, an effort
is made to revert any partial application of the changeset.
When an attempt to remove an overlay changeset fails, an effort
is made to re-apply any partial reversion of the changeset.

The existing code does not check for failure to recover a failed
overlay changeset application or overlay changeset revert.

Add the missing checks and flag the devicetree as corrupt if the
state of the devicetree can not be determined.

Improve and expand the returned errors to more fully reflect the
result of the effort to undo the partial effects of a failed attempt
to apply or remove an overlay changeset.

If the device tree might be corrupt, do not allow further attempts
to apply or remove an overlay changeset.

When creating an overlay changeset from an overlay device tree,
add some additional warnings if the state of the overlay device
tree is not as expected.

Signed-off-by: Frank Rowand &lt;frank.rowand@sony.com&gt;
Signed-off-by: Rob Herring &lt;robh@kernel.org&gt;
</content>
</entry>
</feed>
