1. 03 7月, 2017 1 次提交
  2. 28 6月, 2017 1 次提交
    • P
      vsprintf: Add %p extension "%pOF" for device tree · ce4fecf1
      Pantelis Antoniou 提交于
      90% of the usage of device node's full_name is printing it out in a
      kernel message. However, storing the full path for every node is
      wasteful and redundant. With a custom format specifier, we can generate
      the full path at run-time and eventually remove the full path from every
      node.
      
      For instance typical use is:
      	pr_info("Frobbing node %s\n", node->full_name);
      
      Which can be written now as:
      	pr_info("Frobbing node %pOF\n", node);
      
      '%pO' is the base specifier to represent kobjects with '%pOF'
      representing struct device_node. Currently, struct device_node is the
      only supported type of kobject.
      
      More fine-grained control of formatting includes printing the name,
      flags, path-spec name and others, explained in the documentation entry.
      
      Originally written by Pantelis, but pretty much rewrote the core
      function using existing string/number functions. The 2 passes were
      unnecessary and have been removed. Also, updated the checkpatch.pl
      check. The unittest code was written by Grant Likely.
      Signed-off-by: NPantelis Antoniou <pantelis.antoniou@konsulko.com>
      Acked-by: NJoe Perches <joe@perches.com>
      Signed-off-by: NRob Herring <robh@kernel.org>
      ce4fecf1
  3. 23 6月, 2017 8 次提交
  4. 22 6月, 2017 3 次提交
  5. 14 6月, 2017 2 次提交
  6. 01 6月, 2017 1 次提交
    • S
      of: Move OF property and graph API from base.c to property.c · 1df09bc6
      Sakari Ailus 提交于
      base.c contains both core OF functions and increasingly other
      functionality such as accessing properties and graphs, including
      convenience functions. In the near future this would also include OF
      specific implementation of the fwnode property and graph APIs.
      
      Create driver/of/property.c to contain procedures for accessing and
      interpreting device tree properties. The procedures are moved from
      drivers/of/base.c, with no changes other than copying only the includes
      required by the moved procedures.
      Signed-off-by: NSakari Ailus <sakari.ailus@linux.intel.com>
      Signed-off-by: NRob Herring <robh@kernel.org>
      1df09bc6
  7. 30 5月, 2017 1 次提交
    • S
      iommu/of: Ignore all errors except EPROBE_DEFER · a37b19a3
      Sricharan R 提交于
      While deferring the probe of IOMMU masters, xlate and
      add_device callbacks called from of_iommu_configure
      can pass back error values like -ENODEV, which means
      the IOMMU cannot be connected with that master for real
      reasons. Before the IOMMU probe deferral, all such errors
      were ignored. Now all those errors are propagated back,
      killing the master's probe for such errors. Instead ignore
      all the errors except EPROBE_DEFER, which is the only one
      of concern and let the master work without IOMMU, thus
      restoring the old behavior. Also make explicit that
      of_dma_configure handles only -EPROBE_DEFER from
      of_iommu_configure.
      
      Fixes: 7b07cbef ("iommu: of: Handle IOMMU lookup failure with deferred probing or error")
      Reported-by: NGeert Uytterhoeven <geert@linux-m68k.org>
      Tested-by: NMagnus Damn <magnus.damn@gmail.com>
      Signed-off-by: NSricharan R <sricharan@codeaurora.org>
      Signed-off-by: NJoerg Roedel <jroedel@suse.de>
      a37b19a3
  8. 23 5月, 2017 1 次提交
  9. 18 5月, 2017 1 次提交
  10. 17 5月, 2017 4 次提交
  11. 16 5月, 2017 1 次提交
    • T
      of: irq: use of_irq_get() in of_irq_to_resource() · 7a4228bb
      Thomas Petazzoni 提交于
      of_irq_to_resource() currently uses irq_of_parse_and_map() to
      translate a DT interrupt specification into a Linux virtual interrupt
      number. While this works in most cases, irq_of_parse_and_map() doesn't
      properly handle the case where the interrupt controller is not yet
      available (due to deferred probing for example).
      
      So instead, use of_irq_get(), which is implemented exactly like
      irq_of_parse_and_map(), with the exception that if the interrupt
      controller is not yet available, it returns -EPROBE_DEFER. Obviously,
      we also handle this error and bail out from of_irq_to_resource() when
      of_irq_get() returns an error.
      
      This allows to avoid silly error messages at boot time caused by
      irq_create_of_mapping() when the interrupt controller is not
      available:
      
      [    0.153168] irq: no irq domain found for /ap806/config-space@f0000000/interrupt-controller@3f0100 !
      [    0.154041] irq: no irq domain found for /cp110-master/config-space@f2000000/interrupt-controller@1e0000 !
      [    0.154124] irq: no irq domain found for /cp110-master/config-space@f2000000/interrupt-controller@1e0000 !
      [    0.154207] irq: no irq domain found for /cp110-master/config-space@f2000000/interrupt-controller@1e0000 !
      [    0.154437] irq: no irq domain found for /cp110-master/config-space@f2000000/interrupt-controller@1e0000 !
      [    0.154518] irq: no irq domain found for /cp110-master/config-space@f2000000/interrupt-controller@1e0000 !
      Signed-off-by: NThomas Petazzoni <thomas.petazzoni@free-electrons.com>
      Signed-off-by: NRob Herring <robh@kernel.org>
      7a4228bb
  12. 11 5月, 2017 1 次提交
    • R
      Partially Revert "of: fix sparse warnings in fdt, irq, reserved mem, and resolver code" · df3ed932
      Rob Herring 提交于
      A change to function pointers that was meant to address a sparse warning
      turned out to cause hundreds of new gcc-7 warnings:
      
      include/linux/of_irq.h:11:13: error: type qualifiers ignored on function return type [-Werror=ignored-qualifiers]
      drivers/of/of_reserved_mem.c: In function '__reserved_mem_init_node':
      drivers/of/of_reserved_mem.c:200:7: error: type qualifiers ignored on function return type [-Werror=ignored-qualifiers]
         int const (*initfn)(struct reserved_mem *rmem) = i->data;
      
      Turns out the sparse warnings were spurious and have been fixed in
      upstream sparse since 0.5.0 in commit "sparse: treat function pointers
      as pointers to const data".
      
      This partially reverts commit 17a70355.
      
      Fixes: 17a70355 ("of: fix sparse warnings in fdt, irq, reserved mem, and resolver code")
      Reported-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NRob Herring <robh@kernel.org>
      df3ed932
  13. 09 5月, 2017 1 次提交
  14. 05 5月, 2017 4 次提交
    • 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
    • R
      of: fix sparse warning in of_pci_range_parser_one · eb310036
      Rob Herring 提交于
      sparse gives the following warning for 'pci_space':
      
      ../drivers/of/address.c:266:26: warning: incorrect type in assignment (different base types)
      ../drivers/of/address.c:266:26:    expected unsigned int [unsigned] [usertype] pci_space
      ../drivers/of/address.c:266:26:    got restricted __be32 const [usertype] <noident>
      
      It appears that pci_space is only ever accessed on powerpc, so the endian
      swap is often not needed.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NRob Herring <robh@kernel.org>
      eb310036
    • R
      of: fix sparse warnings in of_find_next_cache_node · 91d96749
      Rob Herring 提交于
      sparse gives a warning that 'handle' is not a __be32:
      
      ../drivers/of/base.c:2261:61: warning: incorrect type in argument 1 (different base types)
      ../drivers/of/base.c:2261:61:    expected restricted __be32 const [usertype] *p
      ../drivers/of/base.c:2261:61:    got unsigned int const [usertype] *[assigned] handle
      
      We could just change the type, but the code can be improved by using
      of_parse_phandle instead of open coding it with of_get_property and
      of_find_node_by_phandle.
      Signed-off-by: NRob Herring <robh@kernel.org>
      91d96749
    • D
      of/unittest: Missing unlocks on error · 8756cd1d
      Dan Carpenter 提交于
      Static checkers complain that we should unlock before returning.  Which
      is true.
      Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
      Reviewed-by: NFrank Rowand <frank.rowand@sony.com>
      Signed-off-by: NRob Herring <robh@kernel.org>
      8756cd1d
  15. 03 5月, 2017 1 次提交
  16. 29 4月, 2017 1 次提交
  17. 28 4月, 2017 1 次提交
  18. 25 4月, 2017 1 次提交
    • R
      mdio_bus: Issue GPIO RESET to PHYs. · 69226896
      Roger Quadros 提交于
      Some boards [1] leave the PHYs at an invalid state
      during system power-up or reset thus causing unreliability
      issues with the PHY which manifests as PHY not being detected
      or link not functional. To fix this, these PHYs need to be RESET
      via a GPIO connected to the PHY's RESET pin.
      
      Some boards have a single GPIO controlling the PHY RESET pin of all
      PHYs on the bus whereas some others have separate GPIOs controlling
      individual PHY RESETs.
      
      In both cases, the RESET de-assertion cannot be done in the PHY driver
      as the PHY will not probe till its reset is de-asserted.
      So do the RESET de-assertion in the MDIO bus driver.
      
      [1] - am572x-idk, am571x-idk, a437x-idk
      Signed-off-by: NRoger Quadros <rogerq@ti.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      69226896
  19. 20 4月, 2017 4 次提交
  20. 19 4月, 2017 1 次提交
  21. 03 4月, 2017 1 次提交