- 18 11月, 2016 1 次提交
-
-
由 Sudeep Holla 提交于
Currently platforms/drivers needing to get the machine model name are replicating the same snippet of code. In some case, the OF reference counting is either missing or incorrect. This patch adds support to read the machine model name either using the "model" or the "compatible" property in the device tree root node to the core OF/DT code. This can be used to remove all the duplicate code snippets doing exactly same thing later. Cc: Rob Herring <robh+dt@kernel.org> Cc: Frank Rowand <frowand.list@gmail.com> Cc: Arnd Bergmann <arnd@arndb.de> Signed-off-by: NSudeep Holla <sudeep.holla@arm.com> Signed-off-by: NRob Herring <robh@kernel.org>
-
- 15 11月, 2016 15 次提交
-
-
由 Johan Hovold 提交于
Add comment clarifying that of_find_device_by_node() takes a reference to the embedded struct device which needs to be dropped after use. Note that most current users fail to do so. Signed-off-by: NJohan Hovold <johan@kernel.org> Signed-off-by: NRob Herring <robh@kernel.org>
-
由 Johan Hovold 提交于
Update the comment to of_platform_device_destroy() to reflect that it no longer returns a status value. Fixes: 75f353b6 ("of/platform: Fix of_platform_device_destroy...") Signed-off-by: NJohan Hovold <johan@kernel.org> Signed-off-by: NRob Herring <robh@kernel.org>
-
由 Frank Rowand 提交于
Remove unused pointer to node "__symbols__". Signed-off-by: NFrank Rowand <frank.rowand@am.sony.com> Signed-off-by: NRob Herring <robh@kernel.org>
-
由 Frank Rowand 提交于
Value of pointer was calculated in an earlier block than where it was used. Move it down into the block where it is used, immediately before where is is checked to be valid. Signed-off-by: NFrank Rowand <frank.rowand@am.sony.com> Signed-off-by: NRob Herring <robh@kernel.org>
-
由 Frank Rowand 提交于
Add a single pr_err() to cover a range of errors that were reported by several pr_err() that were removed earlier in this series. Signed-off-by: NFrank Rowand <frank.rowand@am.sony.com> Signed-off-by: NRob Herring <robh@kernel.org>
-
由 Frank Rowand 提交于
Update comments to better explain what functions are doing. Signed-off-by: NFrank Rowand <frank.rowand@am.sony.com> Signed-off-by: NRob Herring <robh@kernel.org>
-
由 Frank Rowand 提交于
Remove a redundant check of buffer size. Signed-off-by: NFrank Rowand <frank.rowand@am.sony.com> Signed-off-by: NRob Herring <robh@kernel.org>
-
由 Frank Rowand 提交于
Remove BUG_ON(), which is frowned upon and not needed here. Restructure to remove some excessive complexity. Signed-off-by: NFrank Rowand <frank.rowand@am.sony.com> Signed-off-by: NRob Herring <robh@kernel.org>
-
由 Frank Rowand 提交于
Rename variables to better reflect what their purpose is. As a side effect, this reduces the need for some of the comments previously removed in this series. Signed-off-by: NFrank Rowand <frank.rowand@am.sony.com> Signed-off-by: NRob Herring <robh@kernel.org>
-
由 Frank Rowand 提交于
Remove "__of_" prefix from local function names. The pattern of a leading "__" is used in drivers/of/ to signify a function that must be called with a lock held. These functions do not fit that pattern. Signed-off-by: NFrank Rowand <frank.rowand@am.sony.com> Signed-off-by: NRob Herring <robh@kernel.org>
-
由 Frank Rowand 提交于
Some function names are misleading or do not provide a good sense of what they do. Rename the functions to ne more informative. Signed-off-by: NFrank Rowand <frank.rowand@am.sony.com> Signed-off-by: NRob Herring <robh@kernel.org>
-
由 Frank Rowand 提交于
Convert comparisons to zero or NULL to logical expressions. A small number of such comparisons remain where they provide more clarity of the numeric nature of a variable. Signed-off-by: NFrank Rowand <frank.rowand@am.sony.com> Signed-off-by: NRob Herring <robh@kernel.org>
-
由 Frank Rowand 提交于
Remove extra debug and error printks. A single pr_err() will be added at the end of this series to replace many of these error messages. Signed-off-by: NFrank Rowand <frank.rowand@am.sony.com> Signed-off-by: NRob Herring <robh@kernel.org>
-
由 Frank Rowand 提交于
Remove comments that report what is obvious from the code. Signed-off-by: NFrank Rowand <frank.rowand@am.sony.com> Signed-off-by: NRob Herring <robh@kernel.org>
-
由 David Daney 提交于
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] [<fffffc00081c8950>] __alloc_pages_nodemask+0xa4/0xe68 [ 0.000000] [<fffffc000821fa70>] new_slab+0xd0/0x564 [ 0.000000] [<fffffc0008221e24>] ___slab_alloc+0x2e4/0x514 [ 0.000000] [<fffffc0008239498>] __slab_alloc+0x48/0x58 [ 0.000000] [<fffffc0008222c20>] __kmalloc_node+0xd0/0x2dc [ 0.000000] [<fffffc0008115374>] __irq_domain_add+0x7c/0x164 [ 0.000000] [<fffffc0008b461dc>] its_probe+0x784/0x81c [ 0.000000] [<fffffc0008b462bc>] its_init+0x48/0x1b0 [ 0.000000] [<fffffc0008b4543c>] gic_init_bases+0x228/0x360 [ 0.000000] [<fffffc0008b456bc>] gic_of_init+0x148/0x1cc [ 0.000000] [<fffffc0008b5aec8>] of_irq_init+0x184/0x298 [ 0.000000] [<fffffc0008b43f9c>] irqchip_init+0x14/0x38 [ 0.000000] [<fffffc0008b12d60>] init_IRQ+0xc/0x30 [ 0.000000] [<fffffc0008b10a3c>] start_kernel+0x240/0x3b8 [ 0.000000] [<fffffc0008b101c4>] __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: NGilbert Netzer <noname@pdc.kth.se> Signed-off-by: NDavid Daney <david.daney@cavium.com> Cc: stable@vger.kernel.org # 4.7+ Signed-off-by: NRob Herring <robh@kernel.org>
-
- 08 10月, 2016 1 次提交
-
-
由 Paul Burton 提交于
If a device tree specifies a preferred device for kernel console output via the stdout-path or linux,stdout-path chosen node properties or the stdout alias then the kernel ought to honor it & output the kernel console to that device. As it stands, this isn't the case. Whilst we parse the stdout-path properties & set an of_stdout variable from of_alias_scan(), and use that from of_console_check() to determine whether to add a console device as a preferred console whilst registering it, we also prefer the first registered console if no other has been selected at the time of its registration. This means that if a console other than the one the device tree selects via stdout-path is registered first, we will switch to using it & when the stdout-path console is later registered the call to add_preferred_console() via of_console_check() is too late to do anything useful. In practice this seems to mean that we switch to the dummy console device fairly early & see no further console output: Console: colour dummy device 80x25 console [tty0] enabled bootconsole [ns16550a0] disabled Fix this by not automatically preferring the first registered console if one is specified by the device tree. This allows consoles to be registered but not enabled, and once the driver for the console selected by stdout-path calls of_console_check() the driver will be added to the list of preferred consoles before any other console has been enabled. When that console is then registered via register_console() it will be enabled as expected. Link: http://lkml.kernel.org/r/20160809151937.26118-1-paul.burton@imgtec.comSigned-off-by: NPaul Burton <paul.burton@imgtec.com> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: Paul Burton <paul.burton@imgtec.com> Cc: Tejun Heo <tj@kernel.org> Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com> Cc: Jiri Slaby <jslaby@suse.cz> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Ivan Delalande <colona@arista.com> Cc: Thierry Reding <treding@nvidia.com> Cc: Borislav Petkov <bp@suse.de> Cc: Jan Kara <jack@suse.com> Cc: Petr Mladek <pmladek@suse.com> Cc: Joe Perches <joe@perches.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Rob Herring <robh+dt@kernel.org> Cc: Frank Rowand <frowand.list@gmail.com> Signed-off-by: NAndrew Morton <akpm@linux-foundation.org> Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
-
- 06 10月, 2016 1 次提交
-
-
由 Paul Burton 提交于
Since commit 44a7185c ("of/platform: Add common method to populate default bus") platforms calling of_platform_bus_probe from an initcall is either a rather unsafe race with of_platform_default_populate_init or a no-op. The MIPS Malta board needs to probe devices under an ISA bus, which we do support in the of_busses array but until now haven't included in of_default_bus_match_table. Add an "isa" entry to of_default_bus_match_table such that we can just accept use of of_platform_default_populate_init & remove the Malta-specific match table in a later patch. Signed-off-by: NPaul Burton <paul.burton@imgtec.com> Acked-by: NRob Herring <robh@kernel.org> Cc: Frank Rowand <frowand.list@gmail.com> Cc: linux-mips@linux-mips.org Cc: devicetree@vger.kernel.org Cc: linux-kernel@vger.kernel.org Patchwork: https://patchwork.linux-mips.org/patch/14275/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
-
- 28 9月, 2016 1 次提交
-
-
由 Leif Lindholm 提交于
We have multiple "earlycon" early_param handlers - merge the DT one into the main earlycon one. It's a cleanup that also will be useful to defer setting up DT console until ACPI/DT decision is made. Rename the exported function to avoid clashing with the function from arch/microblaze/kernel/prom.c Signed-off-by: NLeif Lindholm <leif.lindholm@linaro.org> Signed-off-by: NAleksey Makarov <aleksey.makarov@linaro.org> Acked-by: NRob Herring <robh@kernel.org> Acked-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org> Reviewed-by: NPeter Hurley <peter@hurleysoftware.com> Tested-by: NKefeng Wang <wangkefeng.wang@huawei.com> Tested-by: NChristopher Covington <cov@codeaurora.org> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
- 23 9月, 2016 1 次提交
-
-
由 Boris Brezillon 提交于
Commit d48f62b9 ("mtd: nand: move of_get_nand_xxx() helpers into nand_base.c") removed the drivers/of/of_mtd.c file but did not remove the associated OF_MTD Kconfig option. Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
- 16 9月, 2016 1 次提交
-
-
由 Robin Murphy 提交于
The PCI msi-map code is already doing double-duty translating IDs and retrieving MSI parents, which unsurprisingly is the same functionality we need for the identically-formatted PCI iommu-map property. Drag the core parsing routine up yet another layer into the general OF-PCI code, and further generalise it for either kind of lookup in either flavour of map property. Acked-by: NRob Herring <robh+dt@kernel.org> Acked-by: NMarc Zyngier <marc.zyngier@arm.com> Tested-by: NLorenzo Pieralisi <lorenzo.pieralisi@arm.com> Signed-off-by: NRobin Murphy <robin.murphy@arm.com> Signed-off-by: NWill Deacon <will.deacon@arm.com>
-
- 15 9月, 2016 3 次提交
-
-
由 Robin Murphy 提交于
Whilst we're some of the way towards a universal firmware property interface, drivers which deal with both OF and ACPI probing end up having to do things like this: dev->of_node ? &dev->of_node->fwnode : dev->fwnode This seems unnecessary, when the OF code could instead simply fill in the device's fwnode when binding the of_node, and let the drivers use dev->fwnode either way. Let's give it a go and see what falls out. Signed-off-by: NRobin Murphy <robin.murphy@arm.com> Signed-off-by: NRob Herring <robh@kernel.org>
-
由 Richard Fitzgerald 提交于
Add a new set of array reading functions that take a minimum and maximum size limit and will fail if the property size is not within the size limits. This makes it more convenient for drivers that use variable-size DT arrays which must be bounded at both ends - data must be at least N entries but must not overflow the array it is being copied into. It is also more efficient than making this functionality out of existing public functions and avoids duplication. The existing array functions have been left in the API, since there are a very large number of clients of those functions and their existing functionality is still useful. This avoids turning a small API improvement into a major kernel rework. The old functions have been turned into mininmal static inlines calling the new functions. The old functions had no upper limit on the actual size of the dts entry, to preserve this functionality rather than keeping two near-identical implementations, if the new function is called with max=0 there is no limit on the size of the dts entry but only the min number of elements are read. Signed-off-by: NRichard Fitzgerald <rf@opensource.wolfsonmicro.com> Signed-off-by: NRob Herring <robh@kernel.org>
-
由 Richard Fitzgerald 提交于
In preparation for adding variable-length array reads, change of_find_property_value_of_size so that it takes an optional maximum length. If the maximum is passed as 0, the behaviour is unchanged and it will return a property if it's >= the requested minimum length. If maximum is non-zero it will only return a property whose length is min <= l <= max. Signed-off-by: NRichard Fitzgerald <rf@opensource.wolfsonmicro.com> Signed-off-by: NRob Herring <robh@kernel.org>
-
- 09 9月, 2016 6 次提交
-
-
由 Kefeng Wang 提交于
Use pr_fmt to prefix kernel output. Signed-off-by: NKefeng Wang <wangkefeng.wang@huawei.com> Acked-by: NRob Herring <robh@kernel.org> Signed-off-by: NWill Deacon <will.deacon@arm.com>
-
由 Kefeng Wang 提交于
Use of_get_next_parent() instead of open-code. Signed-off-by: NKefeng Wang <wangkefeng.wang@huawei.com> Acked-by: NRob Herring <robh@kernel.org> Signed-off-by: NWill Deacon <will.deacon@arm.com>
-
由 Zhen Lei 提交于
This warning has been printed in of_numa_parse_cpu_nodes before. Signed-off-by: NZhen Lei <thunder.leizhen@huawei.com> Acked-by: NRob Herring <robh@kernel.org> Signed-off-by: NWill Deacon <will.deacon@arm.com>
-
由 Zhen Lei 提交于
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: NRob Herring <robh@kernel.org> Signed-off-by: NZhen Lei <thunder.leizhen@huawei.com> Signed-off-by: NWill Deacon <will.deacon@arm.com>
-
由 Zhen Lei 提交于
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: NZhen Lei <thunder.leizhen@huawei.com> Acked-by: NRob Herring <robh@kernel.org> Signed-off-by: NWill Deacon <will.deacon@arm.com>
-
由 Zhen Lei 提交于
This information will be printed in the subfunction numa_add_memblk. They are not the same, but very similar. Signed-off-by: NZhen Lei <thunder.leizhen@huawei.com> Acked-by: NRob Herring <robh@kernel.org> Signed-off-by: NWill Deacon <will.deacon@arm.com>
-
- 16 8月, 2016 1 次提交
-
-
由 Lucas Stach 提交于
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: 8ccd0d0c (of: add helper for getting endpoint node of specific identifiers) Cc: stable@vger.kernel.org Reported-by: NDavid Jander <david@protonic.nl> Signed-off-by: NLucas Stach <l.stach@pengutronix.de> Acked-by: NPhilipp Zabel <p.zabel@pengutronix.de> Signed-off-by: NRob Herring <robh@kernel.org>
-
- 13 8月, 2016 1 次提交
-
-
由 Kevin Hao 提交于
With the commit 44a7185c ("of/platform: Add common method to populate default bus"), a default function is introduced to populate the default bus and this function is invoked at the arch_initcall_sync level. But a lot of ppc boards use machine_device_initcall() to populate the default bus. This means that the default populate function has higher priority and would override the arch specific population of the bus. The side effect is that some arch specific bus are not probed, then cause various malfunction due to the miss of some devices. Since it is very possible to introduce bugs if we simply change the initcall level for all these boards(about 30+). This just disable this default function for all the ppc boards. Signed-off-by: NKevin Hao <haokexin@gmail.com> Signed-off-by: NRob Herring <robh@kernel.org>
-
- 10 8月, 2016 3 次提交
-
-
由 Philipp Zabel 提交于
That way the init callback may clear the flag again, in case of drivers split between early irq chip and a normal platform driver. Fixes: 15cc2ed6 ("of/irq: Mark initialised interrupt controllers as populated") Suggested-by: NRob Herring <robh@kernel.org> Signed-off-by: NPhilipp Zabel <p.zabel@pengutronix.de> Acked-by: NJon Hunter <jonathanh@nvidia.com> Signed-off-by: NRob Herring <robh@kernel.org>
-
由 Gavin Shan 提交于
@mynodes is set to NULL when __unflatten_device_tree() is called to unflatten device sub-tree in PCI hot add scenario on PowerPC PowerNV platform. Marking @mynodes detached unconditionally causes kernel crash as below backtrace shows: Unable to handle kernel paging request for data at address 0x00000000 Faulting instruction address: 0xc000000000b26f64 cpu 0x0: Vector: 300 (Data Access) at [c000003fcc7cf740] pc: c000000000b26f64: __unflatten_device_tree+0xf4/0x190 lr: c000000000b26f40: __unflatten_device_tree+0xd0/0x190 sp: c000003fcc7cf9c0 msr: 900000000280b033 dar: 0 dsisr: 40000000 current = 0xc000003fcc281680 paca = 0xc00000000ff00000 softe: 0 irq_happened: 0x01 pid = 2724, comm = sh Linux version 4.7.0-gavin-07754-g92a6836 (gwshan@gwshan) (gcc version \ 4.9.3 (Buildroot 2016.02-rc2-00093-g5ea3bce) ) #539 SMP Mon Aug 1 \ 12:40:29 AEST 2016 enter ? for help [c000003fcc7cfa50] c000000000b27060 of_fdt_unflatten_tree+0x60/0x90 [c000003fcc7cfaa0] c0000000004c6288 pnv_php_set_slot_power_state+0x118/0x440 [c000003fcc7cfb80] c0000000004c6a10 pnv_php_enable+0xc0/0x170 [c000003fcc7cfbd0] c0000000004c4d80 power_write_file+0xa0/0x190 [c000003fcc7cfc50] c0000000004be93c pci_slot_attr_store+0x3c/0x60 [c000003fcc7cfc70] c0000000002d3fd4 sysfs_kf_write+0x94/0xc0 [c000003fcc7cfcb0] c0000000002d2c30 kernfs_fop_write+0x180/0x260 [c000003fcc7cfd00] c000000000230fe0 __vfs_write+0x40/0x190 [c000003fcc7cfd90] c000000000232278 vfs_write+0xc8/0x240 [c000003fcc7cfde0] c000000000233d90 SyS_write+0x60/0x110 [c000003fcc7cfe30] c000000000009524 system_call+0x38/0x108 This avoids the kernel crash by marking @mynodes detached only when @mynodes is dereferencing valid device node in __unflatten_device_tree(). Fixes: 1d1bde55 ("of: fdt: mark unflattened tree as detached") Reported-by: NMeng Li <shlimeng@cn.ibm.com> Signed-off-by: NGavin Shan <gwshan@linux.vnet.ibm.com> Signed-off-by: NRob Herring <robh@kernel.org>
-
由 Markus Elfring 提交于
The of_node_put() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: NMarkus Elfring <elfring@users.sourceforge.net> Signed-off-by: NRob Herring <robh@kernel.org>
-
- 06 8月, 2016 1 次提交
-
-
由 Kees Cook 提交于
Instead of a ramoops-specific node, use a child node of /reserved-memory. This requires that of_platform_device_create() be explicitly called for the node, though, since "/reserved-memory" does not have its own "compatible" property. Suggested-by: NRob Herring <robh@kernel.org> Signed-off-by: NKees Cook <keescook@chromium.org> Acked-by: NRob Herring <robh@kernel.org>
-
- 20 7月, 2016 1 次提交
-
-
由 Benjamin Herrenschmidt 提交于
This provides an equivalent of of_fdt_match() for non-flat trees. This is more practical than matching an array of of_device_id structs when converting a bunch of existing users of of_fdt_match(). Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org> Acked-by: NRob Herring <robh@kernel.org> Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
-
- 19 7月, 2016 3 次提交
-
-
由 Michal Suchanek 提交于
The tree returned from of_fdt_unflatten_tree cannot be attached to the live tree because it is not marked as detached so mark it as such. The dt resolver checks the flag and refuses to process the tree otherwise. Signed-off-by: NMichal Suchanek <hramrach@gmail.com> Signed-off-by: NRob Herring <robh@kernel.org>
-
由 Michal Suchanek 提交于
Applying overlay fails silently in case of an error. Add error prints. Most notably the lack of symbols in the live tree is not reported. Signed-off-by: NMichal Suchanek <hramrach@gmail.com> Signed-off-by: NRob Herring <robh@kernel.org>
-
由 Rob Herring 提交于
Clean-up all the DT printk functions to use common pr_fmt prefix. Some print statements such as kmalloc errors were redundant, so just drop those. Cc: Frank Rowand <frowand.list@gmail.com> Cc: Pantelis Antoniou <pantelis.antoniou@konsulko.com> Reviewed-by: NFrank Rowand <frank.rowand@am.sony.com> Signed-off-by: NRob Herring <robh@kernel.org>
-