1. 13 12月, 2017 4 次提交
  2. 02 11月, 2017 1 次提交
    • G
      License cleanup: add SPDX GPL-2.0 license identifier to files with no license · b2441318
      Greg Kroah-Hartman 提交于
      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: NKate Stewart <kstewart@linuxfoundation.org>
      Reviewed-by: NPhilippe Ombredanne <pombredanne@nexb.com>
      Reviewed-by: NThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b2441318
  3. 19 10月, 2017 1 次提交
  4. 23 8月, 2017 2 次提交
  5. 17 8月, 2017 1 次提交
    • T
      soc/tegra: Register SoC device · 27a0342a
      Thierry Reding 提交于
      Move this code from arch/arm/mach-tegra and make it common among 32-bit
      and 64-bit Tegra SoCs. This is slightly complicated by the fact that on
      32-bit Tegra, the SoC device is used as the parent for all devices that
      are instantiated from device tree.
      Signed-off-by: NThierry Reding <treding@nvidia.com>
      27a0342a
  6. 31 7月, 2017 1 次提交
    • T
      soc/tegra: Fix bad of_node_put() in powergate init · 0c106e57
      Tuomas Tynkkynen 提交于
      The for_each_child_of_node macro itself maintains the correct reference
      count of the nodes so the explicit of_node_put() call causes a warning:
      
      [    0.098960] OF: ERROR: Bad of_node_put() on /pmc@7000e400/powergates/xusba
      [    0.098981] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.11.3 #1-NixOS
      [    0.098996] Hardware name: NVIDIA Jetson TX1 Developer Kit (DT)
      [    0.099011] Call trace:
      [    0.099034] [<ffff00000808a048>] dump_backtrace+0x0/0x2a0
      [    0.099051] [<ffff00000808a30c>] show_stack+0x24/0x30
      [    0.099069] [<ffff0000084a6494>] dump_stack+0x9c/0xc0
      [    0.099090] [<ffff000008992214>] of_node_release+0xa4/0xa8
      [    0.099107] [<ffff0000084a9270>] kobject_put+0x90/0x1f8
      [    0.099124] [<ffff0000089914ac>] of_node_put+0x24/0x30
      [    0.099140] [<ffff00000898cec4>] __of_get_next_child+0x4c/0x70
      [    0.099155] [<ffff00000898cf28>] of_get_next_child+0x40/0x68
      [    0.099173] [<ffff0000090a099c>] tegra_pmc_early_init+0x4e8/0x5ac
      [    0.099189] [<ffff00000808399c>] do_one_initcall+0x5c/0x168
      [    0.099206] [<ffff000009050c98>] kernel_init_freeable+0xd4/0x240
      [    0.099224] [<ffff000008b2d658>] kernel_init+0x18/0x108
      [    0.099238] [<ffff0000080836c0>] ret_from_fork+0x10/0x50
      
      (It's not very apparent from the OF documentation that of_node_put() is
      not needed; the macro itself has no docstring and of_get_next_child()
      used in the implementation begins with "Returns a node pointer with
      refcount incremented" but then only at the very end of the docstring
      the crucial part "Decrements the refcount of prev" is mentioned.)
      
      Fixes: a3804512 ("soc/tegra: pmc: Add generic PM domain support")
      Signed-off-by: NTuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
      Signed-off-by: NThierry Reding <treding@nvidia.com>
      0c106e57
  7. 13 6月, 2017 2 次提交
  8. 04 4月, 2017 5 次提交
  9. 15 11月, 2016 11 次提交
  10. 16 8月, 2016 1 次提交
  11. 30 6月, 2016 11 次提交
    • J
      soc/tegra: pmc: Enable XUSB partitions on boot · 8df12745
      Jon Hunter 提交于
      The Tegra XHCI driver does not currently manage the Tegra XUSB power
      partitions and so it these partitions have not been enabled by the
      bootloader then the system will crash when probing the XHCI device.
      
      While proper support for managing the power partitions is being
      developed to the XHCI driver for Tegra, for now power on all the XUSB
      partitions for USB host and super-speed on boot if the XHCI driver is
      enabled.
      Signed-off-by: NJon Hunter <jonathanh@nvidia.com>
      Signed-off-by: NThierry Reding <treding@nvidia.com>
      8df12745
    • J
      soc/tegra: pmc: Initialise power partitions early · e2d17960
      Jon Hunter 提交于
      If CONFIG_PM_GENERIC_DOMAINS is not enabled, then power partitions
      associated with a device will not be enabled automatically by the PM
      core when the device is in use. To avoid situations where a device in
      a power partition is to be used but the partition is not enabled,
      initialise the power partitions for Tegra early in the boot process and
      if CONFIG_PM_GENERIC_DOMAINS is not enabled, then power on all
      partitions defined in the device-tree blob.
      
      Note that if CONFIG_PM_GENERIC_DOMAINS is not enabled, after the
      partitions are turned on, the clocks and resets used as part of the
      sequence for turning on the partition are released again as they are no
      longer needed by the PMC driver. Another benefit of this is that this
      avoids any issues of sharing resets between the PMC driver and other
      device drivers that may wish to independently control a particular
      reset.
      Signed-off-by: NJon Hunter <jonathanh@nvidia.com>
      Signed-off-by: NThierry Reding <treding@nvidia.com>
      e2d17960
    • J
      soc/tegra: pmc: Add specific error messages · c2710ac9
      Jon Hunter 提交于
      When initialising a powergate, only a single error message is shown if
      the initialisation fails. Add more error messages to give specific
      details of what failed if the initialisation failed and remove the
      generic failure message.
      Signed-off-by: NJon Hunter <jonathanh@nvidia.com>
      Signed-off-by: NThierry Reding <treding@nvidia.com>
      c2710ac9
    • T
      soc/tegra: pmc: Use whitespace more consistently · da8f4b45
      Thierry Reding 提交于
      Use blank lines after blocks and before labels for consistency with the
      existing code in the file.
      Signed-off-by: NThierry Reding <treding@nvidia.com>
      da8f4b45
    • J
      soc/tegra: pmc: Don't probe PMC if early initialisation fails · a83f1fc3
      Jon Hunter 提交于
      Commit 0259f522 ('soc/tegra: pmc: Restore base address on probe
      failure') fixes an issue where the PMC base address pointer is not
      restored on probe failure. However, this fix creates another problem
      where if early initialisation of the PMC driver fails and an initial
      mapping for the PMC address space is not created, then when the PMC
      device is probed, the PMC base address pointer will not be valid and
      this will cause a crash when tegra_pmc_init() is called and attempts
      to access a register.
      
      Although the PMC address space is mapped a 2nd time during the probe
      and so this could be fixed by populating the base address pointer
      earlier during the probe, this adds more complexity to the code.
      Moreover, the PMC probe also assumes the the soc data pointer is also
      initialised when the device is probed and if not will also lead to a
      crash when calling tegra_pmc_init_tsense_reset(). Given that if the
      early initialisation does fail then something bad has happen, it seems
      acceptable to allow the PMC device probe to fail as well. Therefore, if
      the PMC base address pointer or soc data pointer are not valid when
      probing the PMC device, WARN and return an error.
      
      Fixes: 0259f522 ('soc/tegra: pmc: Restore base address on probe failure')
      Signed-off-by: NJon Hunter <jonathanh@nvidia.com>
      Signed-off-by: NThierry Reding <treding@nvidia.com>
      a83f1fc3
    • J
      soc/tegra: pmc: Add missing of_node_put() · b69a6258
      Jon Hunter 提交于
      Add missing of_node_put() in PMC early initialisation function to avoid
      leaking the device nodes.
      Signed-off-by: NJon Hunter <jonathanh@nvidia.com>
      [treding@nvidia.com: squash in a couple more of_node_put() calls]
      Signed-off-by: NThierry Reding <treding@nvidia.com>
      b69a6258
    • J
      soc/tegra: pmc: Ensure mutex is always initialised · 61fd284b
      Jon Hunter 提交于
      The mutex used by the PMC driver may not be initialised if early
      initialisation of the driver fails. If this does happen, then it could
      be possible for callers of the public PMC functions to still attempt to
      acquire the mutex. Fix this by initialising the mutex as soon as
      possible to ensure it will always be initialised.
      Signed-off-by: NJon Hunter <jonathanh@nvidia.com>
      Signed-off-by: NThierry Reding <treding@nvidia.com>
      61fd284b
    • J
      soc/tegra: pmc: Don't populate SoC data until register space is mapped · 718a2426
      Jon Hunter 提交于
      The public functions exported by the PMC driver use the presence of the
      SoC data pointer to determine if the PMC device is configured and the
      registers can be accessed. However, the SoC data is populated before the
      PMC register space is mapped and this opens a window where the SoC data
      pointer is valid but the register space has not yet been mapped which
      could lead to a crash. Furthermore, if the mapping of the PMC register
      space fails, then the SoC data pointer is not cleared and so would
      expose a larger window where a crash could occur.
      
      Fix this by initialising the SoC data pointer after the PMC register
      space has been mapped.
      Signed-off-by: NJon Hunter <jonathanh@nvidia.com>
      Signed-off-by: NThierry Reding <treding@nvidia.com>
      718a2426
    • J
      soc/tegra: pmc: Fix early initialisation of PMC · 11131895
      Jon Hunter 提交于
      During early initialisation, the available power partitions for a given
      device is configured as well as the polarity of the PMC interrupt. Both
      of which should only be configured if there is a valid device node for
      the PMC device. This is because the soc data used for configuring the
      power partitions is only available if a device node for the PMC is found
      and the code to configure the interrupt polarity uses the device node
      pointer directly.
      
      Some early device-tree images may not have this device node and so fix
      this by ensuring the device node pointer is valid when configuring these
      items.
      Signed-off-by: NJon Hunter <jonathanh@nvidia.com>
      Signed-off-by: NThierry Reding <treding@nvidia.com>
      11131895
    • J
      soc/tegra: pmc: Ensure powergate is available when powering on · 403db2d2
      Jon Hunter 提交于
      The function tegra_power_sequence_power_up() is a public function used
      to power on a partition. When this function is called, we do not check
      to see if the partition being powered up is valid/available. Fix this
      by checking to see that the partition is valid/available.
      Signed-off-by: NJon Hunter <jonathanh@nvidia.com>
      Signed-off-by: NThierry Reding <treding@nvidia.com>
      403db2d2
    • J
      soc/tegra: pmc: Initialise resets associated with a power partition · 05cfb988
      Jon Hunter 提交于
      When registering the Tegra power partitions with the generic PM domain
      framework, the current state of the each partition is checked and used
      as the default state for the partition. However, the state of each reset
      associated with the partition is not initialised and so it is possible
      that the state of the resets are not in the expected state. For example,
      if a partition is on, then the resets should be de-asserted and if the
      partition is off, the resets should be asserted.
      
      There have been cases where the bootloader has powered on a partition
      and only de-asserted some of the resets to some of the devices in the
      partition. This can cause accesses to these devices to hang the system
      when the kernel boots and attempts to probe these devices.
      
      Ideally, the driver for the device should ensure the reset has been
      de-asserted when probing, but the resets cannot be shared between the
      PMC driver (that needs to de-assert/assert the reset when turning the
      partition on or off) and another driver because we cannot ensure the
      reset is in the correct state.
      
      To ensure the resets are in the correct state, when using the generic
      PM domain framework, put each reset associated with the partition in
      the correct state (based upon the partition's current state) when
      obtaining the resets for a partition.
      Signed-off-by: NJon Hunter <jonathanh@nvidia.com>
      Signed-off-by: NThierry Reding <treding@nvidia.com>
      05cfb988