1. 06 Dec, 2017 1 commit
  2. 02 Nov, 2017 1 commit
    • Greg Kroah-Hartman's avatar
      License cleanup: add SPDX GPL-2.0 license identifier to files with no license · b2441318
      Greg Kroah-Hartman authored
      Many source files in the tree are missing licensing information, which
      makes it harder for compliance tools to determine the correct license.
      By default all files without license information are under the default
      license of the kernel, which is GPL version 2.
      Update the files which contain no license information with the 'GPL-2.0'
      SPDX license identifier.  The SPDX identifier is a legally binding
      shorthand, which can be used instead of the full boiler plate text.
      This patch is based on work done by Thomas Gleixner and Kate Stewart and
      Philippe Ombredanne.
      How this work was done:
      Patches were generated and checked against linux-4.14-rc6 for a subset of
      the use cases:
       - file had no licensing information it it.
       - file was a */uapi/* one with no licensing information in it,
       - file was a */uapi/* one with existing licensing information,
      Further patches will be generated in subsequent months to fix up cases
      where non-standard license headers were used, and references to license
      had to be inferred by heuristics based on keywords.
      The analysis to determine which SPDX License Identifier to be applied to
      a file was done in a spreadsheet of side by side results from of the
      output of two independent scanners (ScanCode & Windriver) producing SPDX
      tag:value files created by Philippe Ombredanne.  Philippe prepared the
      base worksheet, and did an initial spot review of a few 1000 files.
      The 4.13 kernel was the starting point of the analysis with 60,537 files
      assessed.  Kate Stewart did a file by file comparison of the scanner
      results in the spreadsheet to determine which SPDX license identifier(s)
      to be applied to the file. She confirmed any determination that was not
      immediately clear with lawyers working with the Linux Foundation.
      Criteria used to select files for SPDX license identifier tagging was:
       - Files considered eligible had to be source code files.
       - Make and config files were included as candidates if they contained >5
         lines of source
       - File already had some variant of a license header in it (even if <5
      All documentation files were explicitly excluded.
      The following heuristics were used to determine which SPDX license
      identifiers to apply.
       - when both scanners couldn't find any license traces, file was
         considered to have no license information in it, and the top level
         COPYING file license applied.
         For non */uapi/* files that summary was:
         SPDX license identifier                            # files
         GPL-2.0                                              11139
         and resulted in the first patch in this series.
         If that file was a */uapi/* path one, it was "GPL-2.0 WITH
         Linux-syscall-note" otherwise it was "GPL-2.0".  Results of that was:
         SPDX license identifier                            # files
         GPL-2.0 WITH Linux-syscall-note                        930
         and resulted in the second patch in this series.
       - if a file had some form of licensing information in it, and was one
         of the */uapi/* ones, it was denoted with the Linux-syscall-note if
         any GPL family license was found in the file or had no licensing in
         it (per prior point).  Results summary:
         SPDX license identifier                            # files
         GPL-2.0 WITH Linux-syscall-note                       270
         GPL-2.0+ WITH Linux-syscall-note                      169
         ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause)    21
         ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)    17
         LGPL-2.1+ WITH Linux-syscall-note                      15
         GPL-1.0+ WITH Linux-syscall-note                       14
         ((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause)    5
         LGPL-2.0+ WITH Linux-syscall-note                       4
         LGPL-2.1 WITH Linux-syscall-note                        3
         ((GPL-2.0 WITH Linux-syscall-note) OR MIT)              3
         ((GPL-2.0 WITH Linux-syscall-note) AND MIT)             1
         and that resulted in the third patch in this series.
       - when the two scanners agreed on the detected license(s), that became
         the concluded license(s).
       - when there was disagreement between the two scanners (one detected a
         license but the other didn't, or they both detected different
         licenses) a manual inspection of the file occurred.
       - In most cases a manual inspection of the information in the file
         resulted in a clear resolution of the license that should apply (and
         which scanner probably needed to revisit its heuristics).
       - When it was not immediately clear, the license identifier was
         confirmed with lawyers working with the Linux Foundation.
       - If there was any question as to the appropriate license identifier,
         the file was flagged for further research and to be revisited later
         in time.
      In total, over 70 hours of logged manual review was done on the
      spreadsheet to determine the SPDX license identifiers to apply to the
      source files by Kate, Philippe, Thomas and, in some cases, confirmation
      by lawyers working with the Linux Foundation.
      Kate also obtained a third independent scan of the 4.13 code base from
      FOSSology, and compared selected files where the other two scanners
      disagreed against that SPDX file, to see if there was new insights.  The
      Windriver scanner is based on an older version of FOSSology in part, so
      they are related.
      Thomas did random spot checks in about 500 files from the spreadsheets
      for the uapi headers and agreed with SPDX license identifier in the
      files he inspected. For the non-uapi files Thomas did random spot checks
      in about 15000 files.
      In initial set of patches against 4.14-rc6, 3 files were found to have
      copy/paste license identifier errors, and have been fixed to reflect the
      correct identifier.
      Additionally Philippe spent 10 hours this week doing a detailed manual
      inspection and review of the 12,461 patched files from the initial patch
      version early this week with:
       - a full scancode scan run, collecting the matched texts, detected
         license ids and scores
       - reviewing anything where there was a license detected (about 500+
         files) to ensure that the applied SPDX license was correct
       - reviewing anything where there was no detection but the patch license
         was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied
         SPDX license was correct
      This produced a worksheet with 20 files needing minor correction.  This
      worksheet was then exported into 3 different .csv files for the
      different types of files to be modified.
      These .csv files were then reviewed by Greg.  Thomas wrote a script to
      parse the csv files and add the proper SPDX tag to the file, in the
      format that the file expected.  This script was further refined by Greg
      based on the output to detect more types of files automatically and to
      distinguish between header and source .c files (which need different
      comment types.)  Finally Greg ran the script using the .csv files to
      generate the patches.
      Reviewed-by: default avatarKate Stewart <kstewart@linuxfoundation.org>
      Reviewed-by: default avatarPhilippe Ombredanne <pombredanne@nexb.com>
      Reviewed-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
  3. 18 Oct, 2017 3 commits
    • Frank Rowand's avatar
      of: overlay: avoid race condition between applying multiple overlays · f948d6d8
      Frank Rowand authored
      The process of applying an overlay consists of:
        - unflatten an overlay FDT (flattened device tree) into an
          EDT (expanded device tree)
        - fixup the phandle values in the overlay EDT to fit in a
          range above the phandle values in the live device tree
        - create the overlay changeset to reflect the contents of
          the overlay EDT
        - apply the overlay changeset, to modify the live device tree,
          potentially changing the maximum phandle value in the live
          device tree
      There is currently no protection against two overlay applies
      concurrently determining what range of phandle values are in use
      in the live device tree, and subsequently changing that range.
      Add a mutex to prevent multiple overlay applies from occurring
      Move of_resolve_phandles() into of_overlay_apply() so that it does not
      have to be duplicated by each caller of of_overlay_apply().
      The test in of_resolve_phandles() that the overlay tree is detached is
      temporarily disabled so that old style overlay unittests do not fail.
      Signed-off-by: default avatarFrank Rowand <frank.rowand@sony.com>
      Signed-off-by: default avatarRob Herring <robh@kernel.org>
    • Frank Rowand's avatar
      of: overlay: detect cases where device tree may become corrupt · 24789c5c
      Frank Rowand authored
      When an attempt to apply an overlay changeset fails, an effort
      is made to revert any partial application of the changeset.
      When an attempt to remove an overlay changeset fails, an effort
      is made to re-apply any partial reversion of the changeset.
      The existing code does not check for failure to recover a failed
      overlay changeset application or overlay changeset revert.
      Add the missing checks and flag the devicetree as corrupt if the
      state of the devicetree can not be determined.
      Improve and expand the returned errors to more fully reflect the
      result of the effort to undo the partial effects of a failed attempt
      to apply or remove an overlay changeset.
      If the device tree might be corrupt, do not allow further attempts
      to apply or remove an overlay changeset.
      When creating an overlay changeset from an overlay device tree,
      add some additional warnings if the state of the overlay device
      tree is not as expected.
      Signed-off-by: default avatarFrank Rowand <frank.rowand@sony.com>
      Signed-off-by: default avatarRob Herring <robh@kernel.org>
    • Frank Rowand's avatar
      of: overlay: rename identifiers to more reflect what they do · 0290c4ca
      Frank Rowand authored
      This patch is aimed primarily at drivers/of/overlay.c, but those
      changes also have a small impact in a few other files.
      overlay.c is difficult to read and maintain.  Improve readability:
        - Rename functions, types and variables to better reflect what
          they do and to be consistent with names in other places,
          such as the device tree overlay FDT (flattened device tree),
          and make the algorithms more clear
        - Use the same names consistently throughout the file
        - Update comments for name changes
        - Fix incorrect comments
      This patch is intended to not introduce any functional change.
      Signed-off-by: default avatarFrank Rowand <frank.rowand@sony.com>
      Signed-off-by: default avatarRob Herring <robh@kernel.org>
  4. 16 Oct, 2017 1 commit
  5. 20 Jul, 2017 1 commit
    • Frank Rowand's avatar
      of: overlay: add overlay unittest data for node names and symbols · 60a0004c
      Frank Rowand authored
      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: default avatarFrank Rowand <frank.rowand@sony.com>
      Signed-off-by: default avatarRob Herring <robh@kernel.org>
  6. 18 Jul, 2017 1 commit
  7. 27 Jun, 2017 1 commit
    • Pantelis Antoniou's avatar
      vsprintf: Add %p extension "%pOF" for device tree · ce4fecf1
      Pantelis Antoniou authored
      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
      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: default avatarPantelis Antoniou <pantelis.antoniou@konsulko.com>
      Acked-by: default avatarJoe Perches <joe@perches.com>
      Signed-off-by: default avatarRob Herring <robh@kernel.org>
  8. 04 May, 2017 1 commit
  9. 03 May, 2017 1 commit
  10. 27 Apr, 2017 1 commit
  11. 23 Jan, 2017 1 commit
  12. 04 Jan, 2017 1 commit
  13. 23 Jun, 2016 1 commit
  14. 19 May, 2016 1 commit
  15. 16 May, 2016 1 commit
  16. 22 Apr, 2016 1 commit
  17. 03 Mar, 2016 1 commit
    • Sergey Senozhatsky's avatar
      of/unittest: fix infinite loop in of_unittest_destroy_tracked_overlays() · 815d74b3
      Sergey Senozhatsky authored
      of_overlay_destroy() can return `-ENODEV' error code once it
      failed to find the requested overlay in `ov_idr'. However,
      of_unittest_destroy_tracked_overlays() does not handle this
      error code correctly and continues to call of_overlay_destroy()
      on the 'missing' overlay over and over again. This results in
      a printk flood
      [   33.497583] of_overlay_destroy: Could not find overlay #6
      [   33.497583] of_overlay_destroy: Could not find overlay #6
      [   33.497584] ### dt-test ### of_unittest_destroy_tracked_overlays: overlay destroy failed for #6
      [   33.497584] ### dt-test ### of_unittest_destroy_tracked_overlays: overlay destroy failed for #6
      [   33.497586] of_overlay_destroy: Could not find overlay #6
      [   33.497586] of_overlay_destroy: Could not find overlay #6
      [   33.497587] ### dt-test ### of_unittest_destroy_tracked_overlays: overlay destroy failed for #6
      [   33.497587] ### dt-test ### of_unittest_destroy_tracked_overlays: overlay destroy failed for #6
      which is not really good due to printk design, and can lead to soft
      lockups, hard lockups, etc. (depending on the context console_unlock()
      is being called from). The problem has bee observed in real life
      and reported by Ying Huang.
      This patch does not address the root cause of missing overlay in
      `ov_idr', it fixes the endless loop only.
      Signed-off-by: default avatarSergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Reported-by: default avatarkernel test robot <ying.huang@linux.intel.com>
      Link: lkml.kernel.org/r/87fuwk1c0o.fsf@yhuang-dev.intel.com
      Signed-off-by: default avatarRob Herring <robh@kernel.org>
  18. 13 Jan, 2016 1 commit
  19. 05 Jan, 2016 1 commit
    • Grant Likely's avatar
      of/unittest: Show broken behaviour in the platform bus · d2329fb5
      Grant Likely authored
      Add a single resource to the test bus device to exercise the platform
      bus code a little more. This isn't strictly a devicetree test, but it is
      a corner case that the devicetree runs into. Until we've got platform
      device unittests, it can live here. It doesn't need to be an explicit
      text because the kernel will oops when it is wrong.
      Cc: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
      Cc: Rob Herring <robh@kernel.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
      Signed-off-by: default avatarGrant Likely <grant.likely@linaro.org>
      [wsa: added the comment provided by Grant, rebased, and tested]
      Signed-off-by: default avatarWolfram Sang <wsa+renesas@sang-engineering.com>
      Signed-off-by: default avatarRob Herring <robh@kernel.org>
  20. 22 Oct, 2015 1 commit
    • Julia Lawall's avatar
      of/unittest: add missing of_node_put · 855ff287
      Julia Lawall authored
      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: default avatarJulia Lawall <Julia.Lawall@lip6.fr>
      Signed-off-by: default avatarRob Herring <robh@kernel.org>
  21. 27 Jul, 2015 1 commit
  22. 15 Apr, 2015 1 commit
  23. 29 Mar, 2015 6 commits
  24. 25 Mar, 2015 1 commit
  25. 19 Mar, 2015 1 commit
  26. 10 Mar, 2015 4 commits
  27. 04 Feb, 2015 1 commit
  28. 23 Jan, 2015 1 commit
  29. 22 Jan, 2015 1 commit
  30. 13 Jan, 2015 1 commit