1. 20 Nov, 2017 2 commits
  2. 16 Nov, 2017 7 commits
  3. 13 Nov, 2017 1 commit
  4. 09 Nov, 2017 4 commits
  5. 08 Nov, 2017 3 commits
  6. 01 Nov, 2017 1 commit
  7. 25 Oct, 2017 1 commit
  8. 23 Oct, 2017 1 commit
  9. 19 Oct, 2017 2 commits
  10. 18 Oct, 2017 12 commits
    • Frank Rowand's avatar
      of: overlay: remove unneeded check for NULL kbasename() · 34ca5d76
      Frank Rowand authored
      kbasename() will not return NULL if passed a valid string.  If
      the parameter passed to kbasename() in this case is already NULL
      then the devicetree has been corrupted.
      Signed-off-by: default avatarFrank Rowand <frank.rowand@sony.com>
      Signed-off-by: default avatarRob Herring <robh@kernel.org>
      34ca5d76
    • Frank Rowand's avatar
      of: overlay: remove a dependency on device node full_name · e0a58f3e
      Frank Rowand authored
      The "%pOF" printf format was recently added to print the
      full name of a device tree node, with the intent of changing
      the node full_name field to contain only the node name instead
      of the full path of the node.
      
      dup_and_fixup_symbol_prop() duplicates a property from the
      "/__symbols__" node of an overlay device tree.  The value
      of each duplicated property must be fixed up to include
      the full path of a node in the live device tree.  The
      current code uses the node's full_name for that purpose.
      Update the code to use the "%pOF" printf format to
      determine the node's full path.
      Signed-off-by: default avatarFrank Rowand <frank.rowand@sony.com>
      Signed-off-by: default avatarRob Herring <robh@kernel.org>
      e0a58f3e
    • Frank Rowand's avatar
      of: overlay: simplify applying symbols from an overlay · 3912b791
      Frank Rowand authored
      The code to apply symbols from an overlay to the live device tree
      was implemented with the intent to be minimally intrusive on the
      existing code.  After recent restructuring of the overlay apply
      code, it is easier to disintangle the code that applies the
      symbols, and to make the overlay changeset creation code more
      straight forward and understandable.
      
      Remove the extra complexity, and make the code more obvious.
      Signed-off-by: default avatarFrank Rowand <frank.rowand@sony.com>
      Signed-off-by: default avatarRob Herring <robh@kernel.org>
      3912b791
    • Frank Rowand's avatar
      of: overlay: avoid race condition between applying multiple overlays · f948d6d8
      Frank Rowand authored
      The process of applying an overlay consists of:
        - unflatten an overlay FDT (flattened device tree) into an
          EDT (expanded device tree)
        - fixup the phandle values in the overlay EDT to fit in a
          range above the phandle values in the live device tree
        - create the overlay changeset to reflect the contents of
          the overlay EDT
        - apply the overlay changeset, to modify the live device tree,
          potentially changing the maximum phandle value in the live
          device tree
      
      There is currently no protection against two overlay applies
      concurrently determining what range of phandle values are in use
      in the live device tree, and subsequently changing that range.
      Add a mutex to prevent multiple overlay applies from occurring
      simultaneously.
      
      Move of_resolve_phandles() into of_overlay_apply() so that it does not
      have to be duplicated by each caller of of_overlay_apply().
      
      The test in of_resolve_phandles() that the overlay tree is detached is
      temporarily disabled so that old style overlay unittests do not fail.
      Signed-off-by: default avatarFrank Rowand <frank.rowand@sony.com>
      Signed-off-by: default avatarRob Herring <robh@kernel.org>
      f948d6d8
    • Frank Rowand's avatar
      of: overlay: loosen overly strict phandle clash check · 6d0f5470
      Frank Rowand authored
      When an overlay contains a node that already exists in
      the live device tree, the overlay node is not allowed
      to change the phandle of the existing node.
      
      The existing check refused to allow an overlay node to
      set the node phandle even when the existing node did
      not have a phandle.  Relax the check to allow an
      overlay node to set the phandle value if the existing
      node does not have a phandle.
      Signed-off-by: default avatarFrank Rowand <frank.rowand@sony.com>
      Signed-off-by: default avatarRob Herring <robh@kernel.org>
      6d0f5470
    • Frank Rowand's avatar
      of: overlay: expand check of whether overlay changeset can be removed · 87f242c1
      Frank Rowand authored
      The test of whether it is safe to remove an overlay changeset
      looked at whether any node in the overlay changeset was in a
      subtree rooted at any more recently applied overlay changeset
      node.
      
      The test failed to determine whether any node in the overlay
      changeset was the root of a subtree that contained a more
      recently applied overlay changeset node.  Add this additional
      check to the test.
      
      The test is still lacking any check for any phandle dependencies.
      Signed-off-by: default avatarFrank Rowand <frank.rowand@sony.com>
      Signed-off-by: default avatarRob Herring <robh@kernel.org>
      87f242c1
    • Frank Rowand's avatar
      of: overlay: detect cases where device tree may become corrupt · 24789c5c
      Frank Rowand authored
      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: default avatarFrank Rowand <frank.rowand@sony.com>
      Signed-off-by: default avatarRob Herring <robh@kernel.org>
      24789c5c
    • Frank Rowand's avatar
      of: overlay: minor restructuring · 61b4de4e
      Frank Rowand authored
      Continue improving the readability of overlay.c.  The previous patches
      renamed identifiers.  This patch is split out from the previous patches
      to make the previous patches easier to review.
      
      Changes are:
        - minor code restructuring
        - some initialization of an overlay changeset occurred outside of
          init_overlay_changeset(), move that into init_overlay_changeset()
        - consolidate freeing an overlay changeset into free_overlay_changeset()
      
      This patch is intended to not introduce any functional change.
      Signed-off-by: default avatarFrank Rowand <frank.rowand@sony.com>
      Signed-off-by: default avatarRob Herring <robh@kernel.org>
      61b4de4e
    • Frank Rowand's avatar
      of: overlay: rename identifiers in dup_and_fixup_symbol_prop() · 42b2e94f
      Frank Rowand authored
      More renaming of identifiers to better reflect what they do.
      Signed-off-by: default avatarFrank Rowand <frank.rowand@sony.com>
      Signed-off-by: default avatarRob Herring <robh@kernel.org>
      42b2e94f
    • Frank Rowand's avatar
      of: overlay: rename identifiers to more reflect what they do · 0290c4ca
      Frank Rowand authored
      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: default avatarFrank Rowand <frank.rowand@sony.com>
      Signed-off-by: default avatarRob Herring <robh@kernel.org>
      0290c4ca
    • Frank Rowand's avatar
      of: overlay.c: Convert comparisons to zero or NULL to logical expressions · bbed8794
      Frank Rowand authored
      Use normal shorthand for comparing a variable to zero.
      For variable "XXX":
         convert (XXX == 0) to (!XXX)
         convert (XXX != 0) to (XXX)
      Signed-off-by: default avatarFrank Rowand <frank.rowand@sony.com>
      Signed-off-by: default avatarRob Herring <robh@kernel.org>
      bbed8794
    • Frank Rowand's avatar
      of: overlay.c: Remove comments that state the obvious, to reduce clutter · 646afc4a
      Frank Rowand authored
      Follows recommendations in Documentation/process/coding-style.rst,
      section 8, Commenting.
      
      Some in function comments are promoted to function header comments.
      Signed-off-by: default avatarFrank Rowand <frank.rowand@sony.com>
      Signed-off-by: default avatarRob Herring <robh@kernel.org>
      646afc4a
  11. 17 Oct, 2017 2 commits
  12. 16 Oct, 2017 4 commits