1. 24 7月, 2017 4 次提交
  2. 21 7月, 2017 3 次提交
  3. 20 7月, 2017 3 次提交
    • F
      of: overlay: add overlay symbols to live device tree · d1651b03
      Frank Rowand 提交于
      Add overlay __symbols__ properties to live tree when an overlay
      is added to the live tree so that the symbols are available to
      subsequent overlays.
      
      Expected test result is new __symbols__ entries for labels from
      the overlay after this commit.
      
      Before this commit:
      
         Console error message near end of unittest:
            ### dt-test ### FAIL of_unittest_overlay_high_level():2296 Adding overlay 'overlay_bad_symbol' failed
            ### dt-test ### end of unittest - 190 passed, 1 failed
      
         The new unittest "fails" because the expected result of loading the
         new overlay is an error instead of success.
      
         $ # node hvac-medium-2 exists because the overlay loaded
         $ # since the duplicate symbol was not detected
         $ cd /proc/device-tree/testcase-data-2/substation@100/
         $ ls
         compatible     hvac-medium-2  motor-8        reg
         hvac-large-1   linux,phandle  name           status
         hvac-medium-1  motor-1        phandle
      
         $ cd /proc/device-tree/__symbols__/
         $ ls
         electric_1   lights_1     name         rides_1      spin_ctrl_2
         hvac_1       lights_2     retail_1     spin_ctrl_1
      
      After this commit:
      
         Previous console error message no longer occurs, but expected error
         occurs:
            OF: overlay: Failed to apply prop @/__symbols__/hvac_1
            OF: overlay: apply failed '/__symbols__'
            ### dt-test ### end of unittest - 191 passed, 0 failed
      
         $ # node hvac-medium-2 does not exist because the overlay
         $ # properly failed to load due to the duplicate symbol
         $ cd /proc/device-tree/testcase-data-2/substation@100/
         $ ls
         compatible     hvac-medium-1  motor-1        name           reg
         hvac-large-1   linux,phandle  motor-8        phandle        status
      
         $ cd /proc/device-tree/__symbols__/
         $ ls
         electric_1      lights_1        retail_1        ride_200_right  spin_ctrl_2
         hvac_1          lights_2        ride_200        rides_1
         hvac_2          name            ride_200_left   spin_ctrl_1
         $ cat ride_200; echo
         /testcase-data-2/fairway-1/ride@200
         $ cat ride_200_left ; echo
         /testcase-data-2/fairway-1/ride@200/track@10
         $ cat ride_200_right ; echo
         /testcase-data-2/fairway-1/ride@200/track@20
      Signed-off-by: NFrank Rowand <frank.rowand@sony.com>
      Signed-off-by: NRob Herring <robh@kernel.org>
      d1651b03
    • F
      of: overlay: correctly apply overlay node with unit-address · c1cd1e01
      Frank Rowand 提交于
      Correct existing node name detection when overlay node name has
      a unit-address.
      
      Expected test result is overlay will update the nodes and properties
      for /testcase-data-2/fairway-1/ride@100/ after this commit.
      
      Before this commit:
      
         Console error message near end of unittest:
            OF: Duplicate name in fairway-1, renamed to "ride@100#1"
      
         $ cd /proc/device-tree/testcase-data-2/fairway-1/
         $ # extra node: ride@100#1
         $ ls
         #address-cells  linux,phandle   phandle         ride@200
         #size-cells     name            ride@100        status
         compatible      orientation     ride@100#1
         $ cd /proc/device-tree/testcase-data-2/fairway-1/ride@100/
         $ ls track@30/incline-up
         ls: track@30/incline-up: No such file or directory
         $ ls track@40/incline-up
         ls: track@40/incline-up: No such file or directory
      
      After this commit:
      
         Console error message no longer occurs
      
         $ cd /proc/device-tree/testcase-data-2/fairway-1/
         $ # no extra node: ride@100#1
         $ ls
         #address-cells  compatible      name            phandle         ride@200
         #size-cells     linux,phandle   orientation     ride@100        status
         $ cd /proc/device-tree/testcase-data-2/fairway-1/ride@100/
         $ ls track@30/incline-up
         track@30/incline-up
         $ ls track@40/incline-up
         track@40/incline-up
      Signed-off-by: NFrank Rowand <frank.rowand@sony.com>
      Signed-off-by: NRob Herring <robh@kernel.org>
      c1cd1e01
    • F
      of: overlay: add overlay unittest data for node names and symbols · 60a0004c
      Frank Rowand 提交于
      Add nodes and properties to overlay_base and overlay dts files to
      test for
         - incorrect existing node name detection when overlay node name
           has a unit-address
         - adding overlay __symbols__ properties to live tree when an
           overlay is added to the live tree
      
      The following console messages will appear near the end of unittest
      until the code errors are corrected:
      
         OF: Duplicate name in fairway-1, renamed to "ride@100#1"
      
         ### dt-test ### FAIL of_unittest_overlay_high_level():2296 Adding overlay 'overlay_bad_symbol' failed
      
         ### dt-test ### end of unittest - 190 passed, 1 failed
      Signed-off-by: NFrank Rowand <frank.rowand@sony.com>
      Signed-off-by: NRob Herring <robh@kernel.org>
      60a0004c
  4. 19 7月, 2017 1 次提交
  5. 03 7月, 2017 1 次提交
  6. 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
  7. 23 6月, 2017 8 次提交
  8. 22 6月, 2017 3 次提交
  9. 14 6月, 2017 2 次提交
  10. 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
  11. 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
  12. 23 5月, 2017 1 次提交
  13. 18 5月, 2017 1 次提交
  14. 17 5月, 2017 4 次提交
  15. 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
  16. 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
  17. 09 5月, 2017 1 次提交
  18. 05 5月, 2017 3 次提交
    • 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