1. 01 12月, 2015 3 次提交
  2. 11 11月, 2015 2 次提交
    • J
      drivers: of: of_reserved_mem: fixup the alignment with CMA setup · 1cc8e345
      Jason Liu 提交于
      There is an alignment mismatch issue between the of_reserved_mem and
      the CMA setup requirement. The of_reserved_mem will try to get the
      alignment value from the DTS and pass it to __memblock_alloc_base to
      do the memory block base allocation, but the alignment value specified
      in the DTS may not satisfy the CAM setup requirement since CMA setup
      required the alignment as the following in the code:
      
      align = PAGE_SIZE << max(MAX_ORDER - 1, pageblock_order);
      
      The sanity check in the function of rmem_cma_setup will fail if the
      alignment does not setup correctly and thus CMA will fail to setup.
      
      This patch is to fixup the alignment to meet the CMA setup required.
      
      Mailing-list-thread: https://lkml.org/lkml/2015/11/9/138Signed-off-by: NJason Liu <r64343@freescale.com>
      Acked-by: NMarek Szyprowski <m.szyprowski@samsung.com>
      Cc: Grant Likely <grant.likely@linaro.org>
      Cc: Rob Herring <robh+dt@kernel.org>
      Cc: stable@vger.kernel.org
      Signed-off-by: NRob Herring <robh@kernel.org>
      1cc8e345
    • M
      of: Print rather than WARN'ing when overlap check fails · 85a1c77f
      Michael Ellerman 提交于
      __rmem_check_for_overlap() is called very early in boot, and on some
      powerpc systems it's not safe to call WARN that early in boot.
      
      If the overlap check fails the system will oops instead of printing a
      warning. Furthermore because it's so early in boot the console is not up
      and the user doesn't see the oops, they just get a dead system.
      
      Fix it by printing an error instead of calling WARN.
      
      Fixes: ae1add24 ("of: Check for overlap in reserved memory regions")
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      Signed-off-by: NRob Herring <robh@kernel.org>
      85a1c77f
  3. 07 11月, 2015 2 次提交
  4. 31 10月, 2015 2 次提交
  5. 28 10月, 2015 2 次提交
    • R
      of: add config option to enable building of all dtbs · 1b7c501b
      Rob Herring 提交于
      Enable building all dtb files when CONFIG_OF_ALL_DTBS is enabled. The dtbs
      are not really dependent on a platform being enabled or any other kernel
      config, so for testing coverage it is convenient to build all of the dtbs.
      
      In order to only build dtbs, this option can be used by creating an
      allno.config file containing:
      CONFIG_COMPILE_TEST=y
      CONFIG_OF=y
      CONFIG_OF_ALL_DTBS=y
      
      And then running:
      make KCONFIG_ALLCONFIG=1 allnoconfig
      make dtbs
      
      While building the dtbs themselves don't need a cross compiler, the
      scripts dependency does need one. This can be hacked around by
      commenting out "subdir-y += mod" in scripts/Makefile.
      Signed-off-by: NRob Herring <robh@kernel.org>
      Cc: Frank Rowand <frowand.list@gmail.com>
      Cc: Grant Likely <grant.likely@linaro.org>
      1b7c501b
    • M
      of/fdt: fix error checking for earlycon address · 3f5ceec9
      Masahiro Yamada 提交于
      fdt_translate_address() returns OF_BAD_ADDR on error.  It is defined as
      a u64 value, so the variable "addr" should be defined as u64 as well.
      
      Fixes: fb11ffe7 ("of/fdt: add FDT serial scanning for earlycon")
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      Signed-off-by: NRob Herring <robh@kernel.org>
      3f5ceec9
  6. 22 10月, 2015 4 次提交
    • J
      of/overlay: add missing of_node_put · 001cf504
      Julia Lawall 提交于
      for_each_child_of_node performs an of_node_get on each iteration, so
      a break out of the loop requires an of_node_put.
      
      A simplified version of the semantic patch that fixes this problem is as
      follows (http://coccinelle.lip6.fr):
      
      // <smpl>
      @@
      expression root,e;
      local idexpression child;
      @@
      
       for_each_child_of_node(root, child) {
         ... when != of_node_put(child)
             when != e = child
      (
         return child;
      |
      +  of_node_put(child);
      ?  return ...;
      )
         ...
       }
      // </smpl>
      Signed-off-by: NJulia Lawall <Julia.Lawall@lip6.fr>
      Signed-off-by: NRob Herring <robh@kernel.org>
      001cf504
    • J
      of/platform: add missing of_node_put · 7fad948a
      Julia Lawall 提交于
      for_each_child_of_node performs an of_node_get on each iteration, so
      a break out of the loop requires an of_node_put.
      
      A simplified version of the semantic patch that fixes this problem is as
      follows (http://coccinelle.lip6.fr):
      
      // <smpl>
      @@
      local idexpression n;
      expression root,e;
      @@
      
       for_each_child_of_node(root,n) {
         ...
      (
         of_node_put(n);
      |
         e = n
      |
      +  of_node_put(n);
      ?  break;
      )
         ...
       }
      ... when != n
      // </smpl>
      Signed-off-by: NJulia Lawall <Julia.Lawall@lip6.fr>
      Signed-off-by: NRob Herring <robh@kernel.org>
      7fad948a
    • J
      of/irq: add missing of_node_put · 8363ccb9
      Julia Lawall 提交于
      for_each_matching_node performs an of_node_get on each iteration, so
      a break out of the loop requires an of_node_put.
      
      A simplified version of the semantic patch that fixes this problem is as
      follows (http://coccinelle.lip6.fr):
      
      // <smpl>
      @@
      local idexpression n;
      expression e;
      identifier l;
      @@
      
       for_each_matching_node(n,...) {
         ...
      (
         of_node_put(n);
      |
         e = n
      |
      +  of_node_put(n);
      ?  goto l;
      )
         ...
       }
      ...
      l: ... when != n
      // </smpl>
      
      Besides the issue found by the semantic patch, this code also stores the
      device_node value in a list, which requires an of_node_get, and then cleans
      up the list on exit from the function, which requires an of_node_put.
      Signed-off-by: NJulia Lawall <Julia.Lawall@lip6.fr>
      Signed-off-by: NRob Herring <robh@kernel.org>
      8363ccb9
    • J
      of/unittest: add missing of_node_put · 855ff287
      Julia Lawall 提交于
      for_each_child_of_node performs an of_node_get on each iteration, so
      a break out of the loop requires an of_node_put.
      
      A simplified version of the semantic patch that fixes this problem is as
      follows (http://coccinelle.lip6.fr):
      
      // <smpl>
      @@
      expression root,e;
      local idexpression child;
      @@
      
       for_each_child_of_node(root, child) {
         ... when != of_node_put(child)
             when != e = child
      (
         return child;
      |
      +  of_node_put(child);
      ?  return ...;
      )
         ...
       }
      // </smpl>
      
      Combine the puts into code at the end of the function, for conciseness.
      Signed-off-by: NJulia Lawall <Julia.Lawall@lip6.fr>
      Signed-off-by: NRob Herring <robh@kernel.org>
      855ff287
  7. 18 10月, 2015 1 次提交
  8. 16 10月, 2015 5 次提交
  9. 14 10月, 2015 4 次提交
    • J
      of/irq: make of_irq_find_parent static · 52493d44
      Jonas Gorski 提交于
      of_irq_find_parent has no users outside of of_irq.c, so it does not make
      sense to expose it in of_irq.h. Therefore remove the prototype and dummy
      implmeentation and make the function static instead.
      Signed-off-by: NJonas Gorski <jogo@openwrt.org>
      Signed-off-by: NRob Herring <robh@kernel.org>
      52493d44
    • S
      of/fdt: fix aliases with baudrate in earlycon · 6296ad9e
      Stefan Agner 提交于
      Many boards use an alias in the stdout-path specification along
      with console options after a colon (e.g. serial0:115200n8). When
      using earlycon, this specification currently does not work. While
      fdt_path_offset supports alias resolution, it does not remove the
      console options by itself. Use the fdt_path_offset_namelen variant
      and provide the length of the alias to enable aliases with console
      options in the stdout-path.
      Signed-off-by: NStefan Agner <stefan@agner.ch>
      Signed-off-by: NRob Herring <robh@kernel.org>
      6296ad9e
    • P
      PCI: of: Ignore resources with failed translation · f134f251
      Pavel Fedin 提交于
      This patch allows PCI host controller to function even if part of resources
      is unusable for some reason. An example is non-LPAE kernel on a machine
      which has some 64-bit resources. Unusable resources will be just skipped
      instead of a complete failure.
      Signed-off-by: NPavel Fedin <p.fedin@samsung.com>
      Signed-off-by: NRob Herring <robh@kernel.org>
      f134f251
    • P
      PCI: of: Add 64-bit address recognition without LPAE support · 4af97106
      Pavel Fedin 提交于
      If non-LPAE kernel is booted up on a machine with 64-bit PCI resources,
      PCI controller probe fails with:
      
      PCI host bridge /pcie@10000000 ranges:
         IO 0x3eff0000..0x3effffff -> 0x00000000
        MEM 0x10000000..0x3efeffff -> 0x10000000
        MEM 0x8000000000..0xffffffffff -> 0x8000000000
      pci-host-generic 3f000000.pcie: resource collision: [mem 0x00000000-0xffffffff] conflicts with /pl011@9000000 [mem 0x09000000-0x09000fff]
      pci-host-generic: probe of 3f000000.pcie failed with error -16
      
      This happens because res->start assignment in of_pci_range_to_resource()
      truncates the upper part of the address, because res->start is of
      phys_addr_t type, which is 32-bit on non-LPAE kernels.
      
      This patch adds explicit recognition of 64-bit resources, preventing from
      potential problems when e. g. 0x8000001234 would be converted to
      0x00001234.
      Signed-off-by: NPavel Fedin <p.fedin@samsung.com>
      Signed-off-by: NRob Herring <robh@kernel.org>
      4af97106
  10. 25 9月, 2015 1 次提交
    • R
      of_mdio: fix MDIO phy device refcounting · f018ae7a
      Russell King 提交于
      bus_find_device() is defined as:
      
       * This is similar to the bus_for_each_dev() function above, but it
       * returns a reference to a device that is 'found' for later use, as
       * determined by the @match callback.
      
      and it does indeed return a reference-counted pointer to the device:
      
              while ((dev = next_device(&i)))
                      if (match(dev, data) && get_device(dev))
                                              ^^^^^^^^^^^^^^^
                              break;
              klist_iter_exit(&i);
              return dev;
      
      What that means is that when we're done with the struct device, we must
      drop that reference.  Neither of_phy_connect() nor of_phy_attach() did
      this when phy_connect_direct() or phy_attach_direct() failed.
      
      With our previous patch, phy_connect_direct() and phy_attach_direct()
      take a new refcount on the phy device when successful, so we can drop
      our local reference immediatley after these functions, whether or not
      they succeeded.
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      Acked-by: NRob Herring <robh@kernel.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f018ae7a
  11. 18 9月, 2015 3 次提交
  12. 17 9月, 2015 1 次提交
  13. 01 9月, 2015 1 次提交
  14. 27 8月, 2015 1 次提交
  15. 26 8月, 2015 2 次提交
  16. 24 8月, 2015 1 次提交
  17. 30 7月, 2015 1 次提交
  18. 27 7月, 2015 2 次提交
  19. 22 7月, 2015 1 次提交
    • S
      of_mdio: add new DT property 'managed' to specify the PHY management type · 4cba5c21
      Stas Sergeev 提交于
      Currently the PHY management type is selected by the MAC driver arbitrary.
      The decision is based on the presence of the "fixed-link" node and on a
      will of the driver's authors.
      This caused a regression recently, when mvneta driver suddenly started
      to use the in-band status for auto-negotiation on fixed links.
      It appears the auto-negotiation may not work when expected by the MAC driver.
      Sebastien Rannou explains:
      << Yes, I confirm that my HW does not generate an in-band status. AFAIK, it's
      a PHY that aggregates 4xSGMIIs to 1xQSGMII ; the MAC side of the PHY (with
      inband status) is connected to the switch through QSGMII, and in this context
      we are on the media side of the PHY. >>
      https://lkml.org/lkml/2015/7/10/206
      
      This patch introduces the new string property 'managed' that allows
      the user to set the management type explicitly.
      The supported values are:
      "auto" - default. Uses either MDIO or nothing, depending on the presence
      of the fixed-link node
      "in-band-status" - use in-band status
      Signed-off-by: NStas Sergeev <stsp@users.sourceforge.net>
      
      CC: Rob Herring <robh+dt@kernel.org>
      CC: Pawel Moll <pawel.moll@arm.com>
      CC: Mark Rutland <mark.rutland@arm.com>
      CC: Ian Campbell <ijc+devicetree@hellion.org.uk>
      CC: Kumar Gala <galak@codeaurora.org>
      CC: Florian Fainelli <f.fainelli@gmail.com>
      CC: Grant Likely <grant.likely@linaro.org>
      CC: devicetree@vger.kernel.org
      CC: linux-kernel@vger.kernel.org
      CC: netdev@vger.kernel.org
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4cba5c21
  20. 01 7月, 2015 1 次提交