1. 19 5月, 2016 3 次提交
    • J
      of/unittest: Remove unnecessary module.h header inclusion · 27f4ec14
      Javier Martinez Canillas 提交于
      The OF_UNITTEST Kconfig symbol is bool so this unittest can only be
      built-in and not build as a module. Also, nothing defined in this
      header file used so is not necessary to include it.
      Signed-off-by: NJavier Martinez Canillas <javier@osg.samsung.com>
      Signed-off-by: NRob Herring <robh@kernel.org>
      27f4ec14
    • G
      drivers/of: Fix build warning in populate_node() · dddc33e5
      Gavin Shan 提交于
      Function populate_node() is used to unflatten FDT blob to device
      tree. It supports maximal 64 level of device nodes. There is one
      array @fpsizes[64] tracking the full name length of last unflattened
      device node in the corresponding level (index of element in the
      array - 1). Build warning is seen with CONFIG_FRAME_WARN=1024 like
      below on ARM64 as Geert reported. The issue can be reproduced on
      PPC64 as well.
      
        $ make drivers/of/fdt.o
        drivers/of/fdt.c:443:1: warning: the frame size of 1136 bytes is \
        larger than 1024 bytes [-Wframe-larger-than=]
      
      This changes the data type of @fpsizes[i] from "unsigned long" to
      "unsigned int" to avoid the build warning. The return value type
      of populate_node() and its @fpsize argument is adjusted accordingly.
      With this applied, 256 bytes saved from the stack frame on ARM64 and
      PPC64 platforms and the above warning isn't seen.
      
      Fixes: 50800082 ("drivers/of: Avoid recursively calling unflatten_dt_node()")
      Reported-by: NGeert Uytterhoeven <geert@linux-m68k.org>
      Signed-off-by: NGavin Shan <gwshan@linux.vnet.ibm.com>
      Signed-off-by: NRob Herring <robh@kernel.org>
      dddc33e5
    • R
      drivers/of: Fix depth when unflattening devicetree · 78c44d91
      Rhyland Klein 提交于
      When the implementation for unflatten_dt_node() changed from being
      recursive to being non-recursive, it had a side effect of increasing the
      depth passed to fdt_next_node() by 1. This is fine most of the time, but
      it seems that when the end of the dtb is being parsed, it will cause the
      FDT_END condition in fdt_next_node() to return a different value
      (returning nextoffset instead of -FDT_ERR_NOTFOUND). This ends up passing
      an FDT_ERR_TRUNCATED error back to the unflatten_dt_node() which then
      sees that and complains "Error -8 processing FDT" causing boot to fail.
      
      This patch simply avoids incrementing depth and uses modified accesses
      for local array indices so that the depth is the same as it was before
      the change as far as fdt_next_node() is concerned.
      
      This problem was discovered trying to boot Tegra210-Smaug platforms.
      
      Fixes: 50800082 ("drivers/of: Avoid recursively calling unflatten_dt_node()")
      Signed-off-by: NRhyland Klein <rklein@nvidia.com>
      [robh: squashed in KASAN fix from Rhyland]
      Signed-off-by: NRob Herring <robh@kernel.org>
      78c44d91
  2. 16 5月, 2016 7 次提交
  3. 25 4月, 2016 1 次提交
  4. 20 4月, 2016 6 次提交
  5. 15 3月, 2016 3 次提交
  6. 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
  7. 02 3月, 2016 2 次提交
  8. 19 2月, 2016 2 次提交
  9. 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
  10. 12 2月, 2016 1 次提交
  11. 09 2月, 2016 1 次提交
  12. 07 2月, 2016 6 次提交
  13. 06 2月, 2016 1 次提交
  14. 29 1月, 2016 2 次提交
  15. 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