1. 08 1月, 2018 1 次提交
  2. 08 11月, 2017 1 次提交
    • A
      of: add of_property_read_variable_* dummy helpers · 96c623e5
      Arnd Bergmann 提交于
      Commit a67e9472 ("of: Add array read functions with min/max size
      limits") added a new interface for reading variable-length arrays from
      DT properties. One user was added in dsa recently and this causes a
      build error because that code can be built with CONFIG_OF disabled:
      
      net/dsa/dsa2.c: In function 'dsa_switch_parse_member_of':
      net/dsa/dsa2.c:678:7: error: implicit declaration of function 'of_property_read_variable_u32_array'; did you mean 'of_property_read_u32_array'? [-Werror=implicit-function-declaration]
      
      This adds a dummy functions for of_property_read_variable_u32_array()
      and a few others that had been missing here. I decided to move
      of_property_read_string() and of_property_read_string_helper() in the
      process to make it easier to compare the two sets of function prototypes
      to make sure they match.
      
      Fixes: 975e6e32 ("net: dsa: rework switch parsing")
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Acked-by: NRob Herring <robh@kernel.org>
      Reviewed-by: NVivien Didelot <vivien.didelot@savoirfairelinux.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      96c623e5
  3. 18 10月, 2017 3 次提交
    • F
      of: overlay: avoid race condition between applying multiple overlays · f948d6d8
      Frank Rowand 提交于
      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: NFrank Rowand <frank.rowand@sony.com>
      Signed-off-by: NRob Herring <robh@kernel.org>
      f948d6d8
    • 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
  4. 17 10月, 2017 4 次提交
  5. 14 10月, 2017 1 次提交
  6. 22 7月, 2017 1 次提交
  7. 22 6月, 2017 1 次提交
  8. 15 6月, 2017 1 次提交
  9. 01 6月, 2017 2 次提交
  10. 03 4月, 2017 1 次提交
  11. 29 3月, 2017 1 次提交
  12. 17 1月, 2017 1 次提交
  13. 10 12月, 2016 1 次提交
  14. 18 11月, 2016 1 次提交
    • S
      of: base: add support to get machine model name · e5269794
      Sudeep Holla 提交于
      Currently platforms/drivers needing to get the machine model name are
      replicating the same snippet of code. In some case, the OF reference
      counting is either missing or incorrect.
      
      This patch adds support to read the machine model name either using
      the "model" or the "compatible" property in the device tree root node
      to the core OF/DT code.
      
      This can be used to remove all the duplicate code snippets doing exactly
      same thing later.
      
      Cc: Rob Herring <robh+dt@kernel.org>
      Cc: Frank Rowand <frowand.list@gmail.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Signed-off-by: NSudeep Holla <sudeep.holla@arm.com>
      Signed-off-by: NRob Herring <robh@kernel.org>
      e5269794
  15. 11 11月, 2016 1 次提交
    • A
      of/overlay: add of overlay notifications · 39a842e2
      Alan Tull 提交于
      This patch add of overlay notifications.
      
      When DT overlays are being added, some drivers/subsystems
      need to see device tree overlays before the changes go into
      the live tree.
      
      This is distinct from reconfig notifiers that are
      post-apply or post-remove and which issue very granular
      notifications without providing access to the context
      of a whole overlay.
      
      The following 4 notificatons are issued:
        OF_OVERLAY_PRE_APPLY
        OF_OVERLAY_POST_APPLY
        OF_OVERLAY_PRE_REMOVE
        OF_OVERLAY_POST_REMOVE
      
      In the case of pre-apply notification, if the notifier
      returns error, the overlay will be rejected.
      
      This patch exports two functions for registering/unregistering
      notifications:
        of_overlay_notifier_register(struct notifier_block *nb)
        of_overlay_notifier_unregister(struct notifier_block *nb)
      
      The of_mutex is held during these notifications. The
      notification data includes pointers to the overlay target
      and the overlay:
      
      struct of_overlay_notify_data {
             struct device_node *overlay;
             struct device_node *target;
      };
      Signed-off-by: NAlan Tull <atull@opensource.altera.com>
      Acked-by: NRob Herring <robh@kernel.org>
      Acked-by: NMoritz Fischer <moritz.fischer@ettus.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      39a842e2
  16. 15 9月, 2016 1 次提交
    • R
      of: Add array read functions with min/max size limits · a67e9472
      Richard Fitzgerald 提交于
      Add a new set of array reading functions that take a minimum and
      maximum size limit and will fail if the property size is not within
      the size limits. This makes it more convenient for drivers that
      use variable-size DT arrays which must be bounded at both ends -
      data must be at least N entries but must not overflow the array
      it is being copied into. It is also more efficient than making this
      functionality out of existing public functions and avoids duplication.
      
      The existing array functions have been left in the API, since there
      are a very large number of clients of those functions and their
      existing functionality is still useful. This avoids turning a small
      API improvement into a major kernel rework.
      
      The old functions have been turned into mininmal static inlines calling
      the new functions. The old functions had no upper limit on the actual
      size of the dts entry, to preserve this functionality rather than keeping
      two near-identical implementations, if the new function is called with
      max=0 there is no limit on the size of the dts entry but only the min
      number of elements are read.
      Signed-off-by: NRichard Fitzgerald <rf@opensource.wolfsonmicro.com>
      Signed-off-by: NRob Herring <robh@kernel.org>
      a67e9472
  17. 20 7月, 2016 1 次提交
  18. 28 6月, 2016 1 次提交
    • D
      of: Add a new macro to declare_of for one parameter function returning a value · c35d9292
      Daniel Lezcano 提交于
      The macro OF_DECLARE_1 expect a void (*func)(struct device_node *) while the
      OF_DECLARE_2 expect a int (*func)(struct device_node *, struct device_node *).
      
      The second one allows to pass an init function returning a value, which make
      possible to call the functions in the table and check the return value in order
      to catch at a higher level the errors and handle them from there instead of
      doing a panic in each driver (well at least this is the case for the clkevt).
      
      Unfortunately the OF_DECLARE_1 does not allow that and that lead to some code
      duplication and crappyness in the drivers.
      
      The OF_DECLARE_1 is used by all the clk drivers and the clocksource/clockevent
      drivers. It is not possible to do the change in one shot as we have to change
      all the init functions.
      
      The OF_DECLARE_2 specifies an init function prototype with two parameters with
      the node and its parent. The latter won't be used, ever, in the timer drivers.
      
      Introduce a OF_DECLARE_1_RET macro to be used, and hopefully we can smoothly
      and iteratively change the users of OF_DECLARE_1 to use the new macro instead.
      Signed-off-by: NDaniel Lezcano <daniel.lezcano@linaro.org>
      Acked-by: NRob Herring <robh@kernel.org>
      c35d9292
  19. 26 6月, 2016 1 次提交
  20. 03 6月, 2016 1 次提交
  21. 28 4月, 2016 1 次提交
  22. 20 4月, 2016 4 次提交
  23. 16 4月, 2016 1 次提交
  24. 04 3月, 2016 1 次提交
  25. 25 1月, 2016 1 次提交
  26. 11 11月, 2015 1 次提交
  27. 26 8月, 2015 1 次提交
  28. 25 6月, 2015 1 次提交
  29. 23 6月, 2015 1 次提交
  30. 04 6月, 2015 1 次提交
  31. 28 5月, 2015 1 次提交