1. 08 Dec, 2017 2 commits
  2. 06 Dec, 2017 5 commits
  3. 20 Nov, 2017 1 commit
  4. 16 Nov, 2017 3 commits
  5. 08 Nov, 2017 2 commits
  6. 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
         lines).
      
      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: 's avatarKate Stewart <kstewart@linuxfoundation.org>
      Reviewed-by: 's avatarPhilippe Ombredanne <pombredanne@nexb.com>
      Reviewed-by: 's avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: 's avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b2441318
  7. 23 Oct, 2017 1 commit
  8. 22 Oct, 2017 4 commits
    • Bjorn Andersson's avatar
      soc: qcom: Remote filesystem memory driver · d1de6d6c
      Bjorn Andersson authored
      The Qualcomm remote file system protocol is used by certain remoteprocs,
      in particular the modem, to read and write persistent storage in
      platforms where only the application CPU has physical storage access.
      
      The protocol is based on a set of QMI-encoded control-messages and a
      shared memory buffer for exchaning the data. This driver implements the
      latter, providing the user space service access to the carved out chunk
      of memory.
      Acked-by: 's avatarRob Herring <robh@kernel.org>
      Signed-off-by: 's avatarBjorn Andersson <bjorn.andersson@linaro.org>
      Signed-off-by: 's avatarAndy Gross <andy.gross@linaro.org>
      d1de6d6c
    • Bjorn Andersson's avatar
      of: reserved_mem: Accessor for acquiring reserved_mem · eb297bc7
      Bjorn Andersson authored
      In some cases drivers referencing a reserved-memory region might want to
      remap the entire region, but when defining the reserved-memory by "size"
      the client driver has no means to know the associated base address of
      the reserved memory region.
      
      This patch adds an accessor for such drivers to acquire a handle to
      their associated reserved-memory for this purpose.
      
      A complicating factor for the implementation is that the reserved_mem
      objects are created from the flattened DeviceTree, as such we can't
      use the device_node address for comparison. Fortunately the name of the
      node will be used as "name" of the reserved_mem and will be used when
      building the full_name, so we can compare the "name" with the basename
      of the full_name to find the match.
      Reviewed-by: 's avatarRob Herring <robh@kernel.org>
      Signed-off-by: 's avatarBjorn Andersson <bjorn.andersson@linaro.org>
      Signed-off-by: 's avatarAndy Gross <andy.gross@linaro.org>
      eb297bc7
    • Bjorn Andersson's avatar
      of/platform: Generalize /reserved-memory handling · a50ff19d
      Bjorn Andersson authored
      By iterating over all /reserved-memory child nodes and match each one to
      a list of compatibles that we want to treat specially, we can easily
      extend the list of compatibles to handle - without having to resort to
      of_platform_populate() that would create unnecessary platform_devices.
      Reviewed-by: 's avatarRob Herring <robh@kernel.org>
      Signed-off-by: 's avatarBjorn Andersson <bjorn.andersson@linaro.org>
      Signed-off-by: 's avatarAndy Gross <andy.gross@linaro.org>
      a50ff19d
    • Geert Uytterhoeven's avatar
      of_mdio: Fix broken PHY IRQ in case of probe deferral · 66bdede4
      Geert Uytterhoeven authored
      If an Ethernet PHY is initialized before the interrupt controller it is
      connected to, a message like the following is printed:
      
          irq: no irq domain found for /interrupt-controller@e61c0000 !
      
      However, the actual error is ignored, leading to a non-functional (POLL)
      PHY interrupt later:
      
          Micrel KSZ8041RNLI ee700000.ethernet-ffffffff:01: attached PHY driver [Micrel KSZ8041RNLI] (mii_bus:phy_addr=ee700000.ethernet-ffffffff:01, irq=POLL)
      
      Depending on whether the PHY driver will fall back to polling, Ethernet
      may or may not work.
      
      To fix this:
        1. Switch of_mdiobus_register_phy() from irq_of_parse_and_map() to
           of_irq_get().
           Unlike the former, the latter returns -EPROBE_DEFER if the
           interrupt controller is not yet available, so this condition can be
           detected.
           Other errors are handled the same as before, i.e. use the passed
           mdio->irq[addr] as interrupt.
        2. Propagate and handle errors from of_mdiobus_register_phy() and
           of_mdiobus_register_device().
      Signed-off-by: 's avatarGeert Uytterhoeven <geert+renesas@glider.be>
      Signed-off-by: 's avatarDavid S. Miller <davem@davemloft.net>
      66bdede4
  9. 19 Oct, 2017 3 commits
  10. 18 Oct, 2017 12 commits
    • Frank Rowand's avatar
      of: overlay: remove unneeded check for NULL kbasename() · 34ca5d76
      Frank Rowand authored
      kbasename() will not return NULL if passed a valid string.  If
      the parameter passed to kbasename() in this case is already NULL
      then the devicetree has been corrupted.
      Signed-off-by: 's avatarFrank Rowand <frank.rowand@sony.com>
      Signed-off-by: 's avatarRob Herring <robh@kernel.org>
      34ca5d76
    • Frank Rowand's avatar
      of: overlay: remove a dependency on device node full_name · e0a58f3e
      Frank Rowand authored
      The "%pOF" printf format was recently added to print the
      full name of a device tree node, with the intent of changing
      the node full_name field to contain only the node name instead
      of the full path of the node.
      
      dup_and_fixup_symbol_prop() duplicates a property from the
      "/__symbols__" node of an overlay device tree.  The value
      of each duplicated property must be fixed up to include
      the full path of a node in the live device tree.  The
      current code uses the node's full_name for that purpose.
      Update the code to use the "%pOF" printf format to
      determine the node's full path.
      Signed-off-by: 's avatarFrank Rowand <frank.rowand@sony.com>
      Signed-off-by: 's avatarRob Herring <robh@kernel.org>
      e0a58f3e
    • Frank Rowand's avatar
      of: overlay: simplify applying symbols from an overlay · 3912b791
      Frank Rowand authored
      The code to apply symbols from an overlay to the live device tree
      was implemented with the intent to be minimally intrusive on the
      existing code.  After recent restructuring of the overlay apply
      code, it is easier to disintangle the code that applies the
      symbols, and to make the overlay changeset creation code more
      straight forward and understandable.
      
      Remove the extra complexity, and make the code more obvious.
      Signed-off-by: 's avatarFrank Rowand <frank.rowand@sony.com>
      Signed-off-by: 's avatarRob Herring <robh@kernel.org>
      3912b791
    • 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
      simultaneously.
      
      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: 's avatarFrank Rowand <frank.rowand@sony.com>
      Signed-off-by: 's avatarRob Herring <robh@kernel.org>
      f948d6d8
    • Frank Rowand's avatar
      of: overlay: loosen overly strict phandle clash check · 6d0f5470
      Frank Rowand authored
      When an overlay contains a node that already exists in
      the live device tree, the overlay node is not allowed
      to change the phandle of the existing node.
      
      The existing check refused to allow an overlay node to
      set the node phandle even when the existing node did
      not have a phandle.  Relax the check to allow an
      overlay node to set the phandle value if the existing
      node does not have a phandle.
      Signed-off-by: 's avatarFrank Rowand <frank.rowand@sony.com>
      Signed-off-by: 's avatarRob Herring <robh@kernel.org>
      6d0f5470
    • Frank Rowand's avatar
      of: overlay: expand check of whether overlay changeset can be removed · 87f242c1
      Frank Rowand authored
      The test of whether it is safe to remove an overlay changeset
      looked at whether any node in the overlay changeset was in a
      subtree rooted at any more recently applied overlay changeset
      node.
      
      The test failed to determine whether any node in the overlay
      changeset was the root of a subtree that contained a more
      recently applied overlay changeset node.  Add this additional
      check to the test.
      
      The test is still lacking any check for any phandle dependencies.
      Signed-off-by: 's avatarFrank Rowand <frank.rowand@sony.com>
      Signed-off-by: 's avatarRob Herring <robh@kernel.org>
      87f242c1
    • 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: 's avatarFrank Rowand <frank.rowand@sony.com>
      Signed-off-by: 's avatarRob Herring <robh@kernel.org>
      24789c5c
    • Frank Rowand's avatar
      of: overlay: minor restructuring · 61b4de4e
      Frank Rowand authored
      Continue improving the readability of overlay.c.  The previous patches
      renamed identifiers.  This patch is split out from the previous patches
      to make the previous patches easier to review.
      
      Changes are:
        - minor code restructuring
        - some initialization of an overlay changeset occurred outside of
          init_overlay_changeset(), move that into init_overlay_changeset()
        - consolidate freeing an overlay changeset into free_overlay_changeset()
      
      This patch is intended to not introduce any functional change.
      Signed-off-by: 's avatarFrank Rowand <frank.rowand@sony.com>
      Signed-off-by: 's avatarRob Herring <robh@kernel.org>
      61b4de4e
    • Frank Rowand's avatar
      of: overlay: rename identifiers in dup_and_fixup_symbol_prop() · 42b2e94f
      Frank Rowand authored
      More renaming of identifiers to better reflect what they do.
      Signed-off-by: 's avatarFrank Rowand <frank.rowand@sony.com>
      Signed-off-by: 's avatarRob Herring <robh@kernel.org>
      42b2e94f
    • 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: 's avatarFrank Rowand <frank.rowand@sony.com>
      Signed-off-by: 's avatarRob Herring <robh@kernel.org>
      0290c4ca
    • Frank Rowand's avatar
      of: overlay.c: Convert comparisons to zero or NULL to logical expressions · bbed8794
      Frank Rowand authored
      Use normal shorthand for comparing a variable to zero.
      For variable "XXX":
         convert (XXX == 0) to (!XXX)
         convert (XXX != 0) to (XXX)
      Signed-off-by: 's avatarFrank Rowand <frank.rowand@sony.com>
      Signed-off-by: 's avatarRob Herring <robh@kernel.org>
      bbed8794
    • Frank Rowand's avatar
      of: overlay.c: Remove comments that state the obvious, to reduce clutter · 646afc4a
      Frank Rowand authored
      Follows recommendations in Documentation/process/coding-style.rst,
      section 8, Commenting.
      
      Some in function comments are promoted to function header comments.
      Signed-off-by: 's avatarFrank Rowand <frank.rowand@sony.com>
      Signed-off-by: 's avatarRob Herring <robh@kernel.org>
      646afc4a
  11. 17 Oct, 2017 1 commit
  12. 16 Oct, 2017 5 commits