1. 13 Nov, 2017 1 commit
  2. 08 Nov, 2017 15 commits
  3. 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
  4. 31 Oct, 2017 10 commits
  5. 30 Oct, 2017 2 commits
    • Linus Walleij's avatar
      gpio: Make it possible for consumers to enforce open drain · f926dfc1
      Linus Walleij authored
      Some busses, like I2C, strictly need to have the line handled
      as open drain, i.e. not actively driven high. For this reason
      the i2c-gpio.c bit-banged I2C driver is reimplementing open
      drain handling outside of gpiolib.
      
      This is not very optimal. Instead make it possible for a
      consumer to explcitly express that the line must be handled
      as open drain instead of allowing local hacks papering over
      this issue.
      
      The descriptor tables, whether DT, ACPI or board files, should
      of course have flagged these lines as open drain. E.g.:
      enum gpio_lookup_flags GPIO_OPEN_DRAIN for a board file, or
      gpios = <&foo 42 GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN>; in a
      device tree using <dt-bindings/gpio/gpio.h>
      
      But more often than not, these descriptors are wrong. So
      we need to make it possible for consumers to enforce this
      open drain behaviour.
      
      We now have two new enumerated GPIO descriptor config flags:
      GPIOD_OUT_LOW_OPEN_DRAIN and GPIOD_OUT_HIGH_OPEN_DRAIN
      that will set up the lined enforced as open drain as output
      low or high, using open drain (if the driver supports it)
      or using open drain emulation (setting the line as input
      to drive it high) from the gpiolib core.
      
      Cc: linux-gpio@vger.kernel.org
      Tested-by: 's avatarGeert Uytterhoeven <geert+renesas@glider.be>
      Signed-off-by: 's avatarLinus Walleij <linus.walleij@linaro.org>
      f926dfc1
    • Linus Walleij's avatar
      gpio-mmio: Use the new .get_multiple() callback · 80057cb4
      Linus Walleij authored
      It is possible to read all lines of a generic MMIO GPIO chip
      with a single register read so support this if we are in
      native endianness.
      
      Add an especially quirky callback to read multiple lines for
      the variants that require you to read values from the
      output registers if and only if the line is set as output.
      We managed to do that with a maximum of two register reads,
      and just one read if the requested lines are all input or all
      output.
      
      Cc: Anton Vorontsov <anton@enomsg.org>
      Cc: Lukas Wunner <lukas@wunner.de>
      Signed-off-by: 's avatarLinus Walleij <linus.walleij@linaro.org>
      80057cb4
  6. 25 Oct, 2017 6 commits
    • Linus Walleij's avatar
      gpio: mmio: Make pin2mask() a private business · 24efd94b
      Linus Walleij authored
      The vtable call pin2mask() was introducing a vtable function call
      in every gpiochip callback for a generic MMIO GPIO chip. This was
      not exactly efficient. (Maybe link-time optimization could get rid of
      it, I don't know.)
      
      After removing all external calls into this API we can make it a
      boolean flag in the struct gpio_chip call and sink the function into
      the gpio-mmio driver yielding encapsulation and potential speedups.
      
      Cc: Anton Vorontsov <anton@enomsg.org>
      Signed-off-by: 's avatarLinus Walleij <linus.walleij@linaro.org>
      24efd94b
    • Linus Walleij's avatar
      gpio: mpc8xxx: Do not reverse bits using bgpio · b3222f71
      Linus Walleij authored
      The MPC8xxx driver is always instantiating its generic GPIO functions
      with the flag BGPIOF_BIG_ENDIAN. This means "big-endian bit order"
      and means the bits representing the GPIO lines in the registers are
      reversed around 31 bits so line 0 is at bit 31 and so forth down to
      line 31 in bit 0.
      
      Instead of looping into the generic MMIO gpio to do the simple
      calculation of a bitmask, through a vtable call with two parameters
      likely using stack frames etc (unless the compiler optimize it)
      and obscuring the view for the programmer, let's just open-code
      what the call does. This likely executes faster, saves space and
      makes the code easier to read.
      
      Cc: Liu Gang <Gang.Liu@nxp.com>
      Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
      Signed-off-by: 's avatarLinus Walleij <linus.walleij@linaro.org>
      b3222f71
    • Linus Walleij's avatar
      gpio: brcmstb: Do not use gc->pin2mask() · d7442368
      Linus Walleij authored
      The pin2mask() accessor only shuffles BIT ORDER in big endian systems,
      i.e. the bitstuffing is swizzled big endian so "bit 0" is bit 7 or
      bit 15 or bit 31 or so.
      
      The brcmstb only uses big endian BYTE ORDER which will be taken car of
      by the ->write_reg() callback.
      
      Just use BIT(offset) to assign the bit.
      Acked-by: 's avatarGregory Fong <gregory.0xf0@gmail.com>
      Reviewed-by: 's avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: 's avatarLinus Walleij <linus.walleij@linaro.org>
      d7442368
    • Linus Walleij's avatar
      gpio: grgpio: Do not use gc->pin2mask() · 5c7b0c4e
      Linus Walleij authored
      The pin2mask() accessor only shuffles BIT ORDER in big endian systems,
      i.e. the bitstuffing is swizzled big endian so "bit 0" is bit 7 or
      bit 15 or bit 31 or so.
      
      The grgpio only uses big endian BYTE ORDER which will be taken car of
      by the ->write_reg() callback.
      
      Just use BIT(offset) to assign the bit.
      Acked-by: 's avatarAndreas Larsson <andreas@gaisler.com>
      Signed-off-by: 's avatarLinus Walleij <linus.walleij@linaro.org>
      5c7b0c4e
    • Linus Walleij's avatar
      gpio: loongson1: fix bgpio usage · fe29416b
      Linus Walleij authored
      When no flags are given, the native endianness is used to access
      the MMIO registers, and the pin2mask() call can simply be
      converted to a BIT() call, as per the default pin2mask()
      implementation in gpio-mmio.c.
      
      Cc: Kelvin Cheung <keguang.zhang@gmail.com>
      Signed-off-by: 's avatarLinus Walleij <linus.walleij@linaro.org>
      fe29416b
    • Linus Walleij's avatar
      gpio: dwapb: fix bgpio usage · d97a1b56
      Linus Walleij authored
      The DW APB GPIO driver uses the generic GPIO library gpio-mmio,
      and initialize the flags as "false", which should be 0.
      
      When no flags are given, the native endianness is used to access
      the MMIO registers, and the pin2mask() call can simply be
      converted to a BIT() call, as per the default pin2mask()
      implementation in gpio-mmio.c.
      Acked-by: 's avatarAlan Tull <atull@kernel.org>
      Acked-by: 's avatarHoan Tran <hotran@apm.com>
      Signed-off-by: 's avatarLinus Walleij <linus.walleij@linaro.org>
      d97a1b56
  7. 23 Oct, 2017 1 commit
    • Masahiro Yamada's avatar
      gpio: uniphier: add UniPhier GPIO controller driver · dbe776c2
      Masahiro Yamada authored
      This GPIO controller is used on UniPhier SoC family.
      
      It also serves as an interrupt controller, but interrupt signals are
      just delivered to the parent irqchip without any latching or OR'ing.
      This type of hardware can be well described with hierarchy IRQ domain.
      
      One unfortunate thing for this device is that the interrupt mapping to
      the interrupt parent is not contiguous.
      
      I asked how DT can describe interrupt mapping between two irqchips [1],
      but I could not find a good solution (at least in the framework level).
      In fact, irqchip drivers using hierarchy domain generally hard-code the
      DT binding of their parent.
      
      After tackling on several approaches such as hard-code of hwirqs,
      irq_domain_push_irq(), I ended up with a vendor specific property.
      If we come up with a good idea to support this in the framework, we
      can migrate over to it, but we can live with a driver-level solution
      for now.
      
      [1] https://lkml.org/lkml/2017/7/6/758Signed-off-by: Masahiro Yamada's avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      Signed-off-by: 's avatarLinus Walleij <linus.walleij@linaro.org>
      dbe776c2
  8. 20 Oct, 2017 1 commit
    • Andrew Jeffery's avatar
      gpio: Fix loose spelling · 2cbfca66
      Andrew Jeffery authored
      Literally.
      
      I expect "lose" was meant here, rather than "loose", though you could feasibly
      use a somewhat uncommon definition of "loose" to mean what would be meant by
      "lose": "Loose the hounds" for instance, as in "Release the hounds".
      Substituting in "value" for "hounds" gives "release the value", and makes some
      sense, but futher substituting back to loose gives "loose the value" which
      overall just seems a bit anachronistic.
      
      Instead, use modern, pragmatic English and save a character.
      
      Cc: Russell Currey <ruscur@russell.cc>
      Signed-off-by: 's avatarAndrew Jeffery <andrew@aj.id.au>
      Signed-off-by: 's avatarLinus Walleij <linus.walleij@linaro.org>
      2cbfca66
  9. 19 Oct, 2017 3 commits