1. 19 1月, 2018 1 次提交
  2. 17 1月, 2018 1 次提交
    • M
      PCI: Remove unnecessary messages for memory allocation failures · c7abb235
      Markus Elfring 提交于
      Per ebfdc409 ("checkpatch: attempt to find unnecessary 'out of memory'
      messages"), when a memory allocation fails, the memory subsystem emits
      generic "out of memory" messages (see slab_out_of_memory() for some of this
      logging).  Therefore, additional error messages in the caller don't add
      much value.
      
      Remove messages that merely report "out of memory".
      
      This preserves some messages that report additional information, e.g.,
      allocation failures that mean we drop hotplug events.
      
      This issue was detected by using the Coccinelle software.
      Signed-off-by: NMarkus Elfring <elfring@users.sourceforge.net>
      [bhelgaas: changelog, squash patches, make similar changes to acpiphp,
      cpqphp, ibmphp, keep warning when dropping hotplug event]
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      c7abb235
  3. 19 12月, 2017 1 次提交
  4. 13 12月, 2017 1 次提交
  5. 11 12月, 2017 1 次提交
    • R
      PM / sleep: Avoid excess pm_runtime_enable() calls in device_resume() · 3487972d
      Rafael J. Wysocki 提交于
      Middle-layer code doing suspend-time optimizations for devices with
      the DPM_FLAG_SMART_SUSPEND flag set (currently, the PCI bus type and
      the ACPI PM domain) needs to make the core skip ->thaw_early and
      ->thaw callbacks for those devices in some cases and it sets the
      power.direct_complete flag for them for this purpose.
      
      However, it turns out that setting power.direct_complete outside of
      the PM core is a bad idea as it triggers an excess invocation of
      pm_runtime_enable() in device_resume().
      
      For this reason, provide a helper to clear power.is_late_suspended
      and power.is_suspended to be invoked by the middle-layer code in
      question instead of setting power.direct_complete and make that code
      call the new helper.
      
      Fixes: c4b65157 (PCI / PM: Take SMART_SUSPEND driver flag into account)
      Fixes: 05087360 (ACPI / PM: Take SMART_SUSPEND driver flag into account)
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Reviewed-by: NUlf Hansson <ulf.hansson@linaro.org>
      Acked-by: NBjorn Helgaas <bhelgaas@google.com>
      3487972d
  6. 24 11月, 2017 1 次提交
  7. 19 11月, 2017 4 次提交
  8. 14 11月, 2017 3 次提交
  9. 10 11月, 2017 3 次提交
  10. 09 11月, 2017 3 次提交
  11. 08 11月, 2017 3 次提交
    • R
      PCI: Move PCI_QUIRKS to the PCI bus menu · 03ea2263
      Randy Dunlap 提交于
      Localize PCI_QUIRKS in the PCI bus menu.
      
      Move PCI_QUIRKS to the PCI bus menu instead of the (often broken) General
      Setup EXPERT menu.  The prompt still depends on EXPERT.
      Signed-off-by: NRandy Dunlap <rdunlap@infradead.org>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      03ea2263
    • Q
      PCI/PME: Handle invalid data when reading Root Status · 3ad3f8ce
      Qiang 提交于
      PCIe PME and native hotplug share the same interrupt number, so hotplug
      interrupts are also processed by PME.  In some cases, e.g., a Link Down
      interrupt, a device may be present but unreachable, so when we try to
      read its Root Status register, the read fails and we get all ones data
      (0xffffffff).
      
      Previously, we interpreted that data as PCI_EXP_RTSTA_PME being set, i.e.,
      "some device has asserted PME," so we scheduled pcie_pme_work_fn().  This
      caused an infinite loop because pcie_pme_work_fn() tried to handle PME
      requests until PCI_EXP_RTSTA_PME is cleared, but with the link down,
      PCI_EXP_RTSTA_PME can't be cleared.
      
      Check for the invalid 0xffffffff data everywhere we read the Root Status
      register.
      
      1469d17d ("PCI: pciehp: Handle invalid data when reading from
      non-existent devices") added similar checks in the hotplug driver.
      Signed-off-by: NQiang Zheng <zhengqiang10@huawei.com>
      [bhelgaas: changelog, also check in pcie_pme_work_fn(), use "~0" to follow
      other similar checks]
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      3ad3f8ce
    • D
      PCI: hv: Use effective affinity mask · 79aa801e
      Dexuan Cui 提交于
      The effective_affinity_mask is always set when an interrupt is assigned in
      __assign_irq_vector() -> apic->cpu_mask_to_apicid(), e.g. for struct apic
      apic_physflat: -> default_cpu_mask_to_apicid() ->
      irq_data_update_effective_affinity(), but it looks d->common->affinity
      remains all-1's before the user space or the kernel changes it later.
      
      In the early allocation/initialization phase of an IRQ, we should use the
      effective_affinity_mask, otherwise Hyper-V may not deliver the interrupt to
      the expected CPU.  Without the patch, if we assign 7 Mellanox ConnectX-3
      VFs to a 32-vCPU VM, one of the VFs may fail to receive interrupts.
      Tested-by: NAdrian Suhov <v-adsuho@microsoft.com>
      Signed-off-by: NDexuan Cui <decui@microsoft.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Reviewed-by: NJake Oshins <jakeo@microsoft.com>
      Cc: stable@vger.kernel.org
      Cc: Jork Loeser <jloeser@microsoft.com>
      Cc: Stephen Hemminger <sthemmin@microsoft.com>
      Cc: K. Y. Srinivasan <kys@microsoft.com>
      79aa801e
  12. 07 11月, 2017 13 次提交
    • M
      PCI: pciehp: Do not clear Presence Detect Changed during initialization · db63d400
      Mika Westerberg 提交于
      It is possible that the hotplug event has already happened before the
      driver is attached to a PCIe hotplug downstream port. If we just clear the
      status we never get the hotplug interrupt and thus the event will be
      missed.
      
      To make sure that does not happen, we leave Presence Detect Changed bit
      untouched during initialization. Then once the event is unmasked we get an
      interrupt and handle the hotplug event properly.
      Signed-off-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      db63d400
    • M
      PCI: pciehp: Fix race condition handling surprise link down · 49902239
      Mika Westerberg 提交于
      A surprise link down may retrain very quickly causing the same slot
      generate a link up event before handling the link down event completes.
      
      Since the link is active, the power off work queued from the first link
      down will cause a second down event when power is disabled. However, the
      link up event sets the slot state to POWERON_STATE before the event to
      handle this is enqueued, making the second down event believe it needs to
      do something.
      
      This creates constant link up and down event cycle.
      
      To prevent this it is better to handle each event at the time in order it
      occurred, so change the driver to use ordered workqueue instead.
      
      A normal device hotplug triggers two events (presense detect and link up)
      that are already handled properly in the driver but we currently log an
      error if we find an existing device in the slot. Since this is not an error
      change the log level to be debug instead to avoid scaring users.
      
      This is based on the original work by Ashok Raj.
      
      Link: https://patchwork.kernel.org/patch/9469023Suggested-by: NBjorn Helgaas <bhelgaas@google.com>
      Signed-off-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      49902239
    • M
      PCI: Distribute available resources to hotplug-capable bridges · 1a576772
      Mika Westerberg 提交于
      The same problem that we have with bus space applies to other resources
      as well. Linux only allocates the minimal amount of resources so that
      the devices currently present barely fit there. This prevents extending
      the chain later on because the resource windows allocated for hotplug
      downstream ports are too small.
      
      Follow what we already did for bus number and assign all available extra
      resources to hotplug-capable bridges. This makes it possible to extend the
      hierarchy later.
      Signed-off-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      1a576772
    • M
      PCI: Distribute available buses to hotplug-capable bridges · 1c02ea81
      Mika Westerberg 提交于
      System BIOS sometimes allocates extra bus space for hotplug-capable PCIe
      root/downstream ports. This space is needed if the device plugged to the
      port will have more hotplug-capable downstream ports. A good example of
      this is Thunderbolt. Each Thunderbolt device contains a PCIe switch and
      one or more hotplug-capable PCIe downstream ports where the daisy chain
      can be extended.
      
      Currently Linux only allocates minimal bus space to make sure all the
      enumerated devices barely fit there. The BIOS reserved extra space is
      not taken into consideration at all. Because of this we run out of bus
      space pretty quickly when more PCIe devices are attached to hotplug
      downstream ports in order to extend the chain.
      
      Modify the PCI core so we distribute the available BIOS allocated bus space
      equally between hotplug-capable bridges to make sure there is enough bus
      space for extending the hierarchy later on.
      
      Update kernel docs of the affected functions.
      Signed-off-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      1c02ea81
    • M
      PCI: Do not allocate more buses than available in parent · a20c7f36
      Mika Westerberg 提交于
      One can ask more buses to be reserved for hotplug bridges by passing
      pci=hpbussize=N in the kernel command line.  If the parent bus does not
      have enough bus space available we incorrectly create child bus with the
      requested number of subordinate buses.
      
      In the example below hpbussize is set to one more than we have available
      buses in the root port:
      
        pci 0000:07:00.0: [8086:1578] type 01 class 0x060400
        pci 0000:07:00.0: scanning [bus 00-00] behind bridge, pass 0
        pci 0000:07:00.0: bridge configuration invalid ([bus 00-00]), reconfiguring
        pci 0000:07:00.0: scanning [bus 00-00] behind bridge, pass 1
        pci_bus 0000:08: busn_res: can not insert [bus 08-ff] under [bus 07-3f] (conflicts with (null) [bus 07-3f])
        pci_bus 0000:08: scanning bus
        ...
        pci_bus 0000:0a: bus scan returning with max=40
        pci_bus 0000:0a: busn_res: [bus 0a-ff] end is updated to 40
        pci_bus 0000:0a: [bus 0a-40] partially hidden behind bridge 0000:07 [bus 07-3f]
        pci_bus 0000:08: bus scan returning with max=40
        pci_bus 0000:08: busn_res: [bus 08-ff] end is updated to 40
      
      Instead of allowing this, limit the subordinate number to be less than or
      equal the maximum subordinate number allocated for the parent bus (if it
      has any).
      Signed-off-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      [bhelgaas: remove irrelevant dmesg messages]
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      a20c7f36
    • M
      PCI: Open-code the two pass loop when scanning bridges · 4147c2fd
      Mika Westerberg 提交于
      The current scanning code is really hard to understand because it calls
      the same function in a loop where pass value is changed without any
      comments explaining it:
      
        for (pass = 0; pass < 2; pass++)
          for_each_pci_bridge(dev, bus)
            max = pci_scan_bridge(bus, dev, max, pass);
      
      Unfamiliar reader cannot tell easily what is the purpose of this loop
      without looking at internals of pci_scan_bridge().
      
      In order to make this bit easier to understand, open-code the loop in
      pci_scan_child_bus() and pci_hp_add_bridge() with added comments.
      
      No functional changes intended.
      Signed-off-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      4147c2fd
    • M
      PCI: Move pci_hp_add_bridge() to drivers/pci/probe.c · 95e3ba97
      Mika Westerberg 提交于
      There is not much point of having a file with a single function in it.
      Instead we can just move pci_hp_add_bridge() to drivers/pci/probe.c and
      make it available always when PCI core is enabled.
      Signed-off-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      [bhelgaas: convert printk to dev_err()]
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      95e3ba97
    • A
      PCI: Add for_each_pci_bridge() helper · 24a0c654
      Andy Shevchenko 提交于
      The following pattern is often used:
      
        list_for_each_entry(dev, &bus->devices, bus_list) {
          if (pci_is_bridge(dev)) {
            ...
          }
        }
      
      Add a for_each_pci_bridge() helper to make that code easier to write and
      read by reducing indentation level.  It also saves one or few lines of code
      in each occurrence.
      
      Convert PCI core parts here at the same time.
      Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      [bhelgaas: fold in http://lkml.kernel.org/r/20171013165352.25550-1-andriy.shevchenko@linux.intel.com]
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      24a0c654
    • K
      PCI: shpchp: Convert timers to use timer_setup() · 3691314a
      Kees Cook 提交于
      In preparation for unconditionally passing the struct timer_list pointer to
      all timer callbacks, switch to using the new timer_setup() and from_timer()
      to pass the timer pointer explicitly.
      Signed-off-by: NKees Cook <keescook@chromium.org>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Arvind Yadav <arvind.yadav.cs@gmail.com>
      Cc: Quentin Lambert <lambert.quentin@gmail.com>
      Cc: Aleksandr Bezzubikov <zuban32s@gmail.com>
      Cc: "Michael S. Tsirkin" <mst@redhat.com>
      Cc: Marcel Apfelbaum <marcel@redhat.com>
      3691314a
    • K
      PCI: cpqphp: Convert timers to use timer_setup() · 34d773f6
      Kees Cook 提交于
      In preparation for unconditionally passing the struct timer_list pointer to
      all timer callbacks, switch to using the new timer_setup() and from_timer()
      to pass the timer pointer explicitly.  This has the result of fixing
      pushbutton_helper_thread(), which was truncating the event pointer to 32
      bits.
      Signed-off-by: NKees Cook <keescook@chromium.org>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Arvind Yadav <arvind.yadav.cs@gmail.com>
      Cc: Quentin Lambert <lambert.quentin@gmail.com>
      Cc: Aleksandr Bezzubikov <zuban32s@gmail.com>
      Cc: "Michael S. Tsirkin" <mst@redhat.com>
      Cc: Marcel Apfelbaum <marcel@redhat.com>
      34d773f6
    • K
      PCI: pciehp: Convert timers to use timer_setup() · c4459a08
      Kees Cook 提交于
      In preparation for unconditionally passing the struct timer_list pointer to
      all timer callbacks, switch to using the new timer_setup() and from_timer()
      to pass the timer pointer explicitly. This fixes what appears to be a bug
      in passing the wrong pointer to the timer handler (address of ctrl pointer
      instead of ctrl pointer).
      Signed-off-by: NKees Cook <keescook@chromium.org>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
      Cc: Mayurkumar Patel <mayurkumar.patel@intel.com>
      Cc: Keith Busch <keith.busch@intel.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      c4459a08
    • M
      PCI: ibmphp: Use common error handling code in unconfigure_boot_device() · 05196e25
      Markus Elfring 提交于
      Combine two error paths that emit the same message and return the same
      error code.
      
      This issue was detected by using the Coccinelle software.
      Signed-off-by: NMarkus Elfring <elfring@users.sourceforge.net>
      [bhelgaas: changelog]
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      05196e25
    • S
      PCI/portdrv: Turn off PCIe services during shutdown · cc27b735
      Sinan Kaya 提交于
      Some of the PCIe services such as AER are being left enabled during
      shutdown. This might cause spurious AER errors while SOC is being powered
      down.
      
      Clean up the PCIe services gracefully during shutdown to clear these false
      positives.
      Signed-off-by: NSinan Kaya <okaya@codeaurora.org>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      cc27b735
  13. 06 11月, 2017 4 次提交
    • R
      PCI / PM: Take SMART_SUSPEND driver flag into account · c4b65157
      Rafael J. Wysocki 提交于
      Make the PCI bus type take DPM_FLAG_SMART_SUSPEND into account in its
      system-wide PM callbacks and make sure that all code that should not
      run in parallel with pci_pm_runtime_resume() is executed in the "late"
      phases of system suspend, freeze and poweroff transitions.
      
      [Note that the pm_runtime_suspended() check in pci_dev_keep_suspended()
      is an optimization, because if is not passed, all of the subsequent
      checks may be skipped and some of them are much more overhead in
      general.]
      
      Also use the observation that if the device is in runtime suspend
      at the beginning of the "late" phase of a system-wide suspend-like
      transition, its state cannot change going forward (runtime PM is
      disabled for it at that time) until the transition is over and the
      subsequent system-wide PM callbacks should be skipped for it (as
      they generally assume the device to not be suspended), so add checks
      for that in pci_pm_suspend_late/noirq(), pci_pm_freeze_late/noirq()
      and pci_pm_poweroff_late/noirq().
      
      Moreover, if pci_pm_resume_noirq() or pci_pm_restore_noirq() is
      called during the subsequent system-wide resume transition and if
      the device was left in runtime suspend previously, its runtime PM
      status needs to be changed to "active" as it is going to be put
      into the full-power state, so add checks for that too to these
      functions.
      
      In turn, if pci_pm_thaw_noirq() runs after the device has been
      left in runtime suspend, the subsequent "thaw" callbacks need
      to be skipped for it (as they may not work correctly with a
      suspended device), so set the power.direct_complete flag for the
      device then to make the PM core skip those callbacks.
      
      In addition to the above add a core helper for checking if
      DPM_FLAG_SMART_SUSPEND is set and the device runtime PM status is
      "suspended" at the same time, which is done quite often in the new
      code (and will be done elsewhere going forward too).
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Acked-by: NBjorn Helgaas <bhelgaas@google.com>
      c4b65157
    • R
      PCI / PM: Drop unnecessary invocations of pcibios_pm_ops callbacks · 302666d8
      Rafael J. Wysocki 提交于
      The only user of non-empty pcibios_pm_ops is s390 and it only uses
      "noirq" callbacks, so drop the invocations of the other pcibios_pm_ops
      callbacks from the PCI PM code.
      
      That will allow subsequent changes to be somewhat simpler.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Acked-by: NBjorn Helgaas <bhelgaas@google.com>
      Reviewed-by: NUlf Hansson <ulf.hansson@linaro.org>
      302666d8
    • R
      PCI / PM: Use the NEVER_SKIP driver flag · c2eac4d3
      Rafael J. Wysocki 提交于
      Replace the PCI-specific flag PCI_DEV_FLAGS_NEEDS_RESUME with the
      PM core's DPM_FLAG_NEVER_SKIP one everywhere and drop it.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Acked-by: NBjorn Helgaas <bhelgaas@google.com>
      Reviewed-by: NUlf Hansson <ulf.hansson@linaro.org>
      c2eac4d3
    • R
      PM / core: Add NEVER_SKIP and SMART_PREPARE driver flags · 08810a41
      Rafael J. Wysocki 提交于
      The motivation for this change is to provide a way to work around
      a problem with the direct-complete mechanism used for avoiding
      system suspend/resume handling for devices in runtime suspend.
      
      The problem is that some middle layer code (the PCI bus type and
      the ACPI PM domain in particular) returns positive values from its
      system suspend ->prepare callbacks regardless of whether the driver's
      ->prepare returns a positive value or 0, which effectively prevents
      drivers from being able to control the direct-complete feature.
      Some drivers need that control, however, and the PCI bus type has
      grown its own flag to deal with this issue, but since it is not
      limited to PCI, it is better to address it by adding driver flags at
      the core level.
      
      To that end, add a driver_flags field to struct dev_pm_info for flags
      that can be set by device drivers at the probe time to inform the PM
      core and/or bus types, PM domains and so on on the capabilities and/or
      preferences of device drivers.  Also add two static inline helpers
      for setting that field and testing it against a given set of flags
      and make the driver core clear it automatically on driver remove
      and probe failures.
      
      Define and document two PM driver flags related to the direct-
      complete feature: NEVER_SKIP and SMART_PREPARE that can be used,
      respectively, to indicate to the PM core that the direct-complete
      mechanism should never be used for the device and to inform the
      middle layer code (bus types, PM domains etc) that it can only
      request the PM core to use the direct-complete mechanism for
      the device (by returning a positive value from its ->prepare
      callback) if it also has been requested by the driver.
      
      While at it, make the core check pm_runtime_suspended() when
      setting power.direct_complete so that it doesn't need to be
      checked by ->prepare callbacks.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Acked-by: NBjorn Helgaas <bhelgaas@google.com>
      Reviewed-by: NUlf Hansson <ulf.hansson@linaro.org>
      08810a41
  14. 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