1. 20 7月, 2017 1 次提交
    • F
      of: overlay: add overlay unittest data for node names and symbols · 60a0004c
      Frank Rowand 提交于
      Add nodes and properties to overlay_base and overlay dts files to
      test for
         - incorrect existing node name detection when overlay node name
           has a unit-address
         - adding overlay __symbols__ properties to live tree when an
           overlay is added to the live tree
      
      The following console messages will appear near the end of unittest
      until the code errors are corrected:
      
         OF: Duplicate name in fairway-1, renamed to "ride@100#1"
      
         ### dt-test ### FAIL of_unittest_overlay_high_level():2296 Adding overlay 'overlay_bad_symbol' failed
      
         ### dt-test ### end of unittest - 190 passed, 1 failed
      Signed-off-by: NFrank Rowand <frank.rowand@sony.com>
      Signed-off-by: NRob Herring <robh@kernel.org>
      60a0004c
  2. 19 7月, 2017 1 次提交
  3. 28 6月, 2017 1 次提交
    • P
      vsprintf: Add %p extension "%pOF" for device tree · ce4fecf1
      Pantelis Antoniou 提交于
      90% of the usage of device node's full_name is printing it out in a
      kernel message. However, storing the full path for every node is
      wasteful and redundant. With a custom format specifier, we can generate
      the full path at run-time and eventually remove the full path from every
      node.
      
      For instance typical use is:
      	pr_info("Frobbing node %s\n", node->full_name);
      
      Which can be written now as:
      	pr_info("Frobbing node %pOF\n", node);
      
      '%pO' is the base specifier to represent kobjects with '%pOF'
      representing struct device_node. Currently, struct device_node is the
      only supported type of kobject.
      
      More fine-grained control of formatting includes printing the name,
      flags, path-spec name and others, explained in the documentation entry.
      
      Originally written by Pantelis, but pretty much rewrote the core
      function using existing string/number functions. The 2 passes were
      unnecessary and have been removed. Also, updated the checkpatch.pl
      check. The unittest code was written by Grant Likely.
      Signed-off-by: NPantelis Antoniou <pantelis.antoniou@konsulko.com>
      Acked-by: NJoe Perches <joe@perches.com>
      Signed-off-by: NRob Herring <robh@kernel.org>
      ce4fecf1
  4. 05 5月, 2017 1 次提交
  5. 03 5月, 2017 1 次提交
  6. 28 4月, 2017 1 次提交
  7. 24 1月, 2017 1 次提交
  8. 05 1月, 2017 1 次提交
  9. 24 6月, 2016 1 次提交
  10. 19 5月, 2016 1 次提交
  11. 16 5月, 2016 1 次提交
  12. 22 4月, 2016 1 次提交
  13. 04 3月, 2016 1 次提交
    • S
      of/unittest: fix infinite loop in of_unittest_destroy_tracked_overlays() · 815d74b3
      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>
      815d74b3
  14. 14 1月, 2016 1 次提交
  15. 05 1月, 2016 1 次提交
    • G
      of/unittest: Show broken behaviour in the platform bus · d2329fb5
      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>
      d2329fb5
  16. 22 10月, 2015 1 次提交
    • J
      of/unittest: add missing of_node_put · 855ff287
      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>
      855ff287
  17. 27 7月, 2015 1 次提交
  18. 15 4月, 2015 1 次提交
  19. 29 3月, 2015 6 次提交
  20. 25 3月, 2015 1 次提交
  21. 19 3月, 2015 1 次提交
  22. 10 3月, 2015 4 次提交
  23. 05 2月, 2015 1 次提交
  24. 23 1月, 2015 2 次提交
  25. 14 1月, 2015 1 次提交
  26. 04 12月, 2014 2 次提交
  27. 28 11月, 2014 1 次提交
  28. 25 11月, 2014 3 次提交
    • P
      of/overlay: Add overlay unittests · 177d271c
      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>
      177d271c
    • G
      of: Refactor __of_node_alloc() into __of_node_dup() · e5179581
      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>
      e5179581
    • G
      of: Use vargs in __of_node_alloc · ef8bbd73
      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>
      ef8bbd73