1. 18 10月, 2017 2 次提交
    • F
      of: overlay: detect cases where device tree may become corrupt · 24789c5c
      Frank Rowand 提交于
      When an attempt to apply an overlay changeset fails, an effort
      is made to revert any partial application of the changeset.
      When an attempt to remove an overlay changeset fails, an effort
      is made to re-apply any partial reversion of the changeset.
      
      The existing code does not check for failure to recover a failed
      overlay changeset application or overlay changeset revert.
      
      Add the missing checks and flag the devicetree as corrupt if the
      state of the devicetree can not be determined.
      
      Improve and expand the returned errors to more fully reflect the
      result of the effort to undo the partial effects of a failed attempt
      to apply or remove an overlay changeset.
      
      If the device tree might be corrupt, do not allow further attempts
      to apply or remove an overlay changeset.
      
      When creating an overlay changeset from an overlay device tree,
      add some additional warnings if the state of the overlay device
      tree is not as expected.
      Signed-off-by: NFrank Rowand <frank.rowand@sony.com>
      Signed-off-by: NRob Herring <robh@kernel.org>
      24789c5c
    • F
      of: overlay: rename identifiers to more reflect what they do · 0290c4ca
      Frank Rowand 提交于
      This patch is aimed primarily at drivers/of/overlay.c, but those
      changes also have a small impact in a few other files.
      
      overlay.c is difficult to read and maintain.  Improve readability:
        - Rename functions, types and variables to better reflect what
          they do and to be consistent with names in other places,
          such as the device tree overlay FDT (flattened device tree),
          and make the algorithms more clear
        - Use the same names consistently throughout the file
        - Update comments for name changes
        - Fix incorrect comments
      
      This patch is intended to not introduce any functional change.
      Signed-off-by: NFrank Rowand <frank.rowand@sony.com>
      Signed-off-by: NRob Herring <robh@kernel.org>
      0290c4ca
  2. 17 10月, 2017 1 次提交
  3. 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
  4. 19 7月, 2017 1 次提交
  5. 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
  6. 05 5月, 2017 1 次提交
  7. 03 5月, 2017 1 次提交
  8. 28 4月, 2017 1 次提交
  9. 24 1月, 2017 1 次提交
  10. 05 1月, 2017 1 次提交
  11. 24 6月, 2016 1 次提交
  12. 19 5月, 2016 1 次提交
  13. 16 5月, 2016 1 次提交
  14. 22 4月, 2016 1 次提交
  15. 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
  16. 14 1月, 2016 1 次提交
  17. 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
  18. 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
  19. 27 7月, 2015 1 次提交
  20. 15 4月, 2015 1 次提交
  21. 29 3月, 2015 6 次提交
  22. 25 3月, 2015 1 次提交
  23. 19 3月, 2015 1 次提交
  24. 10 3月, 2015 4 次提交
  25. 05 2月, 2015 1 次提交
  26. 23 1月, 2015 2 次提交
  27. 14 1月, 2015 1 次提交
  28. 04 12月, 2014 2 次提交
  29. 28 11月, 2014 1 次提交