1. 05 10月, 2014 2 次提交
  2. 02 10月, 2014 1 次提交
    • G
      of: Fix NULL dereference in selftest removal code · e66c98c7
      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>
      e66c98c7
  3. 25 9月, 2014 1 次提交
    • S
      of/fdt: fix memory range check · 9aacd602
      Srinivas Kandagatla 提交于
      In cases where board has below memory DT node
      
      memory{
      	device_type = "memory";
      	reg = <0x80000000 0x80000000>;
      };
      
      Check on the memory range in fdt.c will always fail because it is
      comparing MAX_PHYS_ADDR with base + size, in fact it should compare
      it with base + size - 1.
      
      This issue was originally noticed on Qualcomm IFC6410 board.
      Without this patch kernel shows up noticed unnecessary warnings
      
      [    0.000000] Machine model: Qualcomm APQ8064/IFC6410
      [    0.000000] Ignoring memory range 0xffffffff - 0x100000000
      [    0.000000] cma: Reserved 64 MiB at ab800000
      
      as a result the size get reduced to 0x7fffffff which looks wrong.
      
      This patch fixes the check involved in generating this warning and
      as a result it also fixes the wrong size calculation.
      Signed-off-by: NSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
      [grant.likely: adjust new size calculation also]
      Signed-off-by: NGrant Likely <grant.likely@linaro.org>
      9aacd602
  4. 08 9月, 2014 4 次提交
  5. 16 8月, 2014 3 次提交
  6. 04 8月, 2014 1 次提交
    • G
      of: Fixing OF Selftest build error · 32147e9a
      Gaurav Minocha 提交于
      This patch is to fix following error while compiling OF selftests.
      "drivers/of/selftest.c:617:2: error: implicit declaration of function
      'of_fdt_unflatten_tree'"
      
      Now, CONFIG_OF_SELFTEST depends on CONFIG_OF_EARLY_FLATTREE so that the
      broken configuration cannot be selected. Ultimately it would be a good
      idea to allow CONFIG_OF_SELFTEST to select CONFIG_OF_EARLY_FLATTREE, but
      there is a dependency problem on i386 and x86_64 that causes dtc to not
      get built and causes the build to fail. That problem needs to be fixed
      first.
      Signed-off-by: NGaurav Minocha <gaurav.minocha.os@gmail.com>
      Signed-off-by: NGrant Likely <grant.likely@linaro.org>
      32147e9a
  7. 02 8月, 2014 2 次提交
  8. 31 7月, 2014 1 次提交
  9. 30 7月, 2014 2 次提交
  10. 25 7月, 2014 1 次提交
    • G
      Adding selftest testdata dynamically into live tree · ae9304c9
      Gaurav Minocha 提交于
      This patch attaches selftest's device tree data (required by /drivers/of/selftest.c)
      dynamically into live device tree. First, it links selftest device tree data into the
      kernel image and then iterates over all the nodes and attaches them into the live tree.
      Once the testcases are complete, it removes the data attached.
      
      This patch will remove the manual process of addition and removal of selftest device
      tree data into the machine's dts file.
      
      Tested successfully with current selftest's testcases.
      Signed-off-by: NGaurav Minocha <gaurav.minocha.os@gmail.com>
      [glikely: Removed ability to build as a module and fixed no-devicetree bug]
      Signed-off-by: NGrant Likely <grant.likely@linaro.org>
      ae9304c9
  11. 24 7月, 2014 5 次提交
    • P
      of: Transactional DT support. · 201c910b
      Pantelis Antoniou 提交于
      Introducing DT transactional support.
      
      A DT transaction is a method which allows one to apply changes
      in the live tree, in such a way that either the full set of changes
      take effect, or the state of the tree can be rolled-back to the
      state it was before it was attempted. An applied transaction
      can be rolled-back at any time.
      
      Documentation is in
      	Documentation/devicetree/changesets.txt
      Signed-off-by: NPantelis Antoniou <pantelis.antoniou@konsulko.com>
      [glikely: Removed device notifiers and reworked to be more consistent]
      Signed-off-by: NGrant Likely <grant.likely@linaro.org>
      201c910b
    • G
      of: Reorder device tree changes and notifiers · 259092a3
      Grant Likely 提交于
      Currently, devicetree reconfig notifiers get emitted before the change
      is applied to the tree, but that behaviour is problematic if the
      receiver wants the determine the new state of the tree. The current
      users don't care, but the changeset code to follow will be making
      multiple changes at once. Reorder notifiers to get emitted after the
      change has been applied to the tree so that callbacks see the new tree
      state.
      
      At the same time, fixup the existing callbacks to expect the new order.
      There are a few callbacks that compare the old and new values of a
      changed property. Put both property pointers into the of_prop_reconfig
      structure.
      
      The current notifiers also allow the notifier callback to fail and
      cancel the change to the tree, but that feature isn't actually used.
      It really isn't valid to ignore a tree modification provided by firmware
      anyway, so remove the ability to cancel a change to the tree.
      Signed-off-by: NGrant Likely <grant.likely@linaro.org>
      Cc: Nathan Fontenot <nfont@austin.ibm.com>
      259092a3
    • G
      of: Move dynamic node fixups out of powerpc and into common code · a25095d4
      Grant Likely 提交于
      PowerPC does an odd thing with dynamic nodes. It uses a notifier to
      catch new node additions and set some of the values like name and type.
      This makes no sense since that same code can be put directly into
      of_attach_node(). Besides, all dynamic node users need this, not just
      powerpc. Fix this problem by moving the logic out of arch/powerpc and
      into drivers/of/dynamic.c.
      
      It is also important to remove this notifier because we want to move the
      firing of notifiers from before the tree is modified to after so that
      the receiver gets a consistent view of the tree, but that is
      incompatible with notifiers that modify the node.
      Signed-off-by: NGrant Likely <grant.likely@linaro.org>
      Cc: Nathan Fontenot <nfont@austin.ibm.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      a25095d4
    • G
      of: Make sure attached nodes don't carry along extra children · 6162dbe4
      Grant Likely 提交于
      The child pointer does not get cleared when attaching new nodes which
      could cause the tree to be inconsistent. Clear the child pointer in
      __of_attach_node() to be absolutely sure that the structure remains in a
      consistent layout.
      Signed-off-by: NGrant Likely <grant.likely@linaro.org>
      6162dbe4
    • G
      of: Make devicetree sysfs update functions consistent. · 8a2b22a2
      Grant Likely 提交于
      All of the DT modification functions are split into two parts, the first
      part manipulates the DT data structure, and the second part updates
      sysfs, but the code isn't very consistent about how the second half is
      called. They don't all enforce the same rules about when it is valid to
      update sysfs, and there isn't any clarity on locking.
      
      The transactional DT modification feature that is coming also needs
      access to these functions so that it can perform all the structure
      changes together, and then all the sysfs updates as a second stage
      instead of doing each one at a time.
      
      Fix up the second have by creating a separate __of_*_sysfs() function
      for each of the helpers. The new functions have consistent naming (ie.
      of_node_add() becomes __of_attach_node_sysfs()) and all of them now
      defer if of_init hasn't been called yet.
      
      Callers of the new functions must hold the of_mutex to ensure there are
      no race conditions with of_init(). The mutex ensures that there will
      only ever be one writer to the tree at any given time. There can still
      be any number of readers and the raw_spin_lock is still used to make
      sure access to the data structure is still consistent.
      
      Finally, put the function prototypes into of_private.h so they are
      accessible to the transaction code.
      Signed-off-by: NPantelis Antoniou <pantelis.antoniou@konsulko.com>
      [grant.likely: Changed suffix from _post to _sysfs to match existing code]
      [grant.likely: Reorganized to eliminate trivial wrappers]
      Signed-off-by: NGrant Likely <grant.likely@linaro.org>
      8a2b22a2
  12. 23 7月, 2014 1 次提交
  13. 16 7月, 2014 2 次提交
    • P
      of: Create unlocked versions of node and property add/remove functions · d8c50088
      Pantelis Antoniou 提交于
      The DT overlay code will need to manipulate nodes and properties while
      already holding the devicetree lock, or on nodes that are not yet
      attached to the tree, but the current helper functions don't allow that.
      Extract the core behaviour from the accessors and create the following
      unlocked variants.
      
      The unlocked variants require either the lock to already be held or for
      the nodes to be detached from the tree. Changes to live nodes will not
      get updated in sysfs, so the caller must arrange for housekeeping to
      take place after dropping the lock.
      
      The new functions are: __of_add_property(), __of_remove_property(),
      __of_update_property(), __of_attach_node() and __of_detach_node().
      Signed-off-by: NPantelis Antoniou <pantelis.antoniou@konsulko.com>
      [Remove unnecessary diff hunks and rewrite commit text]
      Signed-off-by: NGrant Likely <grant.likely@linaro.org>
      d8c50088
    • P
      OF: Utility helper functions for dynamic nodes · 69843396
      Pantelis Antoniou 提交于
      Introduce helper functions for working with the live DT tree,
      all of them related to dynamically adding/removing nodes and
      properties.
      
      __of_prop_dup() copies a property dynamically
      __of_node_alloc() creates an empty node
      
      Bug fix about prop->len == 0 by Ionut Nicu <ioan.nicu.ext@nsn.com>
      Signed-off-by: NPantelis Antoniou <pantelis.antoniou@konsulko.com>
      [glikely: Added unittest for of_copy_property and dropped fine-grained allocations]
      [glikely: removed name, type and phandle arguments from __of_node_alloc]
      Signed-off-by: NGrant Likely <grant.likely@linaro.org>
      69843396
  14. 07 7月, 2014 3 次提交
  15. 02 7月, 2014 1 次提交
  16. 27 6月, 2014 3 次提交
  17. 23 6月, 2014 1 次提交
  18. 17 6月, 2014 3 次提交
  19. 04 6月, 2014 2 次提交
  20. 03 6月, 2014 1 次提交