<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/of/of_numa.c, branch v4.9.90</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>of: fix "/cpus" reference leak in of_numa_parse_cpu_nodes()</title>
<updated>2017-05-25T13:44:37+00:00</updated>
<author>
<name>Tyrel Datwyler</name>
<email>tyreld@linux.vnet.ibm.com</email>
</author>
<published>2017-04-18T00:29:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=80cdf2065bf0e10862b400715672555ef3e49a3e'/>
<id>80cdf2065bf0e10862b400715672555ef3e49a3e</id>
<content type='text'>
commit b8475cbee5ab2eac05f9cd5dbcc94c453d3cbf10 upstream.

The call to of_find_node_by_path("/cpus") returns the cpus device_node
with its reference count incremented. There is no matching of_node_put()
call in of_numa_parse_cpu_nodes() which results in a leaked reference
to the "/cpus" node.

This patch adds an of_node_put() to release the reference.

fixes: 298535c00a2c ("of, numa: Add NUMA of binding implementation.")
Signed-off-by: Tyrel Datwyler &lt;tyreld@linux.vnet.ibm.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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit b8475cbee5ab2eac05f9cd5dbcc94c453d3cbf10 upstream.

The call to of_find_node_by_path("/cpus") returns the cpus device_node
with its reference count incremented. There is no matching of_node_put()
call in of_numa_parse_cpu_nodes() which results in a leaked reference
to the "/cpus" node.

This patch adds an of_node_put() to release the reference.

fixes: 298535c00a2c ("of, numa: Add NUMA of binding implementation.")
Signed-off-by: Tyrel Datwyler &lt;tyreld@linux.vnet.ibm.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;

</pre>
</div>
</content>
</entry>
<entry>
<title>of, numa: Return NUMA_NO_NODE from disable of_node_to_nid() if nid not possible.</title>
<updated>2017-01-09T07:32:25+00:00</updated>
<author>
<name>David Daney</name>
<email>david.daney@cavium.com</email>
</author>
<published>2016-10-28T21:15:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=6838ac125324b91eeab5ccaf99e4a9bd1f8a7895'/>
<id>6838ac125324b91eeab5ccaf99e4a9bd1f8a7895</id>
<content type='text'>
commit b6cc9474e2dd9f0c19b694b40961d81117f1e918 upstream.

On arm64 NUMA kernels we can pass "numa=off" on the command line to
disable NUMA.  A side effect of this is that kmalloc_node() calls to
non-zero nodes will crash the system with an OOPS:

[    0.000000] ITS@0x0000901000020000: allocated 2097152 Devices @10002000000 (flat, esz 8, psz 64K, shr 1)
[    0.000000] Unable to handle kernel NULL pointer dereference at virtual address 00001680
[    0.000000] pgd = fffffc0009470000
[    0.000000] [00001680] *pgd=0000010ffff90003, *pud=0000010ffff90003, *pmd=0000010ffff90003, *pte=0000000000000000
[    0.000000] Internal error: Oops: 96000006 [#1] SMP
.
.
.
[    0.000000] [&lt;fffffc00081c8950&gt;] __alloc_pages_nodemask+0xa4/0xe68
[    0.000000] [&lt;fffffc000821fa70&gt;] new_slab+0xd0/0x564
[    0.000000] [&lt;fffffc0008221e24&gt;] ___slab_alloc+0x2e4/0x514
[    0.000000] [&lt;fffffc0008239498&gt;] __slab_alloc+0x48/0x58
[    0.000000] [&lt;fffffc0008222c20&gt;] __kmalloc_node+0xd0/0x2dc
[    0.000000] [&lt;fffffc0008115374&gt;] __irq_domain_add+0x7c/0x164
[    0.000000] [&lt;fffffc0008b461dc&gt;] its_probe+0x784/0x81c
[    0.000000] [&lt;fffffc0008b462bc&gt;] its_init+0x48/0x1b0
[    0.000000] [&lt;fffffc0008b4543c&gt;] gic_init_bases+0x228/0x360
[    0.000000] [&lt;fffffc0008b456bc&gt;] gic_of_init+0x148/0x1cc
[    0.000000] [&lt;fffffc0008b5aec8&gt;] of_irq_init+0x184/0x298
[    0.000000] [&lt;fffffc0008b43f9c&gt;] irqchip_init+0x14/0x38
[    0.000000] [&lt;fffffc0008b12d60&gt;] init_IRQ+0xc/0x30
[    0.000000] [&lt;fffffc0008b10a3c&gt;] start_kernel+0x240/0x3b8
[    0.000000] [&lt;fffffc0008b101c4&gt;] __primary_switched+0x30/0x6c
[    0.000000] Code: 912ec2a0 b9403809 0a0902fb 37b007db (f9400300)
.
.
.

This is caused by code like this in kernel/irq/irqdomain.c

    domain = kzalloc_node(sizeof(*domain) + (sizeof(unsigned int) * size),
                  GFP_KERNEL, of_node_to_nid(of_node));

When NUMA is disabled, the concept of a node is really undefined, so
of_node_to_nid() should unconditionally return NUMA_NO_NODE.

Fix by returning NUMA_NO_NODE when the nid is not in the set of
possible nodes.

Reported-by: Gilbert Netzer &lt;noname@pdc.kth.se&gt;
Signed-off-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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit b6cc9474e2dd9f0c19b694b40961d81117f1e918 upstream.

On arm64 NUMA kernels we can pass "numa=off" on the command line to
disable NUMA.  A side effect of this is that kmalloc_node() calls to
non-zero nodes will crash the system with an OOPS:

[    0.000000] ITS@0x0000901000020000: allocated 2097152 Devices @10002000000 (flat, esz 8, psz 64K, shr 1)
[    0.000000] Unable to handle kernel NULL pointer dereference at virtual address 00001680
[    0.000000] pgd = fffffc0009470000
[    0.000000] [00001680] *pgd=0000010ffff90003, *pud=0000010ffff90003, *pmd=0000010ffff90003, *pte=0000000000000000
[    0.000000] Internal error: Oops: 96000006 [#1] SMP
.
.
.
[    0.000000] [&lt;fffffc00081c8950&gt;] __alloc_pages_nodemask+0xa4/0xe68
[    0.000000] [&lt;fffffc000821fa70&gt;] new_slab+0xd0/0x564
[    0.000000] [&lt;fffffc0008221e24&gt;] ___slab_alloc+0x2e4/0x514
[    0.000000] [&lt;fffffc0008239498&gt;] __slab_alloc+0x48/0x58
[    0.000000] [&lt;fffffc0008222c20&gt;] __kmalloc_node+0xd0/0x2dc
[    0.000000] [&lt;fffffc0008115374&gt;] __irq_domain_add+0x7c/0x164
[    0.000000] [&lt;fffffc0008b461dc&gt;] its_probe+0x784/0x81c
[    0.000000] [&lt;fffffc0008b462bc&gt;] its_init+0x48/0x1b0
[    0.000000] [&lt;fffffc0008b4543c&gt;] gic_init_bases+0x228/0x360
[    0.000000] [&lt;fffffc0008b456bc&gt;] gic_of_init+0x148/0x1cc
[    0.000000] [&lt;fffffc0008b5aec8&gt;] of_irq_init+0x184/0x298
[    0.000000] [&lt;fffffc0008b43f9c&gt;] irqchip_init+0x14/0x38
[    0.000000] [&lt;fffffc0008b12d60&gt;] init_IRQ+0xc/0x30
[    0.000000] [&lt;fffffc0008b10a3c&gt;] start_kernel+0x240/0x3b8
[    0.000000] [&lt;fffffc0008b101c4&gt;] __primary_switched+0x30/0x6c
[    0.000000] Code: 912ec2a0 b9403809 0a0902fb 37b007db (f9400300)
.
.
.

This is caused by code like this in kernel/irq/irqdomain.c

    domain = kzalloc_node(sizeof(*domain) + (sizeof(unsigned int) * size),
                  GFP_KERNEL, of_node_to_nid(of_node));

When NUMA is disabled, the concept of a node is really undefined, so
of_node_to_nid() should unconditionally return NUMA_NO_NODE.

Fix by returning NUMA_NO_NODE when the nid is not in the set of
possible nodes.

Reported-by: Gilbert Netzer &lt;noname@pdc.kth.se&gt;
Signed-off-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;

</pre>
</div>
</content>
</entry>
<entry>
<title>of_numa: Use pr_fmt()</title>
<updated>2016-09-09T13:59:09+00:00</updated>
<author>
<name>Kefeng Wang</name>
<email>wangkefeng.wang@huawei.com</email>
</author>
<published>2016-09-01T06:54:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=ad02180515d4856702bc656f754e9df83ab0345b'/>
<id>ad02180515d4856702bc656f754e9df83ab0345b</id>
<content type='text'>
Use pr_fmt to prefix kernel output.

Signed-off-by: Kefeng Wang &lt;wangkefeng.wang@huawei.com&gt;
Acked-by: Rob Herring &lt;robh@kernel.org&gt;
Signed-off-by: Will Deacon &lt;will.deacon@arm.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Use pr_fmt to prefix kernel output.

Signed-off-by: Kefeng Wang &lt;wangkefeng.wang@huawei.com&gt;
Acked-by: Rob Herring &lt;robh@kernel.org&gt;
Signed-off-by: Will Deacon &lt;will.deacon@arm.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>of_numa: Use of_get_next_parent to simplify code</title>
<updated>2016-09-09T13:59:08+00:00</updated>
<author>
<name>Kefeng Wang</name>
<email>wangkefeng.wang@huawei.com</email>
</author>
<published>2016-09-01T06:54:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=837dae1b4308f2dfc9c5bc76c367553670198c63'/>
<id>837dae1b4308f2dfc9c5bc76c367553670198c63</id>
<content type='text'>
Use of_get_next_parent() instead of open-code.

Signed-off-by: Kefeng Wang &lt;wangkefeng.wang@huawei.com&gt;
Acked-by: Rob Herring &lt;robh@kernel.org&gt;
Signed-off-by: Will Deacon &lt;will.deacon@arm.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Use of_get_next_parent() instead of open-code.

Signed-off-by: Kefeng Wang &lt;wangkefeng.wang@huawei.com&gt;
Acked-by: Rob Herring &lt;robh@kernel.org&gt;
Signed-off-by: Will Deacon &lt;will.deacon@arm.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>of/numa: remove a duplicated warning</title>
<updated>2016-09-09T13:59:08+00:00</updated>
<author>
<name>Zhen Lei</name>
<email>thunder.leizhen@huawei.com</email>
</author>
<published>2016-09-01T06:54:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=9787ed6e5cee7a62320f3014eb5e7b373502c292'/>
<id>9787ed6e5cee7a62320f3014eb5e7b373502c292</id>
<content type='text'>
This warning has been printed in of_numa_parse_cpu_nodes before.

Signed-off-by: Zhen Lei &lt;thunder.leizhen@huawei.com&gt;
Acked-by: Rob Herring &lt;robh@kernel.org&gt;
Signed-off-by: Will Deacon &lt;will.deacon@arm.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This warning has been printed in of_numa_parse_cpu_nodes before.

Signed-off-by: Zhen Lei &lt;thunder.leizhen@huawei.com&gt;
Acked-by: Rob Herring &lt;robh@kernel.org&gt;
Signed-off-by: Will Deacon &lt;will.deacon@arm.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>of/numa: add nid check for memory block</title>
<updated>2016-09-09T13:59:08+00:00</updated>
<author>
<name>Zhen Lei</name>
<email>thunder.leizhen@huawei.com</email>
</author>
<published>2016-09-01T06:54:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=571a588fec2de4efd6043805ab0b017c67b63a4d'/>
<id>571a588fec2de4efd6043805ab0b017c67b63a4d</id>
<content type='text'>
If the numa-id which was configured in memory@ devicetree node is greater
than MAX_NUMNODES, we should report a warning. We have done this for cpus
and distance-map dt nodes, this patch help them to be consistent.

Acked-by: Rob Herring &lt;robh@kernel.org&gt;
Signed-off-by: Zhen Lei &lt;thunder.leizhen@huawei.com&gt;
Signed-off-by: Will Deacon &lt;will.deacon@arm.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If the numa-id which was configured in memory@ devicetree node is greater
than MAX_NUMNODES, we should report a warning. We have done this for cpus
and distance-map dt nodes, this patch help them to be consistent.

Acked-by: Rob Herring &lt;robh@kernel.org&gt;
Signed-off-by: Zhen Lei &lt;thunder.leizhen@huawei.com&gt;
Signed-off-by: Will Deacon &lt;will.deacon@arm.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>of/numa: fix a memory@ node can only contains one memory block</title>
<updated>2016-09-09T13:59:08+00:00</updated>
<author>
<name>Zhen Lei</name>
<email>thunder.leizhen@huawei.com</email>
</author>
<published>2016-09-01T06:54:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=84b14256c18c967afd3cf4ee2df09535587154e0'/>
<id>84b14256c18c967afd3cf4ee2df09535587154e0</id>
<content type='text'>
For a normal memory@ devicetree node, its reg property can contains more
memory blocks.

Because we don't known how many memory blocks maybe contained, so we try
from index=0, increase 1 until error returned(the end).

Signed-off-by: Zhen Lei &lt;thunder.leizhen@huawei.com&gt;
Acked-by: Rob Herring &lt;robh@kernel.org&gt;
Signed-off-by: Will Deacon &lt;will.deacon@arm.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
For a normal memory@ devicetree node, its reg property can contains more
memory blocks.

Because we don't known how many memory blocks maybe contained, so we try
from index=0, increase 1 until error returned(the end).

Signed-off-by: Zhen Lei &lt;thunder.leizhen@huawei.com&gt;
Acked-by: Rob Herring &lt;robh@kernel.org&gt;
Signed-off-by: Will Deacon &lt;will.deacon@arm.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>of/numa: remove a duplicated pr_debug information</title>
<updated>2016-09-09T13:59:08+00:00</updated>
<author>
<name>Zhen Lei</name>
<email>thunder.leizhen@huawei.com</email>
</author>
<published>2016-09-01T06:54:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=16a82f06c40301045e4c05297ea93b85595dbbc4'/>
<id>16a82f06c40301045e4c05297ea93b85595dbbc4</id>
<content type='text'>
This information will be printed in the subfunction numa_add_memblk.
They are not the same, but very similar.

Signed-off-by: Zhen Lei &lt;thunder.leizhen@huawei.com&gt;
Acked-by: Rob Herring &lt;robh@kernel.org&gt;
Signed-off-by: Will Deacon &lt;will.deacon@arm.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This information will be printed in the subfunction numa_add_memblk.
They are not the same, but very similar.

Signed-off-by: Zhen Lei &lt;thunder.leizhen@huawei.com&gt;
Acked-by: Rob Herring &lt;robh@kernel.org&gt;
Signed-off-by: Will Deacon &lt;will.deacon@arm.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>arm64, NUMA: rework numa_add_memblk()</title>
<updated>2016-05-30T12:27:07+00:00</updated>
<author>
<name>Hanjun Guo</name>
<email>hanjun.guo@linaro.org</email>
</author>
<published>2016-05-24T22:35:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=8ccbbdaa2bc06f7b11fec7f44bf2501786a189ba'/>
<id>8ccbbdaa2bc06f7b11fec7f44bf2501786a189ba</id>
<content type='text'>
Rework numa_add_memblk() to update the parameter "u64 size" to "u64
end", this will make it consistent with x86 and simplifies the arm64
ACPI NUMA code to be added later.

Signed-off-by: Hanjun Guo &lt;hanjun.guo@linaro.org&gt;
Signed-off-by: Robert Richter &lt;rrichter@cavium.com&gt;
Signed-off-by: David Daney &lt;david.daney@cavium.com&gt;
Acked-by: Catalin Marinas &lt;catalin.marinas@arm.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Rework numa_add_memblk() to update the parameter "u64 size" to "u64
end", this will make it consistent with x86 and simplifies the arm64
ACPI NUMA code to be added later.

Signed-off-by: Hanjun Guo &lt;hanjun.guo@linaro.org&gt;
Signed-off-by: Robert Richter &lt;rrichter@cavium.com&gt;
Signed-off-by: David Daney &lt;david.daney@cavium.com&gt;
Acked-by: Catalin Marinas &lt;catalin.marinas@arm.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>of, numa: Add NUMA of binding implementation.</title>
<updated>2016-04-15T17:06:08+00:00</updated>
<author>
<name>David Daney</name>
<email>david.daney@cavium.com</email>
</author>
<published>2016-04-08T22:50:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=298535c00a2cbcd59e38f8f1c0c9ae7b9911e946'/>
<id>298535c00a2cbcd59e38f8f1c0c9ae7b9911e946</id>
<content type='text'>
Add device tree parsing for NUMA topology using device
"numa-node-id" property in distance-map and cpu nodes.

This is a complete rewrite of a previous patch by:
   Ganapatrao Kulkarni&lt;gkulkarni@caviumnetworks.com&gt;

Signed-off-by: David Daney &lt;david.daney@cavium.com&gt;
Acked-by: Rob Herring &lt;robh@kernel.org&gt;
Signed-off-by: Will Deacon &lt;will.deacon@arm.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add device tree parsing for NUMA topology using device
"numa-node-id" property in distance-map and cpu nodes.

This is a complete rewrite of a previous patch by:
   Ganapatrao Kulkarni&lt;gkulkarni@caviumnetworks.com&gt;

Signed-off-by: David Daney &lt;david.daney@cavium.com&gt;
Acked-by: Rob Herring &lt;robh@kernel.org&gt;
Signed-off-by: Will Deacon &lt;will.deacon@arm.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
