1. 27 11月, 2018 1 次提交
  2. 31 10月, 2018 3 次提交
  3. 27 10月, 2018 1 次提交
  4. 08 8月, 2018 1 次提交
    • M
      of/fdt: Remove PPC32 longtrail hack in memory scan · da653130
      Michael Ellerman 提交于
      When the OF code was originally made common by Grant in commit
      51975db0 ("of/flattree: merge early_init_dt_scan_memory() common
      code") (Feb 2010), the common code inherited a hack to handle
      PPC "longtrail" machines, which had a "memory@0" node with no
      device_type.
      
      That check was then made to only apply to PPC32 in b44aa25d ("of:
      Handle memory@0 node on PPC32 only") (May 2014).
      
      But according to Paul Mackerras the "longtrail" machines are long
      dead, if they were ever seen in the wild at all. If someone does still
      have one, we can handle this firmware wart in powerpc platform code.
      
      So remove the hack once and for all.
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      Signed-off-by: NRob Herring <robh@kernel.org>
      da653130
  5. 23 4月, 2018 1 次提交
    • D
      earlycon: Use a pointer table to fix __earlycon_table stride · dd709e72
      Daniel Kurtz 提交于
      Commit 99492c39 ("earlycon: Fix __earlycon_table stride") tried to fix
      __earlycon_table stride by forcing the earlycon_id struct alignment to 32
      and asking the linker to 32-byte align the __earlycon_table symbol.  This
      fix was based on commit 07fca0e5 ("tracing: Properly align linker
      defined symbols") which tried a similar fix for the tracing subsystem.
      
      However, this fix doesn't quite work because there is no guarantee that
      gcc will place structures packed into an array format.  In fact, gcc 4.9
      chooses to 64-byte align these structs by inserting additional padding
      between the entries because it has no clue that they are supposed to be in
      an array.  If we are unlucky, the linker will assign symbol
      "__earlycon_table" to a 32-byte aligned address which does not correspond
      to the 64-byte aligned contents of section "__earlycon_table".
      
      To address this same problem, the fix to the tracing system was
      subsequently re-implemented using a more robust table of pointers approach
      by commits:
       3d56e331 ("tracing: Replace syscall_meta_data struct array with pointer array")
       65498646 ("tracepoints: Fix section alignment using pointer array")
       e4a9ea5e ("tracing: Replace trace_event struct array with pointer array")
      
      Let's use this same "array of pointers to structs" approach for
      EARLYCON_TABLE.
      
      Fixes: 99492c39 ("earlycon: Fix __earlycon_table stride")
      Signed-off-by: NDaniel Kurtz <djkurtz@chromium.org>
      Suggested-by: NAaron Durbin <adurbin@chromium.org>
      Reviewed-by: NRob Herring <robh@kernel.org>
      Tested-by: NGuenter Roeck <groeck@chromium.org>
      Reviewed-by: NGuenter Roeck <groeck@chromium.org>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      dd709e72
  6. 08 1月, 2018 2 次提交
    • R
      of/fdt: use memblock_virt_alloc for early alloc · 0fa1c579
      Rob Herring 提交于
      memblock_virt_alloc() works for both memblock and bootmem, so use it and
      make early_init_dt_alloc_memory_arch a static function. The arches using
      bootmem define early_init_dt_alloc_memory_arch as either:
      
      __alloc_bootmem(size, align, __pa(MAX_DMA_ADDRESS))
      
      or:
      
      alloc_bootmem_align(size, align)
      
      Both of these evaluate to the same thing as does memblock_virt_alloc for
      bootmem. So we can disable the arch specific functions by making
      early_init_dt_alloc_memory_arch static and they can be removed in
      subsequent commits.
      
      Cc: Frank Rowand <frowand.list@gmail.com>
      Signed-off-by: NRob Herring <robh@kernel.org>
      0fa1c579
    • R
      of: Use SPDX license tag for DT files · af6074fc
      Rob Herring 提交于
      Convert remaining DT files to use SPDX-License-Identifier tags.
      
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
      Reviewed-by: NFrank Rowand <frank.rowand@sony.com>
      Reviewed-by: NPhilippe Ombredanne <pombredanne@nexb.com>
      Signed-off-by: NRob Herring <robh@kernel.org>
      af6074fc
  7. 17 10月, 2017 3 次提交
  8. 04 10月, 2017 1 次提交
    • R
      of/fdt: only store the device node basename in full_name · a7e4cfb0
      Rob Herring 提交于
      With dependencies on a statically allocated full path name converted to
      use %pOF format specifier, we can store just the basename of node, and
      the unflattening of the FDT can be simplified.
      
      This commit will affect the remaining users of full_name. After
      analyzing these users, the remaining cases should only change some print
      messages. The main users of full_name are providing a name for struct
      resource. The resource names shouldn't be important other than providing
      /proc/iomem names.
      
      We no longer distinguish between pre and post 0x10 dtb formats as either
      a full path or basename will work. However, less than 0x10 formats have
      been broken since the conversion to use libfdt (and no one has cared).
      The conversion of the unflattening code to be non-recursive also broke
      pre 0x10 formats as the populate_node function would return 0 in that
      case.
      Signed-off-by: NRob Herring <robh@kernel.org>
      a7e4cfb0
  9. 23 6月, 2017 2 次提交
  10. 18 5月, 2017 1 次提交
  11. 09 5月, 2017 1 次提交
  12. 05 5月, 2017 1 次提交
    • R
      of: fix sparse warnings in fdt, irq, reserved mem, and resolver code · 17a70355
      Rob Herring 提交于
      sparse generates the following warnings in drivers/of/:
      
      ../drivers/of/fdt.c:63:36: warning: cast to restricted __be32
      ../drivers/of/fdt.c:68:33: warning: cast to restricted __be32
      ../drivers/of/irq.c:105:88: warning: incorrect type in initializer (different base types)
      ../drivers/of/irq.c:105:88:    expected restricted __be32
      ../drivers/of/irq.c:105:88:    got int
      ../drivers/of/irq.c:526:35: warning: incorrect type in assignment (different modifiers)
      ../drivers/of/irq.c:526:35:    expected int ( *const [usertype] irq_init_cb )( ... )
      ../drivers/of/irq.c:526:35:    got void const *const data
      ../drivers/of/of_reserved_mem.c:200:50: warning: incorrect type in initializer (different modifiers)
      ../drivers/of/of_reserved_mem.c:200:50:    expected int ( *[usertype] initfn )( ... )
      ../drivers/of/of_reserved_mem.c:200:50:    got void const *const data
      ../drivers/of/resolver.c:95:42: warning: incorrect type in assignment (different base types)
      ../drivers/of/resolver.c:95:42:    expected unsigned int [unsigned] [usertype] <noident>
      ../drivers/of/resolver.c:95:42:    got restricted __be32 [usertype] <noident>
      
      All these are harmless type mismatches fixed by adjusting the types.
      Signed-off-by: NRob Herring <robh@kernel.org>
      17a70355
  13. 28 4月, 2017 1 次提交
  14. 09 2月, 2017 1 次提交
  15. 03 1月, 2017 1 次提交
  16. 13 12月, 2016 1 次提交
  17. 28 9月, 2016 1 次提交
  18. 10 8月, 2016 1 次提交
    • G
      drivers/of: Validate device node in __unflatten_device_tree() · 89c67752
      Gavin Shan 提交于
      @mynodes is set to NULL when __unflatten_device_tree() is called
      to unflatten device sub-tree in PCI hot add scenario on PowerPC
      PowerNV platform. Marking @mynodes detached unconditionally causes
      kernel crash as below backtrace shows:
      
      Unable to handle kernel paging request for data at address 0x00000000
      Faulting instruction address: 0xc000000000b26f64
      cpu 0x0: Vector: 300 (Data Access) at [c000003fcc7cf740]
          pc: c000000000b26f64: __unflatten_device_tree+0xf4/0x190
          lr: c000000000b26f40: __unflatten_device_tree+0xd0/0x190
          sp: c000003fcc7cf9c0
         msr: 900000000280b033
         dar: 0
       dsisr: 40000000
        current = 0xc000003fcc281680
        paca    = 0xc00000000ff00000	 softe: 0	 irq_happened: 0x01
          pid   = 2724, comm = sh
      Linux version 4.7.0-gavin-07754-g92a6836 (gwshan@gwshan) (gcc version \
      4.9.3 (Buildroot 2016.02-rc2-00093-g5ea3bce) ) #539 SMP Mon Aug 1 \
      12:40:29 AEST 2016
      enter ? for help
      [c000003fcc7cfa50] c000000000b27060 of_fdt_unflatten_tree+0x60/0x90
      [c000003fcc7cfaa0] c0000000004c6288 pnv_php_set_slot_power_state+0x118/0x440
      [c000003fcc7cfb80] c0000000004c6a10 pnv_php_enable+0xc0/0x170
      [c000003fcc7cfbd0] c0000000004c4d80 power_write_file+0xa0/0x190
      [c000003fcc7cfc50] c0000000004be93c pci_slot_attr_store+0x3c/0x60
      [c000003fcc7cfc70] c0000000002d3fd4 sysfs_kf_write+0x94/0xc0
      [c000003fcc7cfcb0] c0000000002d2c30 kernfs_fop_write+0x180/0x260
      [c000003fcc7cfd00] c000000000230fe0 __vfs_write+0x40/0x190
      [c000003fcc7cfd90] c000000000232278 vfs_write+0xc8/0x240
      [c000003fcc7cfde0] c000000000233d90 SyS_write+0x60/0x110
      [c000003fcc7cfe30] c000000000009524 system_call+0x38/0x108
      
      This avoids the kernel crash by marking @mynodes detached only when
      @mynodes is dereferencing valid device node in __unflatten_device_tree().
      
      Fixes: 1d1bde55 ("of: fdt: mark unflattened tree as detached")
      Reported-by: NMeng Li <shlimeng@cn.ibm.com>
      Signed-off-by: NGavin Shan <gwshan@linux.vnet.ibm.com>
      Signed-off-by: NRob Herring <robh@kernel.org>
      89c67752
  19. 19 7月, 2016 2 次提交
  20. 06 7月, 2016 1 次提交
  21. 10 6月, 2016 1 次提交
  22. 19 5月, 2016 2 次提交
    • 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
  23. 16 5月, 2016 5 次提交
  24. 20 4月, 2016 1 次提交
  25. 19 2月, 2016 2 次提交
  26. 07 2月, 2016 2 次提交