1. 18 12月, 2019 1 次提交
  2. 01 12月, 2019 2 次提交
  3. 10 11月, 2019 1 次提交
  4. 07 2月, 2019 1 次提交
  5. 10 10月, 2018 1 次提交
    • G
      of: unittest: Disable interrupt node tests for old world MAC systems · 88948914
      Guenter Roeck 提交于
      On systems with OF_IMAP_OLDWORLD_MAC set in of_irq_workarounds, the
      devicetree interrupt parsing code is different, causing unit tests of
      devicetree interrupt nodes to fail. Due to a bug in unittest code, which
      tries to dereference an uninitialized pointer, this results in a crash.
      
      OF: /testcase-data/phandle-tests/consumer-a: arguments longer than property
      Unable to handle kernel paging request for data at address 0x00bc616e
      Faulting instruction address: 0xc08e9468
      Oops: Kernel access of bad area, sig: 11 [#1]
      BE PREEMPT PowerMac
      Modules linked in:
      CPU: 0 PID: 1 Comm: swapper Not tainted 4.14.72-rc1-yocto-standard+ #1
      task: cf8e0000 task.stack: cf8da000
      NIP:  c08e9468 LR: c08ea5bc CTR: c08ea5ac
      REGS: cf8dbb50 TRAP: 0300   Not tainted  (4.14.72-rc1-yocto-standard+)
      MSR:  00001032 <ME,IR,DR,RI>  CR: 82004044  XER: 00000000
      DAR: 00bc616e DSISR: 40000000
      GPR00: c08ea5bc cf8dbc00 cf8e0000 c13ca517 c13ca517 c13ca8a0 00000066 00000002
      GPR08: 00000063 00bc614e c0b05865 000affff 82004048 00000000 c00047f0 00000000
      GPR16: c0a80000 c0a9cc34 c13ca517 c0ad1134 05ffffff 000affff c0b05860 c0abeef8
      GPR24: cecec278 cecec278 c0a8c4d0 c0a885e0 c13ca8a0 05ffffff c13ca8a0 c13ca517
      
      NIP [c08e9468] device_node_gen_full_name+0x30/0x15c
      LR [c08ea5bc] device_node_string+0x190/0x3c8
      Call Trace:
      [cf8dbc00] [c007f670] trace_hardirqs_on_caller+0x118/0x1fc (unreliable)
      [cf8dbc40] [c08ea5bc] device_node_string+0x190/0x3c8
      [cf8dbcb0] [c08eb794] pointer+0x25c/0x4d0
      [cf8dbd00] [c08ebcbc] vsnprintf+0x2b4/0x5ec
      [cf8dbd60] [c08ec00c] vscnprintf+0x18/0x48
      [cf8dbd70] [c008e268] vprintk_store+0x4c/0x22c
      [cf8dbda0] [c008ecac] vprintk_emit+0x94/0x130
      [cf8dbdd0] [c008ff54] printk+0x5c/0x6c
      [cf8dbe10] [c0b8ddd4] of_unittest+0x2220/0x26f8
      [cf8dbea0] [c0004434] do_one_initcall+0x4c/0x184
      [cf8dbf00] [c0b4534c] kernel_init_freeable+0x13c/0x1d8
      [cf8dbf30] [c0004814] kernel_init+0x24/0x118
      [cf8dbf40] [c0013398] ret_from_kernel_thread+0x5c/0x64
      
      The problem was observed when running a qemu test for the g3beige machine
      with devicetree unittests enabled.
      
      Disable interrupt node tests on affected systems to avoid both false
      unittest failures and the crash.
      
      With this patch in place, unittest on the affected system passes with
      the following message.
      
      	dt-test ### end of unittest - 144 passed, 0 failed
      
      Fixes: 53a42093 ("of: Add device tree selftests")
      Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
      Reviewed-by: NFrank Rowand <frank.rowand@sony.com>
      Signed-off-by: NRob Herring <robh@kernel.org>
      88948914
  6. 13 6月, 2018 1 次提交
    • K
      treewide: kzalloc() -> kcalloc() · 6396bb22
      Kees Cook 提交于
      The kzalloc() function has a 2-factor argument form, kcalloc(). This
      patch replaces cases of:
      
              kzalloc(a * b, gfp)
      
      with:
              kcalloc(a * b, gfp)
      
      as well as handling cases of:
      
              kzalloc(a * b * c, gfp)
      
      with:
      
              kzalloc(array3_size(a, b, c), gfp)
      
      as it's slightly less ugly than:
      
              kzalloc_array(array_size(a, b), c, gfp)
      
      This does, however, attempt to ignore constant size factors like:
      
              kzalloc(4 * 1024, gfp)
      
      though any constants defined via macros get caught up in the conversion.
      
      Any factors with a sizeof() of "unsigned char", "char", and "u8" were
      dropped, since they're redundant.
      
      The Coccinelle script used for this was:
      
      // Fix redundant parens around sizeof().
      @@
      type TYPE;
      expression THING, E;
      @@
      
      (
        kzalloc(
      -	(sizeof(TYPE)) * E
      +	sizeof(TYPE) * E
        , ...)
      |
        kzalloc(
      -	(sizeof(THING)) * E
      +	sizeof(THING) * E
        , ...)
      )
      
      // Drop single-byte sizes and redundant parens.
      @@
      expression COUNT;
      typedef u8;
      typedef __u8;
      @@
      
      (
        kzalloc(
      -	sizeof(u8) * (COUNT)
      +	COUNT
        , ...)
      |
        kzalloc(
      -	sizeof(__u8) * (COUNT)
      +	COUNT
        , ...)
      |
        kzalloc(
      -	sizeof(char) * (COUNT)
      +	COUNT
        , ...)
      |
        kzalloc(
      -	sizeof(unsigned char) * (COUNT)
      +	COUNT
        , ...)
      |
        kzalloc(
      -	sizeof(u8) * COUNT
      +	COUNT
        , ...)
      |
        kzalloc(
      -	sizeof(__u8) * COUNT
      +	COUNT
        , ...)
      |
        kzalloc(
      -	sizeof(char) * COUNT
      +	COUNT
        , ...)
      |
        kzalloc(
      -	sizeof(unsigned char) * COUNT
      +	COUNT
        , ...)
      )
      
      // 2-factor product with sizeof(type/expression) and identifier or constant.
      @@
      type TYPE;
      expression THING;
      identifier COUNT_ID;
      constant COUNT_CONST;
      @@
      
      (
      - kzalloc
      + kcalloc
        (
      -	sizeof(TYPE) * (COUNT_ID)
      +	COUNT_ID, sizeof(TYPE)
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	sizeof(TYPE) * COUNT_ID
      +	COUNT_ID, sizeof(TYPE)
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	sizeof(TYPE) * (COUNT_CONST)
      +	COUNT_CONST, sizeof(TYPE)
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	sizeof(TYPE) * COUNT_CONST
      +	COUNT_CONST, sizeof(TYPE)
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	sizeof(THING) * (COUNT_ID)
      +	COUNT_ID, sizeof(THING)
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	sizeof(THING) * COUNT_ID
      +	COUNT_ID, sizeof(THING)
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	sizeof(THING) * (COUNT_CONST)
      +	COUNT_CONST, sizeof(THING)
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	sizeof(THING) * COUNT_CONST
      +	COUNT_CONST, sizeof(THING)
        , ...)
      )
      
      // 2-factor product, only identifiers.
      @@
      identifier SIZE, COUNT;
      @@
      
      - kzalloc
      + kcalloc
        (
      -	SIZE * COUNT
      +	COUNT, SIZE
        , ...)
      
      // 3-factor product with 1 sizeof(type) or sizeof(expression), with
      // redundant parens removed.
      @@
      expression THING;
      identifier STRIDE, COUNT;
      type TYPE;
      @@
      
      (
        kzalloc(
      -	sizeof(TYPE) * (COUNT) * (STRIDE)
      +	array3_size(COUNT, STRIDE, sizeof(TYPE))
        , ...)
      |
        kzalloc(
      -	sizeof(TYPE) * (COUNT) * STRIDE
      +	array3_size(COUNT, STRIDE, sizeof(TYPE))
        , ...)
      |
        kzalloc(
      -	sizeof(TYPE) * COUNT * (STRIDE)
      +	array3_size(COUNT, STRIDE, sizeof(TYPE))
        , ...)
      |
        kzalloc(
      -	sizeof(TYPE) * COUNT * STRIDE
      +	array3_size(COUNT, STRIDE, sizeof(TYPE))
        , ...)
      |
        kzalloc(
      -	sizeof(THING) * (COUNT) * (STRIDE)
      +	array3_size(COUNT, STRIDE, sizeof(THING))
        , ...)
      |
        kzalloc(
      -	sizeof(THING) * (COUNT) * STRIDE
      +	array3_size(COUNT, STRIDE, sizeof(THING))
        , ...)
      |
        kzalloc(
      -	sizeof(THING) * COUNT * (STRIDE)
      +	array3_size(COUNT, STRIDE, sizeof(THING))
        , ...)
      |
        kzalloc(
      -	sizeof(THING) * COUNT * STRIDE
      +	array3_size(COUNT, STRIDE, sizeof(THING))
        , ...)
      )
      
      // 3-factor product with 2 sizeof(variable), with redundant parens removed.
      @@
      expression THING1, THING2;
      identifier COUNT;
      type TYPE1, TYPE2;
      @@
      
      (
        kzalloc(
      -	sizeof(TYPE1) * sizeof(TYPE2) * COUNT
      +	array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2))
        , ...)
      |
        kzalloc(
      -	sizeof(TYPE1) * sizeof(THING2) * (COUNT)
      +	array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2))
        , ...)
      |
        kzalloc(
      -	sizeof(THING1) * sizeof(THING2) * COUNT
      +	array3_size(COUNT, sizeof(THING1), sizeof(THING2))
        , ...)
      |
        kzalloc(
      -	sizeof(THING1) * sizeof(THING2) * (COUNT)
      +	array3_size(COUNT, sizeof(THING1), sizeof(THING2))
        , ...)
      |
        kzalloc(
      -	sizeof(TYPE1) * sizeof(THING2) * COUNT
      +	array3_size(COUNT, sizeof(TYPE1), sizeof(THING2))
        , ...)
      |
        kzalloc(
      -	sizeof(TYPE1) * sizeof(THING2) * (COUNT)
      +	array3_size(COUNT, sizeof(TYPE1), sizeof(THING2))
        , ...)
      )
      
      // 3-factor product, only identifiers, with redundant parens removed.
      @@
      identifier STRIDE, SIZE, COUNT;
      @@
      
      (
        kzalloc(
      -	(COUNT) * STRIDE * SIZE
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        kzalloc(
      -	COUNT * (STRIDE) * SIZE
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        kzalloc(
      -	COUNT * STRIDE * (SIZE)
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        kzalloc(
      -	(COUNT) * (STRIDE) * SIZE
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        kzalloc(
      -	COUNT * (STRIDE) * (SIZE)
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        kzalloc(
      -	(COUNT) * STRIDE * (SIZE)
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        kzalloc(
      -	(COUNT) * (STRIDE) * (SIZE)
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        kzalloc(
      -	COUNT * STRIDE * SIZE
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      )
      
      // Any remaining multi-factor products, first at least 3-factor products,
      // when they're not all constants...
      @@
      expression E1, E2, E3;
      constant C1, C2, C3;
      @@
      
      (
        kzalloc(C1 * C2 * C3, ...)
      |
        kzalloc(
      -	(E1) * E2 * E3
      +	array3_size(E1, E2, E3)
        , ...)
      |
        kzalloc(
      -	(E1) * (E2) * E3
      +	array3_size(E1, E2, E3)
        , ...)
      |
        kzalloc(
      -	(E1) * (E2) * (E3)
      +	array3_size(E1, E2, E3)
        , ...)
      |
        kzalloc(
      -	E1 * E2 * E3
      +	array3_size(E1, E2, E3)
        , ...)
      )
      
      // And then all remaining 2 factors products when they're not all constants,
      // keeping sizeof() as the second factor argument.
      @@
      expression THING, E1, E2;
      type TYPE;
      constant C1, C2, C3;
      @@
      
      (
        kzalloc(sizeof(THING) * C2, ...)
      |
        kzalloc(sizeof(TYPE) * C2, ...)
      |
        kzalloc(C1 * C2 * C3, ...)
      |
        kzalloc(C1 * C2, ...)
      |
      - kzalloc
      + kcalloc
        (
      -	sizeof(TYPE) * (E2)
      +	E2, sizeof(TYPE)
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	sizeof(TYPE) * E2
      +	E2, sizeof(TYPE)
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	sizeof(THING) * (E2)
      +	E2, sizeof(THING)
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	sizeof(THING) * E2
      +	E2, sizeof(THING)
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	(E1) * E2
      +	E1, E2
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	(E1) * (E2)
      +	E1, E2
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	E1 * E2
      +	E1, E2
        , ...)
      )
      Signed-off-by: NKees Cook <keescook@chromium.org>
      6396bb22
  7. 23 5月, 2018 1 次提交
  8. 12 4月, 2018 1 次提交
    • A
      proc: add seq_put_decimal_ull_width to speed up /proc/pid/smaps · d1be35cb
      Andrei Vagin 提交于
      seq_put_decimal_ull_w(m, str, val, width) prints a decimal number with a
      specified minimal field width.
      
      It is equivalent of seq_printf(m, "%s%*d", str, width, val), but it
      works much faster.
      
      == test_smaps.py
        num = 0
        with open("/proc/1/smaps") as f:
                for x in xrange(10000):
                        data = f.read()
                        f.seek(0, 0)
      ==
      
      == Before patch ==
        $ time python test_smaps.py
        real    0m4.593s
        user    0m0.398s
        sys     0m4.158s
      
      == After patch ==
        $ time python test_smaps.py
        real    0m3.828s
        user    0m0.413s
        sys     0m3.408s
      
      $ perf -g record python test_smaps.py
      == Before patch ==
      -   79.01%     3.36%  python   [kernel.kallsyms]    [k] show_smap.isra.33
         - 75.65% show_smap.isra.33
            + 48.85% seq_printf
            + 15.75% __walk_page_range
            + 9.70% show_map_vma.isra.23
              0.61% seq_puts
      
      == After patch ==
      -   75.51%     4.62%  python   [kernel.kallsyms]    [k] show_smap.isra.33
         - 70.88% show_smap.isra.33
            + 24.82% seq_put_decimal_ull_w
            + 19.78% __walk_page_range
            + 12.74% seq_printf
            + 11.08% show_map_vma.isra.23
            + 1.68% seq_puts
      
      [akpm@linux-foundation.org: fix drivers/of/unittest.c build]
      Link: http://lkml.kernel.org/r/20180212074931.7227-1-avagin@openvz.orgSigned-off-by: NAndrei Vagin <avagin@openvz.org>
      Cc: Alexey Dobriyan <adobriyan@gmail.com>
      Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      d1be35cb
  9. 20 3月, 2018 1 次提交
  10. 18 3月, 2018 2 次提交
  11. 12 3月, 2018 2 次提交
  12. 08 3月, 2018 1 次提交
  13. 06 3月, 2018 2 次提交
    • F
      of: overlay: do not include path in full_name of added nodes · b89dae18
      Frank Rowand 提交于
      Struct device_node full_name no longer includes the full path name
      when the devicetree is created from a flattened device tree (FDT).
      The overlay node creation code was not modified to reflect this
      change.  Fix the node full_name generated by overlay code to contain
      only the basename.
      
      Unittests call an overlay internal function to create new nodes.
      Fix up these calls to provide basename only instead of the full
      path.
      
      Fixes: a7e4cfb0 ("of/fdt: only store the device node basename
      in full_name")
      Signed-off-by: NFrank Rowand <frank.rowand@sony.com>
      Signed-off-by: NRob Herring <robh@kernel.org>
      b89dae18
    • F
      of: unittest: clean up changeset test · a4f91f0d
      Frank Rowand 提交于
      In preparation for fixing __of_node_dup(), clean up the unittest
      function that calls it.
      
      Devicetree nodes created from a flattened device tree have a name
      property.  Follow this convention for nodes added by a changeset.
      
      For node added by changeset, remove incorrect initialization of
      child node pointer.
      
      Add an additional node pointer 'changeset' to more naturally reflect
      where in the tree the changeset is added.
      
      Make changeset add property error messages unique.
      
      Add whitespace to break apart logic blocks.
      Signed-off-by: NFrank Rowand <frank.rowand@sony.com>
      Signed-off-by: NRob Herring <robh@kernel.org>
      a4f91f0d
  14. 04 3月, 2018 1 次提交
    • F
      of: change overlay apply input data from unflattened to FDT · 39a751a4
      Frank Rowand 提交于
      Move duplicating and unflattening of an overlay flattened devicetree
      (FDT) into the overlay application code.  To accomplish this,
      of_overlay_apply() is replaced by of_overlay_fdt_apply().
      
      The copy of the FDT (aka "duplicate FDT") now belongs to devicetree
      code, which is thus responsible for freeing the duplicate FDT.  The
      caller of of_overlay_fdt_apply() remains responsible for freeing the
      original FDT.
      
      The unflattened devicetree now belongs to devicetree code, which is
      thus responsible for freeing the unflattened devicetree.
      
      These ownership changes prevent early freeing of the duplicated FDT
      or the unflattened devicetree, which could result in use after free
      errors.
      
      of_overlay_fdt_apply() is a private function for the anticipated
      overlay loader.
      
      Update unittest.c to use of_overlay_fdt_apply() instead of
      of_overlay_apply().
      
      Move overlay fragments from artificial locations in
      drivers/of/unittest-data/tests-overlay.dtsi into one devicetree
      source file per overlay.  This led to changes in
      drivers/of/unitest-data/Makefile and drivers/of/unitest.c.
      
        - Add overlay directives to the overlay devicetree source files so
          that dtc will compile them as true overlays into one FDT data
          chunk per overlay.
      
        - Set CFLAGS for drivers/of/unittest-data/testcases.dts so that
          symbols will be generated for overlay resolution of overlays
          that are no longer artificially contained in testcases.dts
      
        - Unflatten and apply each unittest overlay FDT using
          of_overlay_fdt_apply().
      
        - Enable the of_resolve_phandles() check for whether the unflattened
          overlay is detached.  This check was previously disabled because the
          overlays from tests-overlay.dtsi were not unflattened into detached
          trees.
      
        - Other changes to unittest.c infrastructure to manage multiple test
          FDTs built into the kernel image (access by name instead of
          arbitrary number).
      
        - of_unittest_overlay_high_level(): previously unused code to add
          properties from the overlay_base devicetree to the live tree
          was triggered by the restructuring of tests-overlay.dtsi and thus
          testcases.dts.  This exposed two bugs: (1) the need to dup a
          property before adding it, and (2) property 'name' is
          auto-generated in the unflatten code and thus will be a duplicate
          in the __symbols__ node - do not treat this duplicate as an error.
      Signed-off-by: NFrank Rowand <frank.rowand@sony.com>
      39a751a4
  15. 12 2月, 2018 1 次提交
  16. 08 1月, 2018 1 次提交
    • R
      of/fdt: use memblock_virt_alloc for early alloc · 0fa1c579
      Rob Herring 提交于
      memblock_virt_alloc() works for both memblock and bootmem, so use it and
      make early_init_dt_alloc_memory_arch a static function. The arches using
      bootmem define early_init_dt_alloc_memory_arch as either:
      
      __alloc_bootmem(size, align, __pa(MAX_DMA_ADDRESS))
      
      or:
      
      alloc_bootmem_align(size, align)
      
      Both of these evaluate to the same thing as does memblock_virt_alloc for
      bootmem. So we can disable the arch specific functions by making
      early_init_dt_alloc_memory_arch static and they can be removed in
      subsequent commits.
      
      Cc: Frank Rowand <frowand.list@gmail.com>
      Signed-off-by: NRob Herring <robh@kernel.org>
      0fa1c579
  17. 07 12月, 2017 1 次提交
  18. 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
  19. 18 10月, 2017 3 次提交
    • F
      of: overlay: avoid race condition between applying multiple overlays · f948d6d8
      Frank Rowand 提交于
      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: NFrank Rowand <frank.rowand@sony.com>
      Signed-off-by: NRob Herring <robh@kernel.org>
      f948d6d8
    • F
      of: overlay: detect cases where device tree may become corrupt · 24789c5c
      Frank Rowand 提交于
      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: NFrank Rowand <frank.rowand@sony.com>
      Signed-off-by: NRob Herring <robh@kernel.org>
      24789c5c
    • F
      of: overlay: rename identifiers to more reflect what they do · 0290c4ca
      Frank Rowand 提交于
      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: NFrank Rowand <frank.rowand@sony.com>
      Signed-off-by: NRob Herring <robh@kernel.org>
      0290c4ca
  20. 17 10月, 2017 1 次提交
  21. 20 7月, 2017 1 次提交
    • F
      of: overlay: add overlay unittest data for node names and symbols · 60a0004c
      Frank Rowand 提交于
      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: NFrank Rowand <frank.rowand@sony.com>
      Signed-off-by: NRob Herring <robh@kernel.org>
      60a0004c
  22. 19 7月, 2017 1 次提交
  23. 28 6月, 2017 1 次提交
    • P
      vsprintf: Add %p extension "%pOF" for device tree · ce4fecf1
      Pantelis Antoniou 提交于
      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
      node.
      
      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: NPantelis Antoniou <pantelis.antoniou@konsulko.com>
      Acked-by: NJoe Perches <joe@perches.com>
      Signed-off-by: NRob Herring <robh@kernel.org>
      ce4fecf1
  24. 05 5月, 2017 1 次提交
  25. 03 5月, 2017 1 次提交
  26. 28 4月, 2017 1 次提交
  27. 24 1月, 2017 1 次提交
  28. 05 1月, 2017 1 次提交
  29. 24 6月, 2016 1 次提交
  30. 19 5月, 2016 1 次提交
  31. 16 5月, 2016 1 次提交
  32. 22 4月, 2016 1 次提交
  33. 04 3月, 2016 1 次提交
    • S
      of/unittest: fix infinite loop in of_unittest_destroy_tracked_overlays() · 815d74b3
      Sergey Senozhatsky 提交于
      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: NSergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Reported-by: Nkernel test robot <ying.huang@linux.intel.com>
      Link: lkml.kernel.org/r/87fuwk1c0o.fsf@yhuang-dev.intel.com
      Signed-off-by: NRob Herring <robh@kernel.org>
      815d74b3
  34. 14 1月, 2016 1 次提交