1. 16 May, 2016 2 commits
    • Gavin Shan's avatar
      drivers/of: Avoid recursively calling unflatten_dt_node() · 50800082
      Gavin Shan authored
      In current implementation, unflatten_dt_node() is called recursively
      to unflatten device nodes in FDT blob. It's stress to limited stack
      capacity, especially to adopt the function to unflatten device sub-tree
      that possibly has multiple root nodes. In that case, we runs out of
      stack and the system can't boot up successfully.
      
      In order to reuse the function to unflatten device sub-tree, this avoids
      calling the function recursively, meaning the device nodes are unflattened
      in one call on unflatten_dt_node(): two arrays are introduced to track the
      parent path size and the device node of current level of depth, which will
      be used by the device node on next level of depth to be unflattened. All
      device nodes in more than 64 level of depth are dropped and hopefully,
      the system can boot up successfully with the partial device-tree.
      
      Also, the parameter "poffset" and "fpsize" are unused and dropped and the
      parameter "dryrun" is figured out from "mem == NULL". Besides, the return
      value of the function is changed to indicate the size of memory consumed by
      the unflatten device tree or error code.
      Signed-off-by: default avatarGavin Shan <gwshan@linux.vnet.ibm.com>
      Acked-by: default avatarRob Herring <robh@kernel.org>
      Signed-off-by: default avatarRob Herring <robh@kernel.org>
      50800082
    • Gavin Shan's avatar
      drivers/of: Split unflatten_dt_node() · dfbd4c6e
      Gavin Shan authored
      The function unflatten_dt_node() is called recursively to unflatten
      device nodes and properties in the FDT blob. It looks complicated
      and hard to be understood.
      
      This splits the function into 3 functions: populate_properties(),
      populate_node() and unflatten_dt_node(). populate_properties(),
      which is called by populate_node(), creates properties for the
      indicated device node. The later one creates the device nodes
      from FDT blob. populate_node() gets the offset in FDT blob for
      next device nodes and then calls populate_node(). No logical
      changes introduced.
      Signed-off-by: default avatarGavin Shan <gwshan@linux.vnet.ibm.com>
      Acked-by: default avatarRob Herring <robh@kernel.org>
      Signed-off-by: default avatarRob Herring <robh@kernel.org>
      dfbd4c6e
  2. 02 May, 2016 1 commit
    • Arnd Bergmann's avatar
      of: include errno.h in of_graph.h · 011d6f5c
      Arnd Bergmann authored
      When CONFIG_OF is disabled, we have to include linux/errno.h before
      including of_graph.h, or get build errors like in the newly added
      sun4i drm driver:
      
      In file included from ../drivers/gpu/drm/sun4i/sun4i_drv.c:14:0:
      include/linux/of_graph.h: In function 'of_graph_parse_endpoint':
      include/linux/of_graph.h:58:10: error: 'ENOSYS' undeclared (first use in this function)
      
      A better solution is to ensure that the header can be included
      by itself, so let's include linux/errno.h here to fix the error
      we just got, and any similar future error.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Fixes: 9026e0d1 ("drm: Add Allwinner A10 Display Engine support")
      Signed-off-by: default avatarRob Herring <robh@kernel.org>
      011d6f5c
  3. 25 Apr, 2016 21 commits
  4. 19 Apr, 2016 16 commits