08 Jun, 2018

1 commit

  • Pull DeviceTree updates from Rob Herring:

    - Sync dtc with upstream version v1.4.6-21-g84e414b0b5bc. This adds new
    warnings which are either fixed or disabled by default (enabled with
    W=1).

    - Validate an untrusted offset in DT overlay function
    update_usages_of_a_phandle_reference

    - Fix a use after free error of_platform_device_destroy

    - Fix an off by 1 string errors in unittest

    - Avoid creating a struct device for OPP nodes

    - Update DT specific submitting-patches.txt with patch content and
    subject requirements.

    - Move some bindings to their proper subsystem locations

    - Add vendor prefixes for Kaohsiung, SiFive, Avnet, Wi2Wi, Logic PD,
    and ArcherMind

    - Add documentation for "no-gpio-delays" property in FSI bus GPIO
    master

    - Add compatible for r8a77990 SoC ravb ethernet block

    - More wack-a-mole removal of 'status' property in examples

    * tag 'devicetree-for-4.18' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: (25 commits)
    dt-bindings: submitting-patches: add guidance on patch content and subject
    of: platform: stop accessing invalid dev in of_platform_device_destroy
    dt-bindings: net: ravb: Add support for r8a77990 SoC
    dt-bindings: Add vendor prefix for ArcherMind
    dt-bindings: fsi-master-gpio: Document "no-gpio-delays" property
    dt-bindings: Add vendor prefix for Logic PD
    of: overlay: validate offset from property fixups
    of: unittest: for strings, account for trailing \0 in property length field
    drm: rcar-du: disable dtc graph-endpoint warnings on DT overlays
    kbuild: disable new dtc graph and unit-address warnings
    scripts/dtc: Update to upstream version v1.4.6-21-g84e414b0b5bc
    MAINTAINERS: add keyword for devicetree overlay notifiers
    dt-bindings: define vendor prefix for Wi2Wi, Inc.
    dt-bindings: Add vendor prefix for Avnet, Inc.
    dt-bindings: Relocate Tegra20 memory controller bindings
    dt-bindings: Add "sifive" vendor prefix
    dt-bindings: exynos: move ADC binding to iio/adc/ directory
    dt-bindings: powerpc/4xx: move 4xx NDFC and EMAC bindings to subsystem directories
    dt-bindings: move various RNG bindings to rng/ directory
    dt-bindings: move various timer bindings to timer/ directory
    ...

    Linus Torvalds
     

15 May, 2018

1 commit

  • dtc gained some new warnings for OF graphs and unique unit addresses,
    but they are currently much too noisy. So turn off
    'graph_child_address', 'graph_port', and 'unique_unit_address' warnings
    by default. They can be enabled by building dtbs with W=1.

    Acked-by: Masahiro Yamada
    Cc: Michal Marek
    Cc: linux-kbuild@vger.kernel.org
    Signed-off-by: Rob Herring

    Rob Herring
     

05 May, 2018

1 commit


07 Apr, 2018

3 commits

  • GNU Make automatically deletes intermediate files that are updated
    in a chain of pattern rules.

    Example 1) %.dtb.o
    Acked-by: Frank Rowand
    Acked-by: Ingo Molnar

    Masahiro Yamada
     
  • Another common pattern that consists of chained commands is to compile
    a DTB as binary data into the kernel image or a module. It is used in
    several places in the source tree. Support it in the core Makefile.

    $(call if_changed,dt_S_dtb) is more suitable than $(call cmd,dt_S_dtb)
    in case cmd_dt_S_dtb is changed in the future.

    Signed-off-by: Masahiro Yamada
    Acked-by: Frank Rowand

    Masahiro Yamada
     
  • Now that the kernel build supports flex and bison, remove the _shipped
    files and generate them during the build instead.

    There are no more shipped lexer and parser, so I ripped off the rules
    in scripts/Malefile.lib that were used for REGENERATE_PARSERS.

    The genksyms parser has ambiguous grammar, which would emit warnings:

    scripts/genksyms/parse.y: warning: 9 shift/reduce conflicts [-Wconflicts-sr]
    scripts/genksyms/parse.y: warning: 5 reduce/reduce conflicts [-Wconflicts-rr]

    They are normally suppressed, but displayed when W=1 is given.

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     

06 Apr, 2018

1 commit

  • Pull DeviceTree updates from Rob Herring:

    - Sync dtc to upstream version v1.4.6-9-gaadd0b65c987. This adds a
    bunch more warnings (hidden behind W=1).

    - Build dtc lexer and parser files instead of using shipped versions.

    - Rework overlay apply API to take an FDT as input and apply overlays
    in a single step.

    - Add a phandle lookup cache. This improves boot time by hundreds of
    msec on systems with large DT.

    - Add trivial mcp4017/18/19 potentiometers bindings.

    - Remove VLA stack usage in DT code.

    * tag 'devicetree-for-4.17' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: (26 commits)
    of: unittest: fix an error code in of_unittest_apply_overlay()
    of: unittest: move misplaced function declaration
    of: unittest: Remove VLA stack usage
    of: overlay: Fix forgotten reference to of_overlay_apply()
    of: Documentation: Fix forgotten reference to of_overlay_apply()
    of: unittest: local return value variable related cleanups
    of: unittest: remove unneeded local return value variables
    dt-bindings: trivial: add various mcp4017/18/19 potentiometers
    of: unittest: fix an error test in of_unittest_overlay_8()
    of: cache phandle nodes to reduce cost of of_find_node_by_phandle()
    dt-bindings: rockchip-dw-mshc: use consistent clock names
    MAINTAINERS: Add linux/of_*.h headers to appropriate subsystems
    scripts: turn off some new dtc warnings by default
    scripts/dtc: Update to upstream version v1.4.6-9-gaadd0b65c987
    scripts/dtc: generate lexer and parser during build instead of shipping
    powerpc: boot: add strrchr function
    of: overlay: do not include path in full_name of added nodes
    of: unittest: clean up changeset test
    arm64/efi: Make strrchr() available to the EFI namespace
    ARM: boot: add strrchr function
    ...

    Linus Torvalds
     

31 Mar, 2018

1 commit

  • Since commit 28128c61e08e ("kconfig.h: Include compiler types to avoid
    missed struct attributes"), pulls in kernel-space
    headers to unrelated places.

    Commit 0f9da844d877 ("MIPS: boot: Define __ASSEMBLY__ for its.S build")
    suppress the build error by defining __ASSEMBLY__, but ITS (i.e. DTS)
    is not assembly, and should not include in the
    first place.

    Looking at arch/s390/tools/Makefile, host programs gen_facilities and
    gen_opcode_table now pull in as well.

    The motivation for that commit was to define necessary attributes
    before any struct is defined. Obviously, this happens only in C.

    It is enough to include only when compiling
    C files, and only when compiling kernel space. Move the include to
    c_flags.

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     

26 Mar, 2018

9 commits

  • In Kbuild, Makefiles can add the same object to obj-y multiple
    times. So,

    obj-y += foo.o
    obj-y += foo.o

    is fine.

    However, this is not true when the same object is added multiple
    times via composite objects. For example,

    obj-y += foo.o bar.o
    foo-objs := foo-bar-common.o foo-only.o
    bar-objs := foo-bar-common.o bar-only.o

    causes build error because two instances of foo-bar-common.o are
    linked into the vmlinux.

    Makefiles tend to invent ugly work-around, for example
    - lib/zstd/Makefile
    - drivers/net/ethernet/cavium/liquidio/Makefile

    The technique used in Kbuild to avoid the multiple definition error
    is to use $(filter $(obj-y), $^). Here, $^ lists the names of all
    the prerequisites with duplicated names removed.

    By replacing it with $(filter $(real-obj-y), $^) we can do likewise
    for composite objects. For built-in objects, we do not need to keep
    the composite object structure. We can simply expand them, and link
    $(real-obj-y) to built-in.a.

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     
  • When I was refactoring Makefiles, I stupidly mistook 'real-obj-y' for
    'real-objs-y' over and over again. Finally, I decide to rename it to
    'real-obj-y'. This is consistent with 'obj-y', 'subdir-obj-y'.

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     
  • Just a cosmetic change to put related code close together.

    Signed-off-by: Masahiro Yamada
    Reviewed-by: Cao jin

    Masahiro Yamada
     
  • modname can be calculated much more simply. If modname-multi is
    empty, it is a single-used object. So, modname = $(basetarget).
    Otherwise, modname = $(modname-multi).

    Signed-off-by: Masahiro Yamada
    Reviewed-by: Cao jin

    Masahiro Yamada
     
  • Commit cf4f21938e13 ("kbuild: Allow to specify composite modules
    with modname-m") added modname-m support, but missed to update the
    corresponding multi-objs-m & modname-multi definition.

    Signed-off-by: Cao jin
    Signed-off-by: Masahiro Yamada

    Cao jin
     
  • Currently, KBUILD_MODNAME is defined only when $(modname) contains
    just one word. If an object is shared among multiple modules,
    undefined KBUILD_MODNAME could cause a build error. For example,
    if CONFIG_DYNAMIC_DEBUG is enabled, any call of printk() populates
    .modname, then fails to build due to undefined KBUILD_MODNAME.

    Take the following code as an example:

    obj-m += foo.o
    obj-m += bar.o
    foo-objs := foo-bar-common.o foo-only.o
    bar-objs := foo-bar-common.o bar-only.o

    In this case, there is room for argument what to define for
    KBUILD_MODNAME when foo-bar-common.o is being compiled.
    "foo", "bar", or what else?

    One idea is to define colon-separated modules that share the object,
    in this case, "bar:foo" (modules are sorted alphabetically by
    $(sort ...)).

    Signed-off-by: Masahiro Yamada
    Reviewed-by: Cao jin

    Masahiro Yamada
     
  • In the context ...

    $(obj)/%.s: $(src)/%.c FORCE
    $(call if_changed_dep,cc_s_c)

    $(obj)/%.i: $(src)/%.c FORCE
    $(call if_changed_dep,cpp_i_c)

    $(obj)/%.o: $(src)/%.c $(recordmcount_source) $(objtool_dep) FORCE
    $(call cmd,force_checksrc)
    $(call if_changed_rule,cc_o_c)

    $(obj)/%.lst: $(src)/%.c FORCE
    $(call if_changed_dep,cc_lst_c)

    '$*' returns the stem of the target (the part of '%'), so $(obj)/ has
    already been ripped off.

    $(subst $(obj)/,,$*.o) is the same as $*.o

    Signed-off-by: Masahiro Yamada
    Reviewed-by: Cao jin

    Masahiro Yamada
     
  • stat(1) is not standardized and different implementations have their own
    (conflicting) flags for querying the size of a file.

    ls(1) provides the same information (value of st.st_size) in the 5th
    column, except when the file is a character or block device. This output
    is standardized[0]. The -n option turns on -l, which writes lines
    formatted like

    "%s %u %s %s %u %s %s\n", , ,
    , , , ,

    but instead of writing the and , it writes the
    numeric owner and group IDs (this avoids /etc/passwd and /etc/group
    lookups as well as potential field splitting issues).

    The field is specified as "the value that would be returned for
    the file in the st_size field of struct stat".

    To avoid duplicating logic in several locations in the tree, create
    scripts/file-size.sh and update callers to use that instead of stat(1).

    [0] http://pubs.opengroup.org/onlinepubs/9699919799/utilities/ls.html#tag_20_73_10

    Signed-off-by: Michael Forney
    Signed-off-by: Masahiro Yamada

    Michael Forney
     
  • Incremental linking is gone, so rename built-in.o to built-in.a, which
    is the usual extension for archive files.

    This patch does two things, first is a simple search/replace:

    git grep -l 'built-in\.o' | xargs sed -i 's/built-in\.o/built-in\.a/g'

    The second is to invert nesting of nested text manipulations to avoid
    filtering built-in.a out from libs-y2:

    -libs-y2 := $(filter-out %.a, $(patsubst %/, %/built-in.a, $(libs-y)))
    +libs-y2 := $(patsubst %/, %/built-in.a, $(filter-out %.a, $(libs-y)))

    Signed-off-by: Nicholas Piggin
    Signed-off-by: Masahiro Yamada

    Nicholas Piggin
     

09 Mar, 2018

1 commit

  • cmd_dt_S_dtb constructs the assembly source to incorporate a devicetree
    FDT (that is, the .dtb file) as binary data in the kernel image. This
    assembly source contains labels before and after the binary data. The
    label names incorporate the file name of the corresponding .dtb file.
    Hyphens are not legal characters in labels, so .dtb files built into the
    kernel with hyphens in the file name result in errors like the
    following:

    bcm3368-netgear-cvg834g.dtb.S: Assembler messages:
    bcm3368-netgear-cvg834g.dtb.S:5: Error: : no such section
    bcm3368-netgear-cvg834g.dtb.S:5: Error: junk at end of line, first unrecognized character is `-'
    bcm3368-netgear-cvg834g.dtb.S:6: Error: unrecognized opcode `__dtb_bcm3368-netgear-cvg834g_begin:'
    bcm3368-netgear-cvg834g.dtb.S:8: Error: unrecognized opcode `__dtb_bcm3368-netgear-cvg834g_end:'
    bcm3368-netgear-cvg834g.dtb.S:9: Error: : no such section
    bcm3368-netgear-cvg834g.dtb.S:9: Error: junk at end of line, first unrecognized character is `-'

    Fix this by updating cmd_dt_S_dtb to transform all hyphens from the file
    name to underscores when constructing the labels.

    As of v4.16-rc2, 1139 .dts files across ARM64, ARM, MIPS and PowerPC
    contain hyphens in their names, but the issue only currently manifests
    on Broadcom MIPS platforms, as that is the only place where such files
    are built into the kernel. For example when CONFIG_DT_NETGEAR_CVG834G=y,
    or on BMIPS kernels when the dtbs target is used (in the latter case it
    admittedly shouldn't really build all the dtb.o files, but thats a
    separate issue).

    Fixes: 695835511f96 ("MIPS: BMIPS: rename bcm96358nb4ser to bcm6358-neufbox4-sercom")
    Signed-off-by: James Hogan
    Reviewed-by: Frank Rowand
    Cc: Rob Herring
    Cc: Michal Marek
    Cc: Ralf Baechle
    Cc: Florian Fainelli
    Cc: Kevin Cernekee
    Cc: # 4.9+
    Signed-off-by: Masahiro Yamada

    James Hogan
     

06 Mar, 2018

1 commit


02 Mar, 2018

3 commits


07 Feb, 2018

1 commit

  • With KASAN enabled the kernel has two different memset() functions, one
    with KASAN checks (memset) and one without (__memset). KASAN uses some
    macro tricks to use the proper version where required. For example
    memset() calls in mm/slub.c are without KASAN checks, since they operate
    on poisoned slab object metadata.

    The issue is that clang emits memset() calls even when there is no
    memset() in the source code. They get linked with improper memset()
    implementation and the kernel fails to boot due to a huge amount of KASAN
    reports during early boot stages.

    The solution is to add -fno-builtin flag for files with KASAN_SANITIZE :=
    n marker.

    Link: http://lkml.kernel.org/r/8ffecfffe04088c52c42b92739c2bd8a0bcb3f5e.1516384594.git.andreyknvl@google.com
    Signed-off-by: Andrey Konovalov
    Acked-by: Nick Desaulniers
    Cc: Masahiro Yamada
    Cc: Michal Marek
    Cc: Andrey Ryabinin
    Cc: Alexander Potapenko
    Cc: Dmitry Vyukov
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrey Konovalov
     

02 Feb, 2018

1 commit

  • Pull Kconfig updates from Masahiro Yamada:
    "A pretty big batch of Kconfig updates.

    I have to mention the lexer and parser of Kconfig are now built from
    real .l and .y sources. So, flex and bison are the requirement for
    building the kernel. Both of them (unlike gperf) have been stable for
    a long time. This change has been tested several weeks in linux-next,
    and I did not receive any problem report about this.

    Summary:

    - add checks for mistakes, like the choice default is not in choice,
    help is doubled

    - document data structure and complex code

    - fix various memory leaks

    - change Makefile to build lexer and parser instead of using
    pre-generated C files

    - drop 'boolean' keyword, which is equivalent to 'bool'

    - use default 'yy' prefix and remove unneeded Make variables

    - fix gettext() check for xconfig

    - announce that oldnoconfig will be finally removed

    - make 'Selected by:' and 'Implied by' readable in help and search
    result

    - hide silentoldconfig from 'make help' to stop confusing people

    - fix misc things and cleanups"

    * tag 'kconfig-v4.16' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (37 commits)
    kconfig: Remove silentoldconfig from help and docs; fix kconfig/conf's help
    kconfig: make "Selected by:" and "Implied by:" readable
    kconfig: announce removal of oldnoconfig if used
    kconfig: fix make xconfig when gettext is missing
    kconfig: Clarify menu and 'if' dependency propagation
    kconfig: Document 'if' flattening logic
    kconfig: Clarify choice dependency propagation
    kconfig: Document SYMBOL_OPTIONAL logic
    kbuild: remove unnecessary LEX_PREFIX and YACC_PREFIX
    kconfig: use default 'yy' prefix for lexer and parser
    kconfig: make conf_unsaved a local variable of conf_read()
    kconfig: make xfgets() really static
    kconfig: make input_mode static
    kconfig: Warn if there is more than one help text
    kconfig: drop 'boolean' keyword
    kconfig: use bool instead of boolean for type definition attributes, again
    kconfig: Remove menu_end_entry()
    kconfig: Document important expression functions
    kconfig: Document automatic submenu creation code
    kconfig: Fix choice symbol expression leak
    ...

    Linus Torvalds
     

25 Jan, 2018

1 commit

  • Kbuild supports 3 levels of extra warnings, and multiple levels can
    be combined, like W=12, W=123. It was added by commit a6de553da01c
    ("kbuild: Allow to combine multiple W= levels").

    From the log of commit 8654cb8d0371 ("dtc: update warning settings
    for new bus and node/property name checks"), I assume:

    - unit_address_vs_reg, simple_bus_reg, etc. belong to level 1
    - node_name_chars_strict, property_name_chars_strict belong to level 2

    However, the level 1 warnings are displayed by any argument to W=.
    On the other hand, the level 2 warnings are displayed by W=2, but
    not by W=12, or W=123.

    Use $(findstring ...) like scripts/Makefile.extrawarn.

    Signed-off-by: Masahiro Yamada
    Acked-by: Arnd Bergmann

    Masahiro Yamada
     

21 Jan, 2018

1 commit


16 Dec, 2017

2 commits

  • In Linux build system convention, pre-generated files are version-
    controlled with a "_shipped" suffix. During the kernel building,
    they are simply shipped (copied) removing the suffix.

    This approach can reduce external tool dependency for the kernel build,
    but it is tedious to manually regenerate such artifacts from developers'
    point of view. (We need to do "make REGENERATE_PARSERS=1" every time
    we touch real source files such as *.l, *.y)

    Some months ago, I sent out RFC patches to run flex, bison, and gperf
    during the build.

    In the review and test, Linus noticed gperf-3.1 had changed the lookup
    function prototype. Then, the use of gperf in kernel was entirely
    removed by commit bb3290d91695 ("Remove gperf usage from toolchain").

    This time, I tested several versions of flex and bison, and I was not
    hit by any compatibility issue except a flaw in flex-2.6.3; if you
    generate lexer for dtc and genksyms with flex-2.6.3, you will see
    "yywrap redefined" warning. This was not intentional, but a bug,
    fixed by flex-2.6.4. Otherwise, both flex and bison look fairly
    stable for a long time.

    This commit prepares some build rules to remove the _shipped files.
    Also, document minimal requirement for flex and bison.

    Rationale for the minimal version:
    The -Wmissing-prototypes option of GCC warns "no previous prototype"
    for lexers generated by flex-2.5.34 or older, so I chose 2.5.35 as the
    required version for flex. Flex-2.5.35 was released in 2008. Bison
    looks more stable. I did not see any problem with bison-2.0, released
    in 2004. I did not test bison-1.x, but bison-2.0 should be old enough.

    Tested flex versions:
    2.5.35
    2.5.36
    2.5.37
    2.5.39
    2.6.0
    2.6.1
    2.6.2
    2.6.3 (*)
    2.6.4

    (*) flex-2.6.3 causes "yywrap redefined" warning

    Tested bison versions:
    2.0
    2.1
    2.2
    2.3
    2.4
    2.4.1
    2.5.1
    2.6
    2.6.1
    2.6.2
    2.6.3
    2.6.4
    2.6.5
    2.7
    2.7.1
    3.0
    3.0.1
    3.0.2
    3.0.3
    3.0.4

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     
  • Allow users to use their favorite lexer / parser generators.
    This is useful for me to test various flex and bison versions.

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     

23 Nov, 2017

1 commit


18 Nov, 2017

1 commit

  • Pull Kbuild updates from Masahiro Yamada:
    "One of the most remarkable improvements in this cycle is, Kbuild is
    now able to cache the result of shell commands. Some variables are
    expensive to compute, for example, $(call cc-option,...) invokes the
    compiler. It is not efficient to redo this computation every time,
    even when we are not actually building anything. Kbuild creates a
    hidden file ".cache.mk" that contains invoked shell commands and their
    results. The speed-up should be noticeable.

    Summary:

    - Fix arch build issues (hexagon, sh)

    - Clean up various Makefiles and scripts

    - Fix wrong usage of {CFLAGS,LDFLAGS}_MODULE in arch Makefiles

    - Cache variables that are expensive to compute

    - Improve cc-ldopton and ld-option for Clang

    - Optimize output directory creation"

    * tag 'kbuild-v4.15' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (30 commits)
    kbuild: move coccicheck help from scripts/Makefile.help to top Makefile
    sh: decompressor: add shipped files to .gitignore
    frv: .gitignore: ignore vmlinux.lds
    selinux: remove unnecessary assignment to subdir-
    kbuild: specify FORCE in Makefile.headersinst as .PHONY target
    kbuild: remove redundant mkdir from ./Kbuild
    kbuild: optimize object directory creation for incremental build
    kbuild: create object directories simpler and faster
    kbuild: filter-out PHONY targets from "targets"
    kbuild: remove redundant $(wildcard ...) for cmd_files calculation
    kbuild: create directory for make cache only when necessary
    sh: select KBUILD_DEFCONFIG depending on ARCH
    kbuild: fix linker feature test macros when cross compiling with Clang
    kbuild: shrink .cache.mk when it exceeds 1000 lines
    kbuild: do not call cc-option before KBUILD_CFLAGS initialization
    kbuild: Cache a few more calls to the compiler
    kbuild: Add a cache for generated variables
    kbuild: add forward declaration of default target to Makefile.asm-generic
    kbuild: remove KBUILD_SUBDIR_ASFLAGS and KBUILD_SUBDIR_CCFLAGS
    hexagon/kbuild: replace CFLAGS_MODULE with KBUILD_CFLAGS_MODULE
    ...

    Linus Torvalds
     

16 Nov, 2017

1 commit

  • For the out-of-tree build, scripts/Makefile.build creates output
    directories, but this operation is not efficient.

    scripts/Makefile.lib calculates obj-dirs as follows:

    obj-dirs := $(dir $(multi-objs) $(obj-y))

    Please notice $(sort ...) is not used here. Usually the result is
    as many "./" as objects here.

    For a lot of duplicated paths, the following command is invoked.

    _dummy := $(foreach d,$(obj-dirs), $(shell [ -d $(d) ] || mkdir -p $(d)))

    Then, the costly shell command is run over and over again.

    I see many points for optimization:

    [1] Use $(sort ...) to cut down duplicated paths before passing them
    to system call
    [2] Use single $(shell ...) instead of repeating it with $(foreach ...)
    This will reduce forking.
    [3] We can calculate obj-dirs more simply. Most of objects are already
    accumulated in $(targets). So, $(dir $(targets)) is fine and more
    comprehensive.

    I also removed ugly code in arch/x86/entry/vdso/Makefile. This is now
    really unnecessary.

    Signed-off-by: Masahiro Yamada
    Acked-by: Ingo Molnar
    Tested-by: Douglas Anderson

    Masahiro Yamada
     

15 Nov, 2017

1 commit

  • Pull DeviceTree updates from Rob Herring:
    "A bigger diffstat than usual with the kbuild changes and a tree wide
    fix in the binding documentation.

    Summary:

    - kbuild cleanups and improvements for dtbs

    - Code clean-up of overlay code and fixing for some long standing
    memory leak and race condition in applying overlays

    - Improvements to DT memory usage making sysfs/kobjects optional and
    skipping unflattening of disabled nodes. This is part of kernel
    tinification efforts.

    - Final piece of removing storing the full path for every DT node.
    The prerequisite conversion of printk's to use device_node format
    specifier happened in 4.14.

    - Sync with current upstream dtc. This brings additional checks to
    dtb compiling.

    - Binding doc tree wide removal of leading 0s from examples

    - RTC binding documentation adding missing devices and some
    consolidation of duplicated bindings

    - Vendor prefix documentation for nutsboard, Silicon Storage
    Technology, shimafuji, Tecon Microprocessor Technologies, DH
    electronics GmbH, Opal Kelly, and Next Thing"

    * tag 'devicetree-for-4.15' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: (55 commits)
    dt-bindings: usb: add #phy-cells to usb-nop-xceiv
    dt-bindings: Remove leading zeros from bindings notation
    kbuild: handle dtb-y and CONFIG_OF_ALL_DTBS natively in Makefile.lib
    MIPS: dts: remove bogus bcm96358nb4ser.dtb from dtb-y entry
    kbuild: clean up *.dtb and *.dtb.S patterns from top-level Makefile
    .gitignore: move *.dtb and *.dtb.S patterns to the top-level .gitignore
    .gitignore: sort normal pattern rules alphabetically
    dt-bindings: add vendor prefix for Next Thing Co.
    scripts/dtc: Update to upstream version v1.4.5-6-gc1e55a5513e9
    of: dynamic: fix memory leak related to properties of __of_node_dup
    of: overlay: make pr_err() string unique
    of: overlay: pr_err from return NOTIFY_OK to overlay apply/remove
    of: overlay: remove unneeded check for NULL kbasename()
    of: overlay: remove a dependency on device node full_name
    of: overlay: simplify applying symbols from an overlay
    of: overlay: avoid race condition between applying multiple overlays
    of: overlay: loosen overly strict phandle clash check
    of: overlay: expand check of whether overlay changeset can be removed
    of: overlay: detect cases where device tree may become corrupt
    of: overlay: minor restructuring
    ...

    Linus Torvalds
     

10 Nov, 2017

1 commit

  • If CONFIG_OF_ALL_DTBS is enabled, "make ARCH=arm64 dtbs" compiles each
    DTB twice; one from arch/arm64/boot/dts/*/Makefile and the other from
    the dtb-$(CONFIG_OF_ALL_DTBS) line in arch/arm64/boot/dts/Makefile.
    It could be a race problem when building DTBS in parallel.

    Another minor issue is CONFIG_OF_ALL_DTBS covers only *.dts in vendor
    sub-directories, so this broke when Broadcom added one more hierarchy
    in arch/arm64/boot/dts/broadcom//.

    One idea to fix the issues in a clean way is to move DTB handling
    to Kbuild core scripts. Makefile.dtbinst already recognizes dtb-y
    natively, so it should not hurt to do so.

    Add $(dtb-y) to extra-y, and $(dtb-) as well if CONFIG_OF_ALL_DTBS is
    enabled. All clutter things in Makefiles go away.

    As a bonus clean-up, I also removed dts-dirs. Just use subdir-y
    directly to traverse sub-directories.

    Signed-off-by: Masahiro Yamada
    Acked-by: Arnd Bergmann
    [robh: corrected BUILTIN_DTB to CONFIG_BUILTIN_DTB]
    Signed-off-by: Rob Herring

    Masahiro Yamada
     

02 Nov, 2017

1 commit

  • 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
    Reviewed-by: Philippe Ombredanne
    Reviewed-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

30 Oct, 2017

1 commit


26 Oct, 2017

1 commit


10 Sep, 2017

1 commit


22 Aug, 2017

3 commits

  • Since commit d5d332d3f7e8 ("devicetree: Move include prefixes from
    arch to separate directory"), cross-arch DT reference works well,
    but only for CPP style #include directives.

    It makes as much sense to share DT between different architectures
    by using DTC's /include/ directives.

    So, scripts/dtc/include-prefixes should be passed to both CPP and DTC.
    I refactored Makefile.lib a bit to not repeat the same path.

    Signed-off-by: Masahiro Yamada
    Signed-off-by: Rob Herring

    Masahiro Yamada
     
  • Having arch/$(SRCARCH)/boot/dts as an include search path is not
    very useful these days because some architectures such as ARM64,
    MIPS have no DT in this directory. Instead, they have DT in vendor
    sub-directories.

    With some DT files in ARM and PowerPC fixed, we can now drop this
    include search path.

    Signed-off-by: Masahiro Yamada
    Signed-off-by: Rob Herring

    Masahiro Yamada
     
  • This search path was added by commit b5190516b282 ("of: Move testcase
    FDT data into drivers/of"). At that time, it was needed for platform
    DT files to include testcase data.

    It became unnecessary when commit ae9304c9d311 ("Adding selftest
    testdata dynamically into live tree") introduced dynamic addition of
    testcase data, but it missed to delete this search path.

    Moreover, the directory drivers/of/testcase-data does not exist since
    commit 19fd74879a32 ("of/unittest: Rename selftest.c to unittest.c").

    Signed-off-by: Masahiro Yamada
    Signed-off-by: Rob Herring

    Masahiro Yamada