<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/drivers/of, branch v4.4.29</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.4.29</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.4.29'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2016-09-07T06:32:41Z</updated>
<entry>
<title>of: fix reference counting in of_graph_get_endpoint_by_regs</title>
<updated>2016-09-07T06:32:41Z</updated>
<author>
<name>Lucas Stach</name>
<email>l.stach@pengutronix.de</email>
</author>
<published>2016-08-15T12:58:43Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=51ed10c4ffd7742d160c02f7dd6bab634b2c03ef'/>
<id>urn:sha1:51ed10c4ffd7742d160c02f7dd6bab634b2c03ef</id>
<content type='text'>
commit 34276bb062b8449b3b0a208c9b848a1a27920075 upstream.

The called of_graph_get_next_endpoint() already decrements the refcount
of the prev node, so it is wrong to do it again in the calling function.

Use the for_each_endpoint_of_node() helper to interate through the
endpoint OF nodes, which already does the right thing and simplifies
the code a bit.

Fixes: 8ccd0d0ca041
(of: add helper for getting endpoint node of specific identifiers)
Reported-by: David Jander &lt;david@protonic.nl&gt;
Signed-off-by: Lucas Stach &lt;l.stach@pengutronix.de&gt;
Acked-by: Philipp Zabel &lt;p.zabel@pengutronix.de&gt;
Signed-off-by: Rob Herring &lt;robh@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>of: fix memory leak related to safe_name()</title>
<updated>2016-08-20T16:09:25Z</updated>
<author>
<name>Frank Rowand</name>
<email>frank.rowand@am.sony.com</email>
</author>
<published>2016-06-16T17:51:46Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=2c00c2171c0d525f49e8c36d79082ee33fba8b10'/>
<id>urn:sha1:2c00c2171c0d525f49e8c36d79082ee33fba8b10</id>
<content type='text'>
commit d9fc880723321dbf16b2981e3f3e916b73942210 upstream.

Fix a memory leak resulting from memory allocation in safe_name().
This patch fixes all call sites of safe_name().

Mathieu Malaterre reported the memory leak on boot:

On my PowerMac device-tree would generate a duplicate name:

[    0.023043] device-tree: Duplicate name in PowerPC,G4@0, renamed to "l2-cache#1"

in this case a newly allocated name is generated by `safe_name`. However
in this case it is never deallocated.

The bug was found using kmemleak reported as:

unreferenced object 0xdf532e60 (size 32):
  comm "swapper", pid 1, jiffies 4294892300 (age 1993.532s)
  hex dump (first 32 bytes):
    6c 32 2d 63 61 63 68 65 23 31 00 dd e4 dd 1e c2  l2-cache#1......
    ec d4 ba ce 04 ec cc de 8e 85 e9 ca c4 ec cc 9e  ................
  backtrace:
    [&lt;c02d3350&gt;] kvasprintf+0x64/0xc8
    [&lt;c02d3400&gt;] kasprintf+0x4c/0x5c
    [&lt;c0453814&gt;] safe_name.isra.1+0x80/0xc4
    [&lt;c04545d8&gt;] __of_attach_node_sysfs+0x6c/0x11c
    [&lt;c075f21c&gt;] of_core_init+0x8c/0xf8
    [&lt;c0729594&gt;] kernel_init_freeable+0xd4/0x208
    [&lt;c00047e8&gt;] kernel_init+0x24/0x11c
    [&lt;c00158ec&gt;] ret_from_kernel_thread+0x5c/0x64

Link: https://bugzilla.kernel.org/show_bug.cgi?id=120331

Signed-off-by: Frank Rowand &lt;frank.rowand@am.sony.com&gt;
Reported-by: mathieu.malaterre@gmail.com
Tested-by: Mathieu Malaterre &lt;mathieu.malaterre@gmail.com&gt;
Signed-off-by: Rob Herring &lt;robh@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>of: irq: fix of_irq_get[_byname]() kernel-doc</title>
<updated>2016-07-27T16:47:29Z</updated>
<author>
<name>Sergei Shtylyov</name>
<email>sergei.shtylyov@cogentembedded.com</email>
</author>
<published>2016-05-28T20:02:50Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=c5f2e833575b3ad7ab59a90d66d7f1a73e7afad1'/>
<id>urn:sha1:c5f2e833575b3ad7ab59a90d66d7f1a73e7afad1</id>
<content type='text'>
commit 3993546646baf1dab5f5c4f7d9bb58f2046fd1c1 upstream.

The kernel-doc for the of_irq_get[_byname]()  is clearly inadequate in
describing the return values -- of_irq_get_byname() is documented better
than of_irq_get() but it  still doesn't mention that 0 is returned iff
irq_create_of_mapping() fails (it doesn't return an error code in this
case). Document all possible return value variants, making the writing
of the word "IRQ" consistent, while at it...

Fixes: 9ec36cafe43b ("of/irq: do irq resolution in platform_get_irq")
Fixes: ad69674e73a1 ("of/irq: do irq resolution in platform_get_irq_byname()")
Signed-off-by: Sergei Shtylyov &lt;sergei.shtylyov@cogentembedded.com&gt;
Signed-off-by: Rob Herring &lt;robh@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>of: alloc anywhere from memblock if range not specified</title>
<updated>2016-04-12T16:08:55Z</updated>
<author>
<name>Vinayak Menon</name>
<email>vinmenon@codeaurora.org</email>
</author>
<published>2016-02-22T13:45:44Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=da191fac4bfa7ba6372e10365591a2759a3298ea'/>
<id>urn:sha1:da191fac4bfa7ba6372e10365591a2759a3298ea</id>
<content type='text'>
commit e53b50c0cbe392c946807abf7d07615a3c588642 upstream.

early_init_dt_alloc_reserved_memory_arch passes end as 0 to
__memblock_alloc_base, when limits are not specified. But
__memblock_alloc_base takes end value of 0 as MEMBLOCK_ALLOC_ACCESSIBLE
and limits the end to memblock.current_limit. This results in regions
never being placed in HIGHMEM area, for e.g. CMA.
Let __memblock_alloc_base allocate from anywhere in memory if limits are
not specified.

Acked-by: Marek Szyprowski &lt;m.szyprowski@samsung.com&gt;
Signed-off-by: Vinayak Menon &lt;vinmenon@codeaurora.org&gt;
Signed-off-by: Rob Herring &lt;robh@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>of/irq: Fix msi-map calculation for nonzero rid-base</title>
<updated>2016-03-03T23:07:29Z</updated>
<author>
<name>Robin Murphy</name>
<email>robin.murphy@arm.com</email>
</author>
<published>2016-02-09T11:04:45Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=e1d61091db0ba3ef805510bb5fee46dedd7c8734'/>
<id>urn:sha1:e1d61091db0ba3ef805510bb5fee46dedd7c8734</id>
<content type='text'>
commit 5d589d81acf974d23af98044aac56c6339d659f8 upstream.

The existing msi-map code is fine for shifting the entire RID space
upwards, but attempting finer-grained remapping reveals a bug. It turns
out that we are mistakenly treating the msi-base part as an offset, not
as a new base to remap onto, so things get squiffy when rid-base is
nonzero. Fix this, and at the same time add a sanity check against
having msi-map-mask clash with a nonzero rid-base, as that's another
thing one can easily get wrong.

Signed-off-by: Robin Murphy &lt;robin.murphy@arm.com&gt;
Reviewed-by: Marc Zyngier &lt;marc.zyngier@arm.com&gt;
Tested-by: Stuart Yoder &lt;stuart.yoder@nxp.com&gt;
Acked-by: Mark Rutland &lt;mark.rutland@arm.com&gt;
Acked-by: David Daney &lt;david.daney@cavium.com&gt;
Signed-off-by: Rob Herring &lt;robh@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>of/irq: Export of_irq_find_parent again</title>
<updated>2015-12-09T15:08:36Z</updated>
<author>
<name>Carlo Caione</name>
<email>carlo@endlessm.com</email>
</author>
<published>2015-12-01T16:24:17Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=4c3141e09cfa6460bfcd5e90f73e498db654c917'/>
<id>urn:sha1:4c3141e09cfa6460bfcd5e90f73e498db654c917</id>
<content type='text'>
of_irq_find_parent was made static since it had no users outside of
of_irq.c. Export it again since we are going to use it again.

Signed-off-by: Carlo Caione &lt;carlo@endlessm.com&gt;
[robh: move of_irq_find_parent to correct ifdef section]
Signed-off-by: Rob Herring &lt;robh@kernel.org&gt;
</content>
</entry>
<entry>
<title>of/fdt: Add mutex protection for calls to __unflatten_device_tree()</title>
<updated>2015-12-08T15:50:42Z</updated>
<author>
<name>Guenter Roeck</name>
<email>linux@roeck-us.net</email>
</author>
<published>2015-12-06T00:13:53Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=f8062386671a596ca7022c61727a14a25679a0a1'/>
<id>urn:sha1:f8062386671a596ca7022c61727a14a25679a0a1</id>
<content type='text'>
__unflatten_device_tree() calls unflatten_dt_node(), which declares
a static variable. It is therefore not reentrant.

One of the callers of __unflatten_device_tree(), unflatten_device_tree(),
is only called once during early initialization and does not need to be
protected. The other caller, of_fdt_unflatten_tree(), can be called at
any time, possibly multiple times in parallel. This can happen, for
example, if multiple devicetree overlays have to be loaded and installed.

Without this protection, errors such as the following may be seen.

kernel: End of tree marker overwritten: e6a3a458
kernel: find_target_node:
	Failed to find target-indirect node at /fragment@0
kernel: __of_overlay_create: of_build_overlay_info() failed for tree@/

Add a mutex to of_fdt_unflatten_tree() to make the call reentrant.

Cc: Pantelis Antoniou &lt;pantelis.antoniou@konsulko.com&gt;
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Cc: stable@vger.kernel.org # v4.1+
Signed-off-by: Rob Herring &lt;robh@kernel.org&gt;
</content>
</entry>
<entry>
<title>of/address: fix typo in comment block of of_translate_one()</title>
<updated>2015-11-30T23:57:01Z</updated>
<author>
<name>Masahiro Yamada</name>
<email>yamada.masahiro@socionext.com</email>
</author>
<published>2015-11-30T06:22:37Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=ba85edbe0d39710dc74a2a9c6f90929b5722a53b'/>
<id>urn:sha1:ba85edbe0d39710dc74a2a9c6f90929b5722a53b</id>
<content type='text'>
Remove the "not" before "cannot".

I am fixing the comment block style while I am here.

Signed-off-by: Masahiro Yamada &lt;yamada.masahiro@socionext.com&gt;
Signed-off-by: Rob Herring &lt;robh@kernel.org&gt;
</content>
</entry>
<entry>
<title>of: do not use 0x in front of %pa</title>
<updated>2015-11-30T23:56:54Z</updated>
<author>
<name>Dmitry V. Krivenok</name>
<email>krivenok.dmitry@gmail.com</email>
</author>
<published>2015-11-30T20:45:48Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=78bb2abe09d6bd15eeee7250f2fa0cb76432a8a2'/>
<id>urn:sha1:78bb2abe09d6bd15eeee7250f2fa0cb76432a8a2</id>
<content type='text'>
Signed-off-by: Dmitry V. Krivenok &lt;krivenok.dmitry@gmail.com&gt;
Signed-off-by: Rob Herring &lt;robh@kernel.org&gt;
</content>
</entry>
<entry>
<title>of: Fix comparison of reserved memory regions</title>
<updated>2015-11-30T23:56:44Z</updated>
<author>
<name>Michael Ellerman</name>
<email>mpe@ellerman.id.au</email>
</author>
<published>2015-11-18T10:46:38Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=9eb8cd2b0780bca0719e754e7bdcf5f368f001bd'/>
<id>urn:sha1:9eb8cd2b0780bca0719e754e7bdcf5f368f001bd</id>
<content type='text'>
In order to check for overlapping reserved memory regions, we first need
to sort the array of memory regions. This is implemented using sort(),
and a custom comparison function __rmem_cmp().

Unfortunatley __rmem_cmp() doesn't work in all cases. Because the two
base values are phys_addr_t, they may be u64 on some platforms, in which
case subtracting one from the other and then (implicitly) casting to int
does not give us the -ve/0/+ve value we need.

This leads to incorrect reports about overlaps, eg:

  ibm,slw-image@1ffe600000 (0x0000001ffe600000--0x0000001ffe700000) overlaps with
  ibm,firmware-allocs-memory@1000000000 (0x0000001000000000--0x0000001000dc0200)

Fix it by just doing the standard double if and return 0 logic.

Fixes: ae1add247bf8 ("of: Check for overlap in reserved memory regions")
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Signed-off-by: Rob Herring &lt;robh@kernel.org&gt;
</content>
</entry>
</feed>
