<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-stable.git/drivers/of/selftest.c, branch linux-3.18.y</title>
<subtitle>Linux kernel stable tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/'/>
<entry>
<title>of/selftest: Fix testing when /aliases is missing</title>
<updated>2014-11-20T15:32:49+00:00</updated>
<author>
<name>Grant Likely</name>
<email>grant.likely@linaro.org</email>
</author>
<published>2014-11-19T17:13:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=788ec2fc2ca295a2d929986e95231214ecd8d142'/>
<id>788ec2fc2ca295a2d929986e95231214ecd8d142</id>
<content type='text'>
The /aliases node isn't always present in the device tree, but the
unittest code assumes that /aliases is there. Add a check when inserting
the testcase data to see if of_aliases needs to be updated, and undo the
settings when the nodes are removed.

Signed-off-by: Grant Likely &lt;grant.likely@linaro.org&gt;
Cc: Rob Herring &lt;robh+dt@kernel.org&gt;
Cc: Gaurav Minocha &lt;gaurav.minocha.os@gmail.com&gt;
Cc: &lt;stable@vger.kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The /aliases node isn't always present in the device tree, but the
unittest code assumes that /aliases is there. Add a check when inserting
the testcase data to see if of_aliases needs to be updated, and undo the
settings when the nodes are removed.

Signed-off-by: Grant Likely &lt;grant.likely@linaro.org&gt;
Cc: Rob Herring &lt;robh+dt@kernel.org&gt;
Cc: Gaurav Minocha &lt;gaurav.minocha.os@gmail.com&gt;
Cc: &lt;stable@vger.kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>of/selftest: Fix off-by-one error in removal path</title>
<updated>2014-11-19T17:42:57+00:00</updated>
<author>
<name>Grant Likely</name>
<email>grant.likely@linaro.org</email>
</author>
<published>2014-11-19T16:22:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=c1a2086e2d8c4eb4e8630ba752e911ec180dec67'/>
<id>c1a2086e2d8c4eb4e8630ba752e911ec180dec67</id>
<content type='text'>
The removal path for selftest data has an off by one error that causes
the code to dereference beyond the end of the nodes[] array on the first
pass through. The old code only worked by chance on a lot of platforms,
but the bug was recently exposed on aarch64.

The fix is simple. Decrement the node count before dereferencing, not
after.

Reported-by: Kevin Hilman &lt;khilman@linaro.org&gt;
Cc: Rob Herring &lt;robh+dt@kernel.org&gt;
Cc: Gaurav Minocha &lt;gaurav.minocha.os@gmail.com&gt;
Cc: &lt;stable@vger.kernel.org&gt; # v3.17+
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The removal path for selftest data has an off by one error that causes
the code to dereference beyond the end of the nodes[] array on the first
pass through. The old code only worked by chance on a lot of platforms,
but the bug was recently exposed on aarch64.

The fix is simple. Decrement the node count before dereferencing, not
after.

Reported-by: Kevin Hilman &lt;khilman@linaro.org&gt;
Cc: Rob Herring &lt;robh+dt@kernel.org&gt;
Cc: Gaurav Minocha &lt;gaurav.minocha.os@gmail.com&gt;
Cc: &lt;stable@vger.kernel.org&gt; # v3.17+
</pre>
</div>
</content>
</entry>
<entry>
<title>of: Fix overflow bug in string property parsing functions</title>
<updated>2014-11-04T10:19:48+00:00</updated>
<author>
<name>Grant Likely</name>
<email>grant.likely@linaro.org</email>
</author>
<published>2014-11-03T15:15:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=a87fa1d81a9fb5e9adca9820e16008c40ad09f33'/>
<id>a87fa1d81a9fb5e9adca9820e16008c40ad09f33</id>
<content type='text'>
The string property read helpers will run off the end of the buffer if
it is handed a malformed string property. Rework the parsers to make
sure that doesn't happen. At the same time add new test cases to make
sure the functions behave themselves.

The original implementations of of_property_read_string_index() and
of_property_count_strings() both open-coded the same block of parsing
code, each with it's own subtly different bugs. The fix here merges
functions into a single helper and makes the original functions static
inline wrappers around the helper.

One non-bugfix aspect of this patch is the addition of a new wrapper,
of_property_read_string_array(). The new wrapper is needed by the
device_properties feature that Rafael is working on and planning to
merge for v3.19. The implementation is identical both with and without
the new static inline wrapper, so it just got left in to reduce the
churn on the header file.

Signed-off-by: Grant Likely &lt;grant.likely@linaro.org&gt;
Cc: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Cc: Mika Westerberg &lt;mika.westerberg@linux.intel.com&gt;
Cc: Rob Herring &lt;robh+dt@kernel.org&gt;
Cc: Arnd Bergmann &lt;arnd@arndb.de&gt;
Cc: Darren Hart &lt;darren.hart@intel.com&gt;
Cc: &lt;stable@vger.kernel.org&gt;  # v3.3+: Drop selftest hunks that don't apply
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The string property read helpers will run off the end of the buffer if
it is handed a malformed string property. Rework the parsers to make
sure that doesn't happen. At the same time add new test cases to make
sure the functions behave themselves.

The original implementations of of_property_read_string_index() and
of_property_count_strings() both open-coded the same block of parsing
code, each with it's own subtly different bugs. The fix here merges
functions into a single helper and makes the original functions static
inline wrappers around the helper.

One non-bugfix aspect of this patch is the addition of a new wrapper,
of_property_read_string_array(). The new wrapper is needed by the
device_properties feature that Rafael is working on and planning to
merge for v3.19. The implementation is identical both with and without
the new static inline wrapper, so it just got left in to reduce the
churn on the header file.

Signed-off-by: Grant Likely &lt;grant.likely@linaro.org&gt;
Cc: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Cc: Mika Westerberg &lt;mika.westerberg@linux.intel.com&gt;
Cc: Rob Herring &lt;robh+dt@kernel.org&gt;
Cc: Arnd Bergmann &lt;arnd@arndb.de&gt;
Cc: Darren Hart &lt;darren.hart@intel.com&gt;
Cc: &lt;stable@vger.kernel.org&gt;  # v3.3+: Drop selftest hunks that don't apply
</pre>
</div>
</content>
</entry>
<entry>
<title>of/selftest: Move hash table off stack to fix large frame size</title>
<updated>2014-10-07T10:30:31+00:00</updated>
<author>
<name>Grant Likely</name>
<email>grant.likely@linaro.org</email>
</author>
<published>2014-10-07T10:30:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=2118f4b8dfc666c3e4a9e262beca79636a0852fe'/>
<id>2118f4b8dfc666c3e4a9e262beca79636a0852fe</id>
<content type='text'>
The new testcase that checks phandle consistency was using a hash table
on the stack which made the frame size much large than it should be. Fix
the problem by moving the hash table into the file scope.

Signed-off-by: Grant Likely &lt;grant.likely@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The new testcase that checks phandle consistency was using a hash table
on the stack which made the frame size much large than it should be. Fix
the problem by moving the hash table into the file scope.

Signed-off-by: Grant Likely &lt;grant.likely@linaro.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>of/selftest: Use the resolver to fixup phandles</title>
<updated>2014-10-04T20:24:35+00:00</updated>
<author>
<name>Grant Likely</name>
<email>grant.likely@linaro.org</email>
</author>
<published>2014-10-02T13:36:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=2eb46da2a760e5764c48b752a5ef320e02b96b21'/>
<id>2eb46da2a760e5764c48b752a5ef320e02b96b21</id>
<content type='text'>
The selftest data ends up causing duplicate phandles in the live tree
for the time that the testcase data is inserted into the live tree. This
is obviously a bad situation because anything attempting to read the
tree while the selftests are running make resolve phandles to one of the
testcase data nodes. Fix the problem by using the of_resolve_phandles()
function to eliminate duplicates.

Signed-off-by: Grant Likely &lt;grant.likely@linaro.org&gt;
Cc: Pantelis Antoniou &lt;pantelis.antoniou@konsulko.com&gt;
Cc: Gaurav Minocha &lt;gaurav.minocha.os@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The selftest data ends up causing duplicate phandles in the live tree
for the time that the testcase data is inserted into the live tree. This
is obviously a bad situation because anything attempting to read the
tree while the selftests are running make resolve phandles to one of the
testcase data nodes. Fix the problem by using the of_resolve_phandles()
function to eliminate duplicates.

Signed-off-by: Grant Likely &lt;grant.likely@linaro.org&gt;
Cc: Pantelis Antoniou &lt;pantelis.antoniou@konsulko.com&gt;
Cc: Gaurav Minocha &lt;gaurav.minocha.os@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>of/selftest: Add a test for duplicate phandles</title>
<updated>2014-10-04T20:20:19+00:00</updated>
<author>
<name>Grant Likely</name>
<email>grant.likely@linaro.org</email>
</author>
<published>2014-10-02T12:09:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=841ec21357eee222416e3b7f1b6ef23cfc6ee43f'/>
<id>841ec21357eee222416e3b7f1b6ef23cfc6ee43f</id>
<content type='text'>
All phandles in the tree should be unique. Add a testcase to make sure
that this is so.

Note: this testcase fails on the current kernel because the selftest
code itself ends up adding duplicate phandles. Before this testcase is
merged the selftest code needs to be modified to resolve phandles before
adding them.

Signed-off-by: Grant Likely &lt;grant.likely@linaro.org&gt;
Cc: Pantelis Antoniou &lt;pantelis.antoniou@konsulko.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
All phandles in the tree should be unique. Add a testcase to make sure
that this is so.

Note: this testcase fails on the current kernel because the selftest
code itself ends up adding duplicate phandles. Before this testcase is
merged the selftest code needs to be modified to resolve phandles before
adding them.

Signed-off-by: Grant Likely &lt;grant.likely@linaro.org&gt;
Cc: Pantelis Antoniou &lt;pantelis.antoniou@konsulko.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>of/selftest: Test structure of device tree</title>
<updated>2014-10-04T20:20:13+00:00</updated>
<author>
<name>Grant Likely</name>
<email>grant.likely@linaro.org</email>
</author>
<published>2014-10-01T16:40:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=f2051d6a88cd03f74221da887f56d778a1b2f1f1'/>
<id>f2051d6a88cd03f74221da887f56d778a1b2f1f1</id>
<content type='text'>
Add a testcase to verify that the device tree is properly constructed
and the lists are in a correct order. The new testcase gets run twice;
once after adding the testcase data, and once after removing it again.
It is run twice to make sure adding and removing the testcase data
doesn't corrupt the data structure.

Signed-off-by: Grant Likely &lt;grant.likely@linaro.org&gt;
Cc: Gaurav Minocha &lt;gaurav.minocha.os@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add a testcase to verify that the device tree is properly constructed
and the lists are in a correct order. The new testcase gets run twice;
once after adding the testcase data, and once after removing it again.
It is run twice to make sure adding and removing the testcase data
doesn't corrupt the data structure.

Signed-off-by: Grant Likely &lt;grant.likely@linaro.org&gt;
Cc: Gaurav Minocha &lt;gaurav.minocha.os@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>of: Fix NULL dereference in selftest removal code</title>
<updated>2014-10-01T16:01:43+00:00</updated>
<author>
<name>Grant Likely</name>
<email>grant.likely@linaro.org</email>
</author>
<published>2014-10-01T15:57:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=e66c98c7a0eacc33a9369a3ec086740044eb986c'/>
<id>e66c98c7a0eacc33a9369a3ec086740044eb986c</id>
<content type='text'>
The selftest code removes its testcase data from the live tree when
exiting, but if the testcases data tree contains an empty child of the
root, then it causes an oops due to a NULL dereference. The reason is
that the code tries to directly dereference the child pointer without
checking first if a child is actually there.

The solution is to pass the parent node into detach_node_and_children()
instead of trying to pass the child. This required removing the code
that attempts to remove all of the sibling nodes in
detach_node_and_children(), which was never sensible in the first place.

At the same time add a check to make sure the bounds of the nodes list
are not exceeded by the testdata tree. If they are then abort.

Signed-off-by: Grant Likely &lt;grant.likely@linaro.org&gt;
Cc: Gaurav Minocha &lt;gaurav.minocha.os@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The selftest code removes its testcase data from the live tree when
exiting, but if the testcases data tree contains an empty child of the
root, then it causes an oops due to a NULL dereference. The reason is
that the code tries to directly dereference the child pointer without
checking first if a child is actually there.

The solution is to pass the parent node into detach_node_and_children()
instead of trying to pass the child. This required removing the code
that attempts to remove all of the sibling nodes in
detach_node_and_children(), which was never sensible in the first place.

At the same time add a check to make sure the bounds of the nodes list
are not exceeded by the testdata tree. If they are then abort.

Signed-off-by: Grant Likely &lt;grant.likely@linaro.org&gt;
Cc: Gaurav Minocha &lt;gaurav.minocha.os@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Enabling OF selftest to run without machine's devicetree</title>
<updated>2014-08-16T08:03:56+00:00</updated>
<author>
<name>Gaurav Minocha</name>
<email>gaurav.minocha.os@gmail.com</email>
</author>
<published>2014-07-26T19:48:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=b951f9dc7f25fc1e39aafda5edb4b47b38285d9f'/>
<id>b951f9dc7f25fc1e39aafda5edb4b47b38285d9f</id>
<content type='text'>
If there is no devicetree present, this patch adds the selftest
data as a live devicetree. It also removes the same after the
testcase execution is complete.

Tested with and without machine's devicetree.

Signed-off-by: Gaurav Minocha &lt;gaurav.minocha.os@gmail.com&gt;
Signed-off-by: Grant Likely &lt;grant.likely@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If there is no devicetree present, this patch adds the selftest
data as a live devicetree. It also removes the same after the
testcase execution is complete.

Tested with and without machine's devicetree.

Signed-off-by: Gaurav Minocha &lt;gaurav.minocha.os@gmail.com&gt;
Signed-off-by: Grant Likely &lt;grant.likely@linaro.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch 'devicetree/next-overlay' into devicetree/next</title>
<updated>2014-08-11T13:06:23+00:00</updated>
<author>
<name>Grant Likely</name>
<email>grant.likely@linaro.org</email>
</author>
<published>2014-08-11T13:06:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=663d3f7c2e5e1b018a4c53277ccfde40329d98ca'/>
<id>663d3f7c2e5e1b018a4c53277ccfde40329d98ca</id>
<content type='text'>
Conflicts:
	drivers/of/testcase-data/testcases.dts
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Conflicts:
	drivers/of/testcase-data/testcases.dts
</pre>
</div>
</content>
</entry>
</feed>
