- 19 5月, 2016 1 次提交
-
-
由 Javier Martinez Canillas 提交于
The OF_UNITTEST Kconfig symbol is bool so this unittest can only be built-in and not build as a module. Also, nothing defined in this header file used so is not necessary to include it. Signed-off-by: NJavier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: NRob Herring <robh@kernel.org>
-
- 16 5月, 2016 1 次提交
-
-
由 Gavin Shan 提交于
This adds one more argument to of_fdt_unflatten_tree() to specify the parent node of the FDT blob that is going to be unflattened. In the result, the function can be used to unflatten FDT blob that represents device sub-tree in PowerNV PCI hotplug driver. Cc: Jyri Sarha <jsarha@ti.com> Signed-off-by: NGavin Shan <gwshan@linux.vnet.ibm.com> Acked-by: NRob Herring <robh@kernel.org> Acked-by: NJyri Sarha <jsarha@ti.com> Signed-off-by: NRob Herring <robh@kernel.org>
-
- 04 3月, 2016 1 次提交
-
-
由 Sergey Senozhatsky 提交于
of_overlay_destroy() can return `-ENODEV' error code once it failed to find the requested overlay in `ov_idr'. However, of_unittest_destroy_tracked_overlays() does not handle this error code correctly and continues to call of_overlay_destroy() on the 'missing' overlay over and over again. This results in a printk flood [..] [ 33.497583] of_overlay_destroy: Could not find overlay #6 [ 33.497583] of_overlay_destroy: Could not find overlay #6 [ 33.497584] ### dt-test ### of_unittest_destroy_tracked_overlays: overlay destroy failed for #6 [ 33.497584] ### dt-test ### of_unittest_destroy_tracked_overlays: overlay destroy failed for #6 [ 33.497586] of_overlay_destroy: Could not find overlay #6 [ 33.497586] of_overlay_destroy: Could not find overlay #6 [ 33.497587] ### dt-test ### of_unittest_destroy_tracked_overlays: overlay destroy failed for #6 [ 33.497587] ### dt-test ### of_unittest_destroy_tracked_overlays: overlay destroy failed for #6 [..] which is not really good due to printk design, and can lead to soft lockups, hard lockups, etc. (depending on the context console_unlock() is being called from). The problem has bee observed in real life and reported by Ying Huang. This patch does not address the root cause of missing overlay in `ov_idr', it fixes the endless loop only. Signed-off-by: NSergey Senozhatsky <sergey.senozhatsky@gmail.com> Reported-by: Nkernel test robot <ying.huang@linux.intel.com> Link: lkml.kernel.org/r/87fuwk1c0o.fsf@yhuang-dev.intel.com Signed-off-by: NRob Herring <robh@kernel.org>
-
- 14 1月, 2016 1 次提交
-
-
由 Gavin Shan 提交于
The PowerNV PCI hotplug driver is going to use the OF changeset to manage the changed device sub-tree. This exports those OF changeset functions for that. Signed-off-by: NGavin Shan <gwshan@linux.vnet.ibm.com> Acked-by: NWolfram Sang <wsa+renesas@sang-engineering.com> Tested-by: NWolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: NRob Herring <robh@kernel.org>
-
- 05 1月, 2016 1 次提交
-
-
由 Grant Likely 提交于
Add a single resource to the test bus device to exercise the platform bus code a little more. This isn't strictly a devicetree test, but it is a corner case that the devicetree runs into. Until we've got platform device unittests, it can live here. It doesn't need to be an explicit text because the kernel will oops when it is wrong. Cc: Pantelis Antoniou <pantelis.antoniou@konsulko.com> Cc: Rob Herring <robh@kernel.org> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: NGrant Likely <grant.likely@linaro.org> [wsa: added the comment provided by Grant, rebased, and tested] Signed-off-by: NWolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: NRob Herring <robh@kernel.org>
-
- 22 10月, 2015 1 次提交
-
-
由 Julia Lawall 提交于
for_each_child_of_node performs an of_node_get on each iteration, so a break out of the loop requires an of_node_put. A simplified version of the semantic patch that fixes this problem is as follows (http://coccinelle.lip6.fr): // <smpl> @@ expression root,e; local idexpression child; @@ for_each_child_of_node(root, child) { ... when != of_node_put(child) when != e = child ( return child; | + of_node_put(child); ? return ...; ) ... } // </smpl> Combine the puts into code at the end of the function, for conciseness. Signed-off-by: NJulia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: NRob Herring <robh@kernel.org>
-
- 27 7月, 2015 1 次提交
-
-
由 Krzysztof Kozlowski 提交于
platform_driver and i2c_driver do not need to set an owner because core will set it. Signed-off-by: NKrzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: NRob Herring <robh@kernel.org>
-
- 15 4月, 2015 1 次提交
-
-
由 Pantelis Antoniou 提交于
During the course of the overlay selftests some of them remain applied. While this does not pose a real problem, make sure you track them and destroy them at the end of the test. Signed-off-by: NPantelis Antoniou <pantelis.antoniou@konsulko.com> Signed-off-by: NRob Herring <robh@kernel.org>
-
- 29 3月, 2015 6 次提交
-
-
由 Grant Likely 提交于
The previous commit, "of/unittest: early return from test skips tests" exposed broken tests for the of_platform_unpopulate() function. The problem was the populate and depopulate calls were not symmetrical like they were intended to be, and unpopulate depends on the parent device to have it's of_node pointer pointing to the parent device node. Fix these bugs so that the test case works correctly. In the process, the test_bus used as a container for the test devices has been changed from a statically allocated struct device (which is bad) to a properly allocated device with a .release() method (which is good). This stops the test code from being a bad example of abusing the device model. Signed-off-by: NGrant Likely <grant.likely@linaro.org> Cc: Frank Rowand <frank.rowand@sonymobile.com> Cc: Pantelis Antoniou <pantelis.antoniou@konsulko.com> Cc: Pawel Moll <pawel.moll@arm.com>
-
由 Frank Rowand 提交于
Fix bugs pointed out by checkpatch: Mis-coding of two if statements caused early return from function. Number of tests completed increased from 102 to 107. Number of tests failed increased from 0 to 2. Signed-off-by: NFrank Rowand <frank.rowand@sonymobile.com> Signed-off-by: NGrant Likely <grant.likely@linaro.org>
-
由 Frank Rowand 提交于
Fix warnings pointed out by checkpatch. Checkpatch warns: externs should be avoided in .c files Reducing pain for future maintainers - adding a comment so that anyone trying to find where the extern data is created will be able to find it. (grep will not find that location) Signed-off-by: NFrank Rowand <frank.rowand@sonymobile.com> Signed-off-by: NGrant Likely <grant.likely@linaro.org>
-
由 Frank Rowand 提交于
Fix warnings pointed out by checkpatch. No bug fixes, but reduce the number of checkpatch warnings so that future problems will stand out better. Signed-off-by: NFrank Rowand <frank.rowand@sonymobile.com> Signed-off-by: NGrant Likely <grant.likely@linaro.org>
-
由 Frank Rowand 提交于
Fix bug pointed out by checkpatch. Splitting string incorrectly removed a space between two words. Signed-off-by: NFrank Rowand <frank.rowand@sonymobile.com> Signed-off-by: NGrant Likely <grant.likely@linaro.org>
-
由 Frank Rowand 提交于
Fix warnings pointed out by checkpatch. No bugs fixed, but the test code should be a good example of how to use the devicetree API. Signed-off-by: NFrank Rowand <frank.rowand@sonymobile.com> Signed-off-by: NGrant Likely <grant.likely@linaro.org>
-
- 25 3月, 2015 1 次提交
-
-
由 Wang Long 提交于
This patch just replace the string 'selftest' with 'unittest' in OF unittest and data and binding file. I have tested it successfully on ARM. Signed-off-by: NWang Long <long.wanglong@huawei.com> Signed-off-by: NRob Herring <robh@kernel.org>
-
- 19 3月, 2015 1 次提交
-
-
由 Brian Norris 提交于
There were regressions seen with commit 106937e8 ("of: fix handling of '/' in options for of_find_node_by_path()"), where we couldn't handle extra '/' before the ':'. Let's test for this now. Confirmed that this test fails without the previous patch and passes when patched. All other tests pass. Signed-off-by: NBrian Norris <computersforpeace@gmail.com> Acked-by: NLeif Lindholm <leif.lindholm@linaro.org> Signed-off-by: NRob Herring <robh@kernel.org>
-
- 10 3月, 2015 4 次提交
-
-
由 Peter Hurley 提交于
Add testcase variants with '/' in the options string to test for scan beyond end path name terminated by ':'. Signed-off-by: NPeter Hurley <peter@hurleysoftware.com> Signed-off-by: NRob Herring <robh@kernel.org>
-
由 Wang Long 提交于
This patch fix the wrong expected value of of_property_match_string in of_selftest_property_string. Signed-off-by: NWang Long <long.wanglong@huawei.com> Signed-off-by: NRob Herring <robh@kernel.org>
-
由 Wang Long 提交于
Remove the duplicate of_changeset_init. In of_selftest_changeset testcase, the "struct of_changeset chgset" is initialized twice, but only once is enough. so, drop the first initializtion code. Signed-off-by: NWang Long <long.wanglong@huawei.com> Signed-off-by: NRob Herring <robh@kernel.org>
-
由 Arnd Bergmann 提交于
The unittest fails to link if I2C or I2C_MUX is a loadable module: drivers/built-in.o: In function `selftest_i2c_mux_remove': unittest.c:(.text+0xb0ce4): undefined reference to `i2c_del_mux_adapter' This changes the newly added IS_ENABLED() checks to use IS_BUILTIN() instead, which evaluates to false if the other driver is a module. Reported-by: NChen Gang <gang.chen.5i5j@gmail.com> Signed-off-by: NArnd Bergmann <arnd@arndb.de> Fixes: d5e75500 ("of: unitest: Add I2C overlay unit tests.") Signed-off-by: NRob Herring <robh@kernel.org>
-
- 05 2月, 2015 1 次提交
-
-
由 Pantelis Antoniou 提交于
Introduce I2C device tree overlay tests. Tests insertion and removal of i2c adapters, i2c devices, and muxes. Signed-off-by: NPantelis Antoniou <pantelis.antoniou@konsulko.com> Signed-off-by: NRob Herring <robh@kernel.org>
-
- 23 1月, 2015 2 次提交
-
-
由 Pantelis Antoniou 提交于
Introduce selftests for overlays using sub-devices present in children nodes. Signed-off-by: NPantelis Antoniou <pantelis.antoniou@konsulko.com> Signed-off-by: NGrant Likely <grant.likely@linaro.org>
-
由 Grant Likely 提交于
Commit 3ce04b4a, "Removes OF_UNITTEST dependency on OF_DYNAMIC config symbol" removes a bunch of code, but missed a few minor bits. Clean it up by removing the node removal cache and flag. Signed-off-by: NGrant Likely <grant.likely@linaro.org> Cc: Gaurav Minocha <gaurav.minocha.os@gmail.com> Cc: Rob Herring <robh@kernel.org>
-
- 14 1月, 2015 1 次提交
-
-
由 Gaurav Minocha 提交于
This patch intends to remove the unittests dependency on the functions defined in dynamic.c. So, rather than calling of_attach_node defined in dynamic.c, minimal functionality required to attach a new node is re-defined in unittest.c. Also, now after executing the tests the test data is not removed from the device tree so there is no need to call of_detach_node. Tested with and without OF_DYNAMIC enabled on ppc, arm and x86 Signed-off-by: NGaurav Minocha <gaurav.minocha.os@gmail.com> Signed-off-by: NRob Herring <robh@kernel.org>
-
- 04 12月, 2014 2 次提交
-
-
由 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: NGrant Likely <grant.likely@linaro.org>
-
由 Leif Lindholm 提交于
Update of_find_node_by_path(): 1) Rename function to of_find_node_opts_by_path(), adding an optional pointer argument. Provide a static inline wrapper version of of_find_node_by_path() which calls the new function with NULL as the optional argument. 2) Ignore any part of the path beyond and including the ':' separator. 3) Set the new provided pointer argument to the beginning of the string following the ':' separator. 4: Add tests. Signed-off-by: NLeif Lindholm <leif.lindholm@linaro.org> Signed-off-by: NGrant Likely <grant.likely@linaro.org>
-
- 28 11月, 2014 1 次提交
-
-
由 Grant Likely 提交于
The unittest code has a MODULE_DEVICE_TABLE that isn't needed by any of the unittests, and isn't even correct. Remove it. Signed-off-by: NGrant Likely <grant.likely@linaro.org> Cc: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
-
- 25 11月, 2014 3 次提交
-
-
由 Pantelis Antoniou 提交于
Add unittests for OF overlays. It tests overlay device addition/removal and whether the apply revert sequence is correct. Changes since V1: * Added local fixups entries. Signed-off-by: NPantelis Antoniou <pantelis.antoniou@konsulko.com> Signed-off-by: NGrant Likely <grant.likely@linaro.org>
-
由 Grant Likely 提交于
Add a node argument to __of_node_alloc() and rename it to __of_node_dup() so that it can also be used to duplicate a node with its properties. This is important for the overlay code so that it can create new nodes without using separate changeset items for every single property. At the same time rework the overlay code to use the new function and drop the extra changeset items. Signed-off-by: NGrant Likely <grant.likely@linaro.org>
-
由 Grant Likely 提交于
The overlay code needs to construct a new full_name from the parent name and the node name, but the current method has to allocate and then free an temporary string which is wasteful. Fix this problem by using vargs to pass in a format and arguments into __of_node_alloc(). At the same time remove the allocflags argument to __of_node_alloc(). The only users all use GFP_KERNEL, so there is no need to provide it as an option. If there is ever a need later it can be added back. Signed-off-by: NGrant Likely <grant.likely@linaro.org>
-
- 05 11月, 2014 2 次提交
-
-
由 Grant Likely 提交于
This is unit testing code. It should use that name because it makes more sense than 'selftest'. Rename the files to match and rename the config variable. Signed-off-by: NGrant Likely <grant.likely@linaro.org>
-
由 Grant Likely 提交于
The of_platform_populate() test cases don't remove the test devices after they are added. Fix this by adding tests for of_platform_depopulate(). At the same time rework the selftest() macro to return the test result value. This makes it easy to use the macro inside an if() condition. Signed-off-by: NGrant Likely <grant.likely@linaro.org>
-
- 04 11月, 2014 2 次提交
-
-
由 Grant Likely 提交于
The device tree structure is composed of two lists; the 'allnodes' list which is a singly linked list containing every node in the tree, and the child->parent structure where each parent node has a singly linked list of children. All of the data in the allnodes list can be easily reproduced with the parent-child lists, so of_allnodes is actually unnecessary. Remove it entirely which saves a bit of memory and simplifies the data structure quite a lot. Signed-off-by: NGrant Likely <grant.likely@linaro.org> Cc: Rob Herring <robh@kernel.org> Cc: Gaurav Minocha <gaurav.minocha.os@gmail.com> Cc: Pantelis Antoniou <pantelis@pantelis.antoniou@konsulko.com>
-
由 Grant Likely 提交于
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: NGrant Likely <grant.likely@linaro.org> Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Cc: Mika Westerberg <mika.westerberg@linux.intel.com> Cc: Rob Herring <robh+dt@kernel.org> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Darren Hart <darren.hart@intel.com> Cc: <stable@vger.kernel.org> # v3.3+: Drop selftest hunks that don't apply
-
- 07 10月, 2014 1 次提交
-
-
由 Grant Likely 提交于
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: NGrant Likely <grant.likely@linaro.org>
-
- 05 10月, 2014 3 次提交
-
-
由 Grant Likely 提交于
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: NGrant Likely <grant.likely@linaro.org> Cc: Pantelis Antoniou <pantelis.antoniou@konsulko.com> Cc: Gaurav Minocha <gaurav.minocha.os@gmail.com>
-
由 Grant Likely 提交于
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: NGrant Likely <grant.likely@linaro.org> Cc: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
-
由 Grant Likely 提交于
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: NGrant Likely <grant.likely@linaro.org> Cc: Gaurav Minocha <gaurav.minocha.os@gmail.com>
-
- 02 10月, 2014 1 次提交
-
-
由 Grant Likely 提交于
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: NGrant Likely <grant.likely@linaro.org> Cc: Gaurav Minocha <gaurav.minocha.os@gmail.com>
-
- 16 8月, 2014 1 次提交
-
-
由 Gaurav Minocha 提交于
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: NGaurav Minocha <gaurav.minocha.os@gmail.com> Signed-off-by: NGrant Likely <grant.likely@linaro.org>
-