1. 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
  2. 15 11月, 2016 15 次提交
  3. 08 10月, 2016 1 次提交
    • P
      console: don't prefer first registered if DT specifies stdout-path · 05fd007e
      Paul Burton 提交于
      If a device tree specifies a preferred device for kernel console output
      via the stdout-path or linux,stdout-path chosen node properties or the
      stdout alias then the kernel ought to honor it & output the kernel
      console to that device.  As it stands, this isn't the case.  Whilst we
      parse the stdout-path properties & set an of_stdout variable from
      of_alias_scan(), and use that from of_console_check() to determine
      whether to add a console device as a preferred console whilst
      registering it, we also prefer the first registered console if no other
      has been selected at the time of its registration.
      
      This means that if a console other than the one the device tree selects
      via stdout-path is registered first, we will switch to using it & when
      the stdout-path console is later registered the call to
      add_preferred_console() via of_console_check() is too late to do
      anything useful.  In practice this seems to mean that we switch to the
      dummy console device fairly early & see no further console output:
      
          Console: colour dummy device 80x25
          console [tty0] enabled
          bootconsole [ns16550a0] disabled
      
      Fix this by not automatically preferring the first registered console if
      one is specified by the device tree.  This allows consoles to be
      registered but not enabled, and once the driver for the console selected
      by stdout-path calls of_console_check() the driver will be added to the
      list of preferred consoles before any other console has been enabled.
      When that console is then registered via register_console() it will be
      enabled as expected.
      
      Link: http://lkml.kernel.org/r/20160809151937.26118-1-paul.burton@imgtec.comSigned-off-by: NPaul Burton <paul.burton@imgtec.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Paul Burton <paul.burton@imgtec.com>
      Cc: Tejun Heo <tj@kernel.org>
      Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Cc: Jiri Slaby <jslaby@suse.cz>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Ivan Delalande <colona@arista.com>
      Cc: Thierry Reding <treding@nvidia.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: Jan Kara <jack@suse.com>
      Cc: Petr Mladek <pmladek@suse.com>
      Cc: Joe Perches <joe@perches.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Rob Herring <robh+dt@kernel.org>
      Cc: Frank Rowand <frowand.list@gmail.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      05fd007e
  4. 06 10月, 2016 1 次提交
    • P
      of/platform: Probe "isa" busses by default · ecd76ede
      Paul Burton 提交于
      Since commit 44a7185c ("of/platform: Add common method to populate
      default bus") platforms calling of_platform_bus_probe from an initcall
      is either a rather unsafe race with of_platform_default_populate_init or
      a no-op. The MIPS Malta board needs to probe devices under an ISA bus,
      which we do support in the of_busses array but until now haven't
      included in of_default_bus_match_table.
      
      Add an "isa" entry to of_default_bus_match_table such that we can just
      accept use of of_platform_default_populate_init & remove the
      Malta-specific match table in a later patch.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Acked-by: NRob Herring <robh@kernel.org>
      Cc: Frank Rowand <frowand.list@gmail.com>
      Cc: linux-mips@linux-mips.org
      Cc: devicetree@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Patchwork: https://patchwork.linux-mips.org/patch/14275/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      ecd76ede
  5. 28 9月, 2016 1 次提交
  6. 23 9月, 2016 1 次提交
  7. 16 9月, 2016 1 次提交
  8. 15 9月, 2016 3 次提交
    • R
      of/platform: Initialise dev->fwnode appropriately · f94277af
      Robin Murphy 提交于
      Whilst we're some of the way towards a universal firmware property
      interface, drivers which deal with both OF and ACPI probing end up
      having to do things like this:
      
          dev->of_node ? &dev->of_node->fwnode : dev->fwnode
      
      This seems unnecessary, when the OF code could instead simply fill in
      the device's fwnode when binding the of_node, and let the drivers use
      dev->fwnode either way. Let's give it a go and see what falls out.
      Signed-off-by: NRobin Murphy <robin.murphy@arm.com>
      Signed-off-by: NRob Herring <robh@kernel.org>
      f94277af
    • 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
    • R
      of: Make of_find_property_value_of_size take a length range · 79ac5d31
      Richard Fitzgerald 提交于
      In preparation for adding variable-length array reads, change
      of_find_property_value_of_size so that it takes an optional
      maximum length. If the maximum is passed as 0, the behaviour is
      unchanged and it will return a property if it's >= the requested
      minimum length. If maximum is non-zero it will only return a
      property whose length is min <= l <= max.
      Signed-off-by: NRichard Fitzgerald <rf@opensource.wolfsonmicro.com>
      Signed-off-by: NRob Herring <robh@kernel.org>
      79ac5d31
  9. 09 9月, 2016 6 次提交
  10. 16 8月, 2016 1 次提交
  11. 13 8月, 2016 1 次提交
    • K
      of/platform: disable the of_platform_default_populate_init() for all the ppc boards · fc520f8b
      Kevin Hao 提交于
      With the commit 44a7185c ("of/platform: Add common method to
      populate default bus"), a default function is introduced to populate
      the default bus and this function is invoked at the arch_initcall_sync
      level. But a lot of ppc boards use machine_device_initcall() to
      populate the default bus. This means that the default populate function
      has higher priority and would override the arch specific population of
      the bus. The side effect is that some arch specific bus are not probed,
      then cause various malfunction due to the miss of some devices. Since
      it is very possible to introduce bugs if we simply change the initcall
      level for all these boards(about 30+). This just disable this default
      function for all the ppc boards.
      Signed-off-by: NKevin Hao <haokexin@gmail.com>
      Signed-off-by: NRob Herring <robh@kernel.org>
      fc520f8b
  12. 10 8月, 2016 3 次提交
    • P
      of/irq: Mark interrupt controllers as populated before initialisation · e55aeb6b
      Philipp Zabel 提交于
      That way the init callback may clear the flag again, in case of drivers
      split between early irq chip and a normal platform driver.
      
      Fixes: 15cc2ed6 ("of/irq: Mark initialised interrupt controllers as populated")
      Suggested-by: NRob Herring <robh@kernel.org>
      Signed-off-by: NPhilipp Zabel <p.zabel@pengutronix.de>
      Acked-by: NJon Hunter <jonathanh@nvidia.com>
      Signed-off-by: NRob Herring <robh@kernel.org>
      e55aeb6b
    • 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
    • M
      of: Delete an unnecessary check before the function call "of_node_put" · beab47d5
      Markus Elfring 提交于
      The of_node_put() function tests whether its argument is NULL
      and then returns immediately.
      Thus the test around the call is not needed.
      
      This issue was detected by using the Coccinelle software.
      Signed-off-by: NMarkus Elfring <elfring@users.sourceforge.net>
      Signed-off-by: NRob Herring <robh@kernel.org>
      beab47d5
  13. 06 8月, 2016 1 次提交
  14. 20 7月, 2016 1 次提交
  15. 19 7月, 2016 3 次提交