<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/of/base.c, branch v3.16</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v3.16</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v3.16'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2014-06-16T18:31:44Z</updated>
<entry>
<title>OF: fix of_find_node_by_path() assumption that of_allnodes is root</title>
<updated>2014-06-16T18:31:44Z</updated>
<author>
<name>Frank Rowand</name>
<email>frank.rowand@sonymobile.com</email>
</author>
<published>2014-06-15T03:39:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=99de64984c3a7c9bf56a50e6dcc51006c9485620'/>
<id>urn:sha1:99de64984c3a7c9bf56a50e6dcc51006c9485620</id>
<content type='text'>
of_find_node_by_path() is borked because of_allnodes is not guaranteed to
contain the root of the tree after using any of the dynamic update functions
because some other nodes ends up as of_allnodes.

Fixes: c22e650e66b8 of: Make of_find_node_by_path() handle /aliases
Reported-by: pantelis.antoniou@konsulko.com
Signed-off-by: Frank Rowand &lt;frank.rowand@sonymobile.com&gt;
Signed-off-by: Rob Herring &lt;robh@kernel.org&gt;
</content>
</entry>
<entry>
<title>of: avoid format string parsing in kobject names</title>
<updated>2014-06-16T18:31:44Z</updated>
<author>
<name>Kees Cook</name>
<email>keescook@chromium.org</email>
</author>
<published>2014-06-10T16:57:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=28d3ee40ef5ad488f4ad3376d8f237b9502cecfb'/>
<id>urn:sha1:28d3ee40ef5ad488f4ad3376d8f237b9502cecfb</id>
<content type='text'>
This makes sure a format string cannot leak into the kobject name that
is constructed. (And splits the &gt;80 character line.)

Signed-off-by: Kees Cook &lt;keescook@chromium.org&gt;
Signed-off-by: Rob Herring &lt;robh@kernel.org&gt;
</content>
</entry>
<entry>
<title>Merge tag 'devicetree-for-3.16' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux into next</title>
<updated>2014-06-04T17:02:38Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2014-06-04T17:02:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d27050641e9bc056446deb0814e7ba1aa7911f5a'/>
<id>urn:sha1:d27050641e9bc056446deb0814e7ba1aa7911f5a</id>
<content type='text'>
Pull DeviceTree updates from Rob Herring:
 - Another round of clean-up of FDT related code in architecture code.
   This removes knowledge of internal FDT details from most
   architectures except powerpc.
 - Conversion of kernel's custom FDT parsing code to use libfdt.
 - DT based initialization for generic serial earlycon.  The
   introduction of generic serial earlycon support went in through the
   tty tree.
 - Improve the platform device naming for DT probed devices to ensure
   unique naming and use parent names instead of a global index.
 - Fix a race condition in of_update_property.
 - Unify the various linker section OF match tables and fix several
   function prototype errors.
 - Update platform_get_irq_byname to work in deferred probe cases.
 - 2 binding doc updates

* tag 'devicetree-for-3.16' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: (58 commits)
  of: handle NULL node in next_child iterators
  of/irq: provide more wrappers for !CONFIG_OF
  devicetree: bindings: Document micrel vendor prefix
  dt: bindings: dwc2: fix required value for the phy-names property
  of_pci_irq: kill useless variable in of_irq_parse_pci()
  of/irq: do irq resolution in platform_get_irq_byname()
  of: Add a testcase for of_find_node_by_path()
  of: Make of_find_node_by_path() handle /aliases
  of: Create unlocked version of for_each_child_of_node()
  lib: add glibc style strchrnul() variant
  of: Handle memory@0 node on PPC32 only
  pci/of: Remove dead code
  of: fix race between search and remove in of_update_property()
  of: Use NULL for pointers
  of: Stop naming platform_device using dcr address
  of: Ensure unique names without sacrificing determinism
  tty/serial: pl011: add DT based earlycon support
  of/fdt: add FDT serial scanning for earlycon
  of/fdt: add FDT address translation support
  serial: earlycon: add DT support
  ...
</content>
</entry>
<entry>
<title>Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial into next</title>
<updated>2014-06-04T15:50:34Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2014-06-04T15:50:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=1aacb90eaaac057c10fd746e189553e04cfeb291'/>
<id>urn:sha1:1aacb90eaaac057c10fd746e189553e04cfeb291</id>
<content type='text'>
Pull trivial tree changes from Jiri Kosina:
 "Usual pile of patches from trivial tree that make the world go round"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (23 commits)
  staging: go7007: remove reference to CONFIG_KMOD
  aic7xxx: Remove obsolete preprocessor define
  of: dma: doc fixes
  doc: fix incorrect formula to calculate CommitLimit value
  doc: Note need of bc in the kernel build from 3.10 onwards
  mm: Fix printk typo in dmapool.c
  modpost: Fix comment typo "Modules.symvers"
  Kconfig.debug: Grammar s/addition/additional/
  wimax: Spelling s/than/that/, wording s/destinatary/recipient/
  aic7xxx: Spelling s/termnation/termination/
  arm64: mm: Remove superfluous "the" in comment
  of: Spelling s/anonymouns/anonymous/
  dma: imx-sdma: Spelling s/determnine/determine/
  ath10k: Improve grammar in comments
  ath6kl: Spelling s/determnine/determine/
  of: Improve grammar for of_alias_get_id() documentation
  drm/exynos: Spelling s/contro/control/
  radio-bcm2048.c: fix wrong overflow check
  doc: printk-formats: do not mention casts for u64/s64
  doc: spelling error changes
  ...
</content>
</entry>
<entry>
<title>of: handle NULL node in next_child iterators</title>
<updated>2014-06-04T09:46:01Z</updated>
<author>
<name>Florian Fainelli</name>
<email>f.fainelli@gmail.com</email>
</author>
<published>2014-05-28T17:39:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=43cb43678705e39b175b325f17938295996aefc7'/>
<id>urn:sha1:43cb43678705e39b175b325f17938295996aefc7</id>
<content type='text'>
Add an early check for the node argument in __of_get_next_child and
of_get_next_available_child() to avoid dereferencing a NULL node pointer
a few lines after.

CC: Daniel Mack &lt;zonque@gmail.com&gt;
Signed-off-by: Florian Fainelli &lt;f.fainelli@gmail.com&gt;
Signed-off-by: Grant Likely &lt;grant.likely@linaro.org&gt;
</content>
</entry>
<entry>
<title>of: Make of_find_node_by_path() handle /aliases</title>
<updated>2014-05-23T02:35:06Z</updated>
<author>
<name>Grant Likely</name>
<email>grant.likely@linaro.org</email>
</author>
<published>2014-03-14T17:07:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c22e650e66b862babe9c00bebb20b8029c7b0362'/>
<id>urn:sha1:c22e650e66b862babe9c00bebb20b8029c7b0362</id>
<content type='text'>
Make of_find_node_by_path() handle aliases as prefixes. To make this
work the name search is refactored to search by path component instead
of by full string. This should be a more efficient search, and it makes
it possible to start a search at a subnode of a tree.

Signed-off-by: David Daney &lt;david.daney@cavium.com&gt;
Signed-off-by: Pantelis Antoniou &lt;pantelis.antoniou@konsulko.com&gt;
[grant.likely: Rework to not require allocating at runtime]
Acked-by: Rob Herring &lt;robh@kernel.org&gt;
Signed-off-by: Grant Likely &lt;grant.likely@linaro.org&gt;
</content>
</entry>
<entry>
<title>of: Create unlocked version of for_each_child_of_node()</title>
<updated>2014-05-23T02:25:27Z</updated>
<author>
<name>Grant Likely</name>
<email>grant.likely@linaro.org</email>
</author>
<published>2014-05-21T16:04:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=0d0e02d605c5696a5076510f564fefe659127aa4'/>
<id>urn:sha1:0d0e02d605c5696a5076510f564fefe659127aa4</id>
<content type='text'>
When iterating over nodes, sometimes it needs to be done when the DT
lock is already held. This patch makes an unlocked version of the
for_each_child_of_node() macro.

Signed-off-by: Grant Likely &lt;grant.likely@linaro.org&gt;
</content>
</entry>
<entry>
<title>of: fix race between search and remove in of_update_property()</title>
<updated>2014-05-22T23:46:30Z</updated>
<author>
<name>Xiubo Li</name>
<email>Li.Xiubo@freescale.com</email>
</author>
<published>2014-04-17T07:48:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=947fdaad0627e277c5f3a2573203c4fab3db513b'/>
<id>urn:sha1:947fdaad0627e277c5f3a2573203c4fab3db513b</id>
<content type='text'>
The of_update_property() is intented to update a property in a node
and if the property does not exist, will add it.

The second search of the property is possibly won't be found, that
maybe removed by other thread just before the second search begain.

Using the __of_find_property() and __of_add_property() instead and
move them into lock operations.

Signed-off-by: Xiubo Li &lt;Li.Xiubo@freescale.com&gt;
[grant.likely: conflict with another change in same function]
Signed-off-by: Grant Likely &lt;grant.likely@linaro.org&gt;
</content>
</entry>
<entry>
<title>of: make of_update_property() usable earlier in the boot process</title>
<updated>2014-05-14T14:27:36Z</updated>
<author>
<name>Thomas Petazzoni</name>
<email>thomas.petazzoni@free-electrons.com</email>
</author>
<published>2014-05-14T11:36:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=582da6527da30f6e21a95c9f3f2810d46a8f406e'/>
<id>urn:sha1:582da6527da30f6e21a95c9f3f2810d46a8f406e</id>
<content type='text'>
Commit 75b57ecf9d1d1e17d099ab13b8f48e6e038676be ('of: Make device
nodes kobjects so they show up in sysfs') has turned Device Tree nodes
in kobjects and added a sysfs based representation for Device Tree
nodes. Since the sysfs logic is only available after the execution of
a core_initcall(), the patch took precautions in of_add_property() and
of_remove_property() to not do any sysfs related manipulation early in
the boot process.

However, it forgot to do the same for of_update_property(), which if
used early in the boot process (before core_initcalls have been
called), tries to call sysfs_remove_bin_file(), and crashes:

------------[ cut here ]------------
WARNING: CPU: 0 PID: 0 at /home/thomas/projets/linux-2.6/fs/kernfs/dir.c:1216 kernfs_remove_by_name_ns+0x80/0x88()
kernfs: can not remove '(null)', no directory
Modules linked in:
CPU: 0 PID: 0 Comm: swapper/0 Not tainted 3.15.0-rc1-00127-g1d7e7b2-dirty #423
[&lt;c0014910&gt;] (unwind_backtrace) from [&lt;c00110ec&gt;] (show_stack+0x10/0x14)
[&lt;c00110ec&gt;] (show_stack) from [&lt;c04c84b8&gt;] (dump_stack+0x84/0x94)
[&lt;c04c84b8&gt;] (dump_stack) from [&lt;c001d8c0&gt;] (warn_slowpath_common+0x6c/0x88)
[&lt;c001d8c0&gt;] (warn_slowpath_common) from [&lt;c001d90c&gt;] (warn_slowpath_fmt+0x30/0x40)
[&lt;c001d90c&gt;] (warn_slowpath_fmt) from [&lt;c0104468&gt;] (kernfs_remove_by_name_ns+0x80/0x88)
[&lt;c0104468&gt;] (kernfs_remove_by_name_ns) from [&lt;c0394d98&gt;] (of_update_property+0xc0/0xf0)
[&lt;c0394d98&gt;] (of_update_property) from [&lt;c0647248&gt;] (mvebu_timer_and_clk_init+0xfc/0x194)
[&lt;c0647248&gt;] (mvebu_timer_and_clk_init) from [&lt;c0640934&gt;] (start_kernel+0x218/0x350)
[&lt;c0640934&gt;] (start_kernel) from [&lt;00008070&gt;] (0x8070)
---[ end trace 3406ff24bd97382e ]---
Unable to handle kernel NULL pointer dereference at virtual address 0000003c
pgd = c0004000
[0000003c] *pgd=00000000
Internal error: Oops: 5 [#1] SMP ARM
Modules linked in:
CPU: 0 PID: 0 Comm: swapper/0 Tainted: G        W     3.15.0-rc1-00127-g1d7e7b2-dirty #423
task: c10ad4d8 ti: c10a2000 task.ti: c10a2000
PC is at kernfs_find_ns+0x8/0xf0
LR is at kernfs_find_and_get_ns+0x30/0x48
pc : [&lt;c0103834&gt;]    lr : [&lt;c010394c&gt;]    psr: 600001d3
sp : c10a3f34  ip : 00000073  fp : 00000000
r10: 00000000  r9 : cfffc240  r8 : cfdf2980
r7 : cf812c00  r6 : 00000000  r5 : 00000000  r4 : c10b45e0
r3 : c10ad4d8  r2 : 00000000  r1 : cf812c00  r0 : 00000000
Flags: nZCv  IRQs off  FIQs off  Mode SVC_32  ISA ARM  Segment kernel
Control: 10c53c7d  Table: 0000404a  DAC: 00000015
Process swapper/0 (pid: 0, stack limit = 0xc10a2240)
Stack: (0xc10a3f34 to 0xc10a4000)
3f20:                                              c10b45e0 00000000 00000000
3f40: cf812c00 c010394c 00000063 cf812c00 00000001 cf812c00 cfdf29ac c03932cc
3f60: 00000063 cf812bc0 cfdf29ac cf812c00 ffffffff c03943f8 cfdf2980 c0104468
3f80: cfdf2a04 cfdf2980 cf812bc0 c06634b0 c10aa3c0 c0394da4 c10f74dc cfdf2980
3fa0: cf812bc0 c0647248 c10aa3c0 ffffffff c10de940 c10aa3c0 ffffffff c0640934
3fc0: ffffffff ffffffff c06404ec 00000000 00000000 c06634b0 00000000 10c53c7d
3fe0: c10aa434 c06634ac c10ae4c8 0000406a 414fc091 00008070 00000000 00000000
[&lt;c0103834&gt;] (kernfs_find_ns) from [&lt;00000001&gt;] (0x1)
Code: e5c89001 eaffffcf e92d40f0 e1a06002 (e1d023bc)
---[ end trace 3406ff24bd97382f ]---
Kernel panic - not syncing: Attempted to kill the idle task!
---[ end Kernel panic - not syncing: Attempted to kill the idle task!

To fix this problem, we simply skip the sysfs related calls in
of_update_property(), and rely on of_init() to fix up things when it
will be called, exactly as is done in of_add_property() and
of_remove_property().

Signed-off-by: Thomas Petazzoni &lt;thomas.petazzoni@free-electrons.com&gt;
Fixes: 75b57ecf9d1d ("of: Make device nodes kobjects so they show up in sysfs")
Signed-off-by: Grant Likely &lt;grant.likely@linaro.org&gt;
</content>
</entry>
<entry>
<title>of: Improve grammar for of_alias_get_id() documentation</title>
<updated>2014-05-05T13:37:45Z</updated>
<author>
<name>Geert Uytterhoeven</name>
<email>geert+renesas@linux-m68k.org</email>
</author>
<published>2014-03-11T10:23:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5a53a07f12da4377df8016ffc7fd465411cc1a7b'/>
<id>urn:sha1:5a53a07f12da4377df8016ffc7fd465411cc1a7b</id>
<content type='text'>
Signed-off-by: Geert Uytterhoeven &lt;geert+renesas@linux-m68k.org&gt;
Acked-by: Rob Herring &lt;robh@kernel.org&gt;
Cc: Grant Likely &lt;grant.likely@linaro.org&gt;
Cc: devicetree@vger.kernel.org
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
</content>
</entry>
</feed>
