1. 16 5月, 2016 2 次提交
    • G
      drivers/of: Avoid recursively calling unflatten_dt_node() · 50800082
      Gavin Shan 提交于
      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: NGavin Shan <gwshan@linux.vnet.ibm.com>
      Acked-by: NRob Herring <robh@kernel.org>
      Signed-off-by: NRob Herring <robh@kernel.org>
      50800082
    • G
      drivers/of: Split unflatten_dt_node() · dfbd4c6e
      Gavin Shan 提交于
      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: NGavin Shan <gwshan@linux.vnet.ibm.com>
      Acked-by: NRob Herring <robh@kernel.org>
      Signed-off-by: NRob Herring <robh@kernel.org>
      dfbd4c6e
  2. 25 4月, 2016 1 次提交
  3. 20 4月, 2016 6 次提交
  4. 15 3月, 2016 3 次提交
  5. 04 3月, 2016 3 次提交
    • D
      of: add 'const' for of_property_*_string*() parameter '*np' · fe99c707
      David Rivshin 提交于
      The of_property_{read,count,match}_string* family of functions never
      modify the struct device_node pointer that is passed in, so there is no
      reason for it to be non-const. Equivalent functions for all other types
      already take a 'const struct device_node *np'.
      Signed-off-by: NDavid Rivshin <drivshin@allworx.com>
      Signed-off-by: NRob Herring <robh@kernel.org>
      fe99c707
    • 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
    • V
      of: alloc anywhere from memblock if range not specified · e53b50c0
      Vinayak Menon 提交于
      early_init_dt_alloc_reserved_memory_arch passes end as 0 to
      __memblock_alloc_base, when limits are not specified. But
      __memblock_alloc_base takes end value of 0 as MEMBLOCK_ALLOC_ACCESSIBLE
      and limits the end to memblock.current_limit. This results in regions
      never being placed in HIGHMEM area, for e.g. CMA.
      Let __memblock_alloc_base allocate from anywhere in memory if limits are
      not specified.
      Acked-by: NMarek Szyprowski <m.szyprowski@samsung.com>
      Signed-off-by: NVinayak Menon <vinmenon@codeaurora.org>
      Cc: stable@vger.kernel.org
      Signed-off-by: NRob Herring <robh@kernel.org>
      e53b50c0
  6. 02 3月, 2016 2 次提交
  7. 19 2月, 2016 2 次提交
  8. 14 2月, 2016 1 次提交
    • A
      of: resolver: Add missing of_node_get and of_node_put · 82f68756
      Amitoj Kaur Chawla 提交于
      In __of_find_node_by_full_name, add an of_node_get when detecting the
      desired element, to ensure that it ends up with a reference count that is
      one greater than on entering the function.
      
      Also in __of_find_node_by_full_name, add an of_node_put on breaking
      out of the for_each_child_of_node loop, to ensure that the reference
      count of the returned value is not double incremented. This change
      was made using Coccinelle.
      
      The semantic patch used for this is as follows:
      
      // <smpl>
      @@
      expression e;
      local idexpression n;
      @@
      
       for_each_child_of_node(..., n) {
         ... when != of_node_put(n)
             when != e = n
      (
         return n;
      |
      +  of_node_put(n);
      ?  return ...;
      )
         ...
       }
      // </smpl
      
      Finally, add an of_node_put in for_each_child_of_node in the function
      __of_adjust_phandle_ref after the value returned by
      __of_find_node_by_full_name is no longer useful.
      Signed-off-by: NAmitoj Kaur Chawla <amitoj1606@gmail.com>
      Signed-off-by: NRob Herring <robh@kernel.org>
      82f68756
  9. 12 2月, 2016 1 次提交
  10. 09 2月, 2016 1 次提交
  11. 07 2月, 2016 6 次提交
  12. 06 2月, 2016 1 次提交
  13. 29 1月, 2016 2 次提交
  14. 26 1月, 2016 1 次提交
    • M
      of: MSI: Simplify irqdomain lookup · 14a0db3c
      Marc Zyngier 提交于
      So far, when trying to associate a device with its MSI domain,
      we first lookup the domain using a MSI token, and if this
      doesn't return anything useful, we pick up any domain matching
      the same node.
      
      This logic is broken for two reasons:
      1) Only the generic MSI code (PCI or platform) sets this token
         to PCI/MSI or platform MSI. So we're guaranteed that if there
         is something to be found, we will find it with the first call.
      2) If we have a convoluted situation where:
         - a single node implements both wired and MSI interrupts
         - MSI support for that HW hasn't been compiled in
         we'll end up using the wired domain for MSIs anyway, and things
         break badly.
      
      So let's just remove __of_get_msi_domain, and replace it by a direct
      call to irq_find_matching_host, because that's what we really want.
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      Acked-by: NRob Herring <robh+dt@kernel.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Frank Rowand <frowand.list@gmail.com>
      Cc: Grant Likely <grant.likely@linaro.org>
      Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
      Cc: Jiang Liu <jiang.liu@linux.intel.com>
      Link: http://lkml.kernel.org/r/1453816347-32720-3-git-send-email-marc.zyngier@arm.comSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      14a0db3c
  15. 14 1月, 2016 1 次提交
  16. 13 1月, 2016 1 次提交
  17. 08 1月, 2016 5 次提交
  18. 05 1月, 2016 1 次提交