13 Feb, 2018

1 commit

  • commit 10b62a2f785ab55857380f0c63d9fa468fd8c676 upstream.

    Most of DT files are compiled under arch/*/boot/dts/, but we have some
    other directories, like drivers/of/unittest-data/. We often miss to
    add gitignore patterns per directory. Since there are no source files
    that end with .dtb or .dtb.S, we can ignore the patterns globally.

    Signed-off-by: Masahiro Yamada
    Signed-off-by: Rob Herring
    Signed-off-by: Greg Kroah-Hartman

    Masahiro Yamada
     

02 Nov, 2017

2 commits

  • Many user space API headers have licensing information, which is either
    incomplete, badly formatted or just a shorthand for referring to the
    license under which the file is supposed to be. This makes it hard for
    compliance tools to determine the correct license.

    Update these files with an SPDX license identifier. The identifier was
    chosen based on the license information in the file.

    GPL/LGPL licensed headers get the matching GPL/LGPL SPDX license
    identifier with the added 'WITH Linux-syscall-note' exception, which is
    the officially assigned exception identifier for the kernel syscall
    exception:

    NOTE! This copyright does *not* cover user programs that use kernel
    services by normal system calls - this is merely considered normal use
    of the kernel, and does *not* fall under the heading of "derived work".

    This exception makes it possible to include GPL headers into non GPL
    code, without confusing license compliance tools.

    Headers which have either explicit dual licensing or are just licensed
    under a non GPL license are updated with the corresponding SPDX
    identifier and the GPLv2 with syscall exception identifier. The format
    is:
    ((GPL-2.0 WITH Linux-syscall-note) OR SPDX-ID-OF-OTHER-LICENSE)

    SPDX license identifiers are a legally binding shorthand, which can be
    used instead of the full boiler plate text. The update does not remove
    existing license information as this has to be done on a case by case
    basis and the copyright holders might have to be consulted. This will
    happen in a separate step.

    This patch is based on work done by Thomas Gleixner and Kate Stewart and
    Philippe Ombredanne. See the previous patch in this series for the
    methodology of how this patch was researched.

    Reviewed-by: Kate Stewart
    Reviewed-by: Philippe Ombredanne
    Reviewed-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

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

    Greg Kroah-Hartman
     

16 Sep, 2017

1 commit


15 Sep, 2017

2 commits

  • Mainline crashes as follows when running nios2 images.

    On node 0 totalpages: 65536
    free_area_init_node: node 0, pgdat c8408fa0, node_mem_map c8726000
    Normal zone: 512 pages used for memmap
    Normal zone: 0 pages reserved
    Normal zone: 65536 pages, LIFO batch:15
    Unable to handle kernel NULL pointer dereference at virtual address 00000000
    ea = c8003cb0, ra = c81cbf40, cause = 15
    Kernel panic - not syncing: Oops

    Problem is seen because get_cycles() is called before the timer it depends
    on is initialized. Returning 0 in that situation fixes the problem.

    Fixes: 33d72f3822d7 ("init/main.c: extract early boot entropy from the ..")
    Cc: Laura Abbott
    Cc: Kees Cook
    Cc: Daniel Micay
    Signed-off-by: Guenter Roeck

    Guenter Roeck
     
  • Allow earlycon to be used on the JTAG UART present in the 3c120 GHRD.

    Signed-off-by: Tobias Klauser

    Tobias Klauser
     

29 Aug, 2017

1 commit


11 Jul, 2017

2 commits

  • Since commit fcc8487d477a ("uapi: export all headers under uapi
    directories"), all (and only) headers under uapi directories are
    exported, but asm-generic wrappers are still exceptions.

    To complete de-coupling the uapi from kernel headers, move generic-y
    of exported headers to uapi/asm/Kbuild.

    With this change, "make headers_install" will just need to parse
    uapi/asm/Kbuild to build up exported headers.

    Also, move "generic-y += kprobes.h" up in order to keep the entries
    sorted.

    Signed-off-by: Masahiro Yamada
    Reviewed-by: Tobias Klauser

    Masahiro Yamada
     
  • Currently, NIOS2 has three signal.h files under arch/nios2/include:

    [1] arch/nios2/include/asm/signal.h
    [2] arch/nios2/include/uapi/asm/signal.h
    [3] arch/nios2/include/generated/asm/signal.h

    [3] is build-time generated by scripts/Makefile.asm-generic.
    However, -I$(srctree)/arch/$(hdr-arch)/include search path is listed
    before -I$(objtree)/arch/$(hdr-arch)/include/generated in LINUXINCLUDE.
    Therefore [1] is always included instead of [3]. Remove [3] which
    is never included.

    If we look at [1], it just includes [2]. So, [1] can be removed
    as well.

    Signed-off-by: Masahiro Yamada
    Reviewed-by: Tobias Klauser

    Masahiro Yamada
     

04 Jul, 2017

1 commit

  • Pull timer updates from Thomas Gleixner:
    "A rather large update for timers/timekeeping:

    - compat syscall consolidation (Al Viro)

    - Posix timer consolidation (Christoph Helwig / Thomas Gleixner)

    - Cleanup of the device tree based initialization for clockevents and
    clocksources (Daniel Lezcano)

    - Consolidation of the FTTMR010 clocksource/event driver (Linus
    Walleij)

    - The usual set of small fixes and updates all over the place"

    * 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (93 commits)
    timers: Make the cpu base lock raw
    clocksource/drivers/mips-gic-timer: Fix an error code in 'gic_clocksource_of_init()'
    clocksource/drivers/fsl_ftm_timer: Unmap region obtained by of_iomap
    clocksource/drivers/tcb_clksrc: Make IO endian agnostic
    clocksource/drivers/sun4i: Switch to the timer-of common init
    clocksource/drivers/timer-of: Fix invalid iomap check
    Revert "ktime: Simplify ktime_compare implementation"
    clocksource/drivers: Fix uninitialized variable use in timer_of_init
    kselftests: timers: Add test for frequency step
    kselftests: timers: Fix inconsistency-check to not ignore first timestamp
    time: Add warning about imminent deprecation of CONFIG_GENERIC_TIME_VSYSCALL_OLD
    time: Clean up CLOCK_MONOTONIC_RAW time handling
    posix-cpu-timers: Make timespec to nsec conversion safe
    itimer: Make timeval to nsec conversion range limited
    timers: Fix parameter description of try_to_del_timer_sync()
    ktime: Simplify ktime_compare implementation
    clocksource/drivers/fttmr010: Factor out clock read code
    clocksource/drivers/fttmr010: Implement delay timer
    clocksource/drivers: Add timer-of common init routine
    clocksource/drivers/tcb_clksrc: Save timer context on suspend/resume
    ...

    Linus Torvalds
     

29 Jun, 2017

1 commit

  • The only user of thread_saved_pc() in non-arch-specific code was removed
    in commit 8243d5597793 ("sched/core: Remove pointless printout in
    sched_show_task()"). Remove the implementations as well.

    Some architectures use thread_saved_pc() in their arch-specific code.
    Leave their thread_saved_pc() intact.

    Signed-off-by: Tobias Klauser
    Acked-by: Geert Uytterhoeven
    Cc: Ingo Molnar
    Signed-off-by: Linus Torvalds

    Tobias Klauser
     

14 Jun, 2017

3 commits

  • The config option name is now renamed to 'TIMER_OF' for consistency with
    the CLOCKSOURCE_OF_DECLARE => TIMER_OF_DECLARE change.

    Signed-off-by: Daniel Lezcano
    Reviewed-by: Linus Walleij

    Daniel Lezcano
     
  • The function name is now renamed to 'timer_probe' for consistency with
    the CLOCKSOURCE_OF_DECLARE => TIMER_OF_DECLARE change.

    Signed-off-by: Daniel Lezcano
    Acked-by: Viresh Kumar
    Acked-by: Heiko Stuebner
    Reviewed-by: Linus Walleij

    Daniel Lezcano
     
  • The CLOCKSOURCE_OF_DECLARE macro is used widely for the timers to declare the
    clocksource at early stage. However, this macro is also used to initialize
    the clockevent if any, or the clockevent only.

    It was originally suggested to declare another macro to initialize a
    clockevent, so in order to separate the two entities even they belong to the
    same IP. This was not accepted because of the impact on the DT where splitting
    a clocksource/clockevent definition does not make sense as it is a Linux
    concept not a hardware description.

    On the other side, the clocksource has not interrupt declared while the
    clockevent has, so it is easy from the driver to know if the description is
    for a clockevent or a clocksource, IOW it could be implemented at the driver
    level.

    So instead of dealing with a named clocksource macro, let's use a more generic
    one: TIMER_OF_DECLARE.

    The patch has not functional changes.

    Signed-off-by: Daniel Lezcano
    Acked-by: Heiko Stuebner
    Acked-by: Neil Armstrong
    Acked-by: Arnd Bergmann
    Acked-by: Matthias Brugger
    Reviewed-by: Linus Walleij

    Daniel Lezcano
     

04 Jun, 2017

1 commit

  • By moving the kernel side __SI_* defintions right next to the userspace
    ones we can kill the non-uapi versions of include
    include/asm-generic/siginfo.h and untangle the unholy mess of includes.

    [ tglx: Removed uapi/asm/siginfo.h from m32r, microblaze, mn10300 and score ]

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Thomas Gleixner
    Cc: linux-arch@vger.kernel.org
    Cc: Fenghua Yu
    Cc: Tony Luck
    Cc: linux-ia64@vger.kernel.org
    Cc: Arnd Bergmann
    Cc: sparclinux@vger.kernel.org
    Cc: "David S. Miller"
    Link: http://lkml.kernel.org/r/20170603190102.28866-6-hch@lst.de

    Christoph Hellwig
     

13 May, 2017

1 commit

  • Pull nios2 updates from Ley Foon Tan:
    "nios2 fixes/enhancements and adding nios2 R2 support"

    * tag 'nios2-v4.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/lftan/nios2:
    nios2: remove custom early console implementation
    nios2: use generic strncpy_from_user() and strnlen_user()
    nios2: Add CDX support
    nios2: Add BMX support
    nios2: Add NIOS2_ARCH_REVISION to select between R1 and R2
    nios2: implement flush_dcache_mmap_lock/unlock
    nios2: enable earlycon support
    nios2: constify irq_domain_ops
    nios2: remove wrapper header for cmpxchg.h
    nios2: add .gitignore entries for auto-generated files

    Linus Torvalds
     

11 May, 2017

1 commit

  • As of commits d8f347ba35cf ("nios2: enable earlycon support"),
    0dcc0542a006 ("serial: altera_jtaguart: add earlycon support") and
    4d9d7d896d77 ("serial: altera_uart: add earlycon support"), the nios2
    architecture and the altera_uart/altera_jtaguart drivers support
    earlycon. Thus, the custom early console implementation for nios2 is no
    longer necessary to get early boot messages. Remove it and rely fully on
    earlycon support.

    Signed-off-by: Tobias Klauser

    Tobias Klauser
     

10 May, 2017

2 commits

  • Regularly, when a new header is created in include/uapi/, the developer
    forgets to add it in the corresponding Kbuild file. This error is usually
    detected after the release is out.

    In fact, all headers under uapi directories should be exported, thus it's
    useless to have an exhaustive list.

    After this patch, the following files, which were not exported, are now
    exported (with make headers_install_all):
    asm-arc/kvm_para.h
    asm-arc/ucontext.h
    asm-blackfin/shmparam.h
    asm-blackfin/ucontext.h
    asm-c6x/shmparam.h
    asm-c6x/ucontext.h
    asm-cris/kvm_para.h
    asm-h8300/shmparam.h
    asm-h8300/ucontext.h
    asm-hexagon/shmparam.h
    asm-m32r/kvm_para.h
    asm-m68k/kvm_para.h
    asm-m68k/shmparam.h
    asm-metag/kvm_para.h
    asm-metag/shmparam.h
    asm-metag/ucontext.h
    asm-mips/hwcap.h
    asm-mips/reg.h
    asm-mips/ucontext.h
    asm-nios2/kvm_para.h
    asm-nios2/ucontext.h
    asm-openrisc/shmparam.h
    asm-parisc/kvm_para.h
    asm-powerpc/perf_regs.h
    asm-sh/kvm_para.h
    asm-sh/ucontext.h
    asm-tile/shmparam.h
    asm-unicore32/shmparam.h
    asm-unicore32/ucontext.h
    asm-x86/hwcap2.h
    asm-xtensa/kvm_para.h
    drm/armada_drm.h
    drm/etnaviv_drm.h
    drm/vgem_drm.h
    linux/aspeed-lpc-ctrl.h
    linux/auto_dev-ioctl.h
    linux/bcache.h
    linux/btrfs_tree.h
    linux/can/vxcan.h
    linux/cifs/cifs_mount.h
    linux/coresight-stm.h
    linux/cryptouser.h
    linux/fsmap.h
    linux/genwqe/genwqe_card.h
    linux/hash_info.h
    linux/kcm.h
    linux/kcov.h
    linux/kfd_ioctl.h
    linux/lightnvm.h
    linux/module.h
    linux/nbd-netlink.h
    linux/nilfs2_api.h
    linux/nilfs2_ondisk.h
    linux/nsfs.h
    linux/pr.h
    linux/qrtr.h
    linux/rpmsg.h
    linux/sched/types.h
    linux/sed-opal.h
    linux/smc.h
    linux/smc_diag.h
    linux/stm.h
    linux/switchtec_ioctl.h
    linux/vfio_ccw.h
    linux/wil6210_uapi.h
    rdma/bnxt_re-abi.h

    Note that I have removed from this list the files which are generated in every
    exported directories (like .install or .install.cmd).

    Thanks to Julien Floret for the tip to get all
    subdirs with a pure makefile command.

    For the record, note that exported files for asm directories are a mix of
    files listed by:
    - include/uapi/asm-generic/Kbuild.asm;
    - arch//include/uapi/asm/Kbuild;
    - arch//include/asm/Kbuild.

    Signed-off-by: Nicolas Dichtel
    Acked-by: Daniel Vetter
    Acked-by: Russell King
    Acked-by: Mark Salter
    Acked-by: Michael Ellerman (powerpc)
    Signed-off-by: Masahiro Yamada

    Nicolas Dichtel
     
  • This header file is exported, but from a userland pov, it's just a wrapper
    to asm-generic/setup.h.

    Signed-off-by: Nicolas Dichtel
    Reviewed-by: Tobias Klauser
    Signed-off-by: Masahiro Yamada

    Nicolas Dichtel
     

08 May, 2017

9 commits

  • This change enables the generic strncpy_from_user() and strnlen_user()

    Signed-off-by: Ley Foon Tan

    Ley Foon Tan
     
  • Add support for the CDX Code Density Extensions present in
    Nios II R2 . This introduces new 16bit instruction set to
    improve code density while retaining support for the 32bit
    Nios II R2 instructions.

    Signed-off-by: Marek Vasut
    Cc: Ley Foon Tan

    Marek Vasut
     
  • Add support for the BMX Bit Manipulation Extensions present in
    Nios II R2 . This introduces three new instructions, EXTRACT,
    INSERT and MERGE.

    Signed-off-by: Marek Vasut
    Cc: Ley Foon Tan

    Marek Vasut
     
  • Allow user to select between Nios2 R1 and R2. Since R1 and R2 are
    not binary compatible, we cannot have a single kernel binary and
    there is no point in having DT property for discerning these two.

    Signed-off-by: Marek Vasut
    Cc: Ley Foon Tan

    Marek Vasut
     
  • Use spin_lock/unlock_irq instead of doing nothing. This fixes corruptions
    of the vma_interval_tree causing the kernel to be stuck in an
    infinite loop in vma_interval_tree_foreach.

    Signed-off-by: Julien Beraud
    Acked-by: Ley Foon Tan

    Julien Beraud
     
  • Enable generic earlycon support for nios2. This e.g. allows to use a
    8250/16650 UART as earlycon.

    In order to get the earlycon, we just need to call parse_early_param()
    in early_init_devtree() as soon as the device tree is initially scanned.
    By adding an stdout-path property to the dts (done in this patch for
    10m50_devboard), the earlycon can be used.

    In order to provide early printk support, we need to provide a dummy
    implementation of early_console_write(), so that
    arch/nios2/kernel/early_printk.c can still be compiled if neither
    SERIAL_ALTERA_JTAGUART_CONSOLE nor SERIAL_ALTERA_UART_CONSOLE is
    selected. As soon as the altera_uart and altera_jtaguart support
    earlycon, the entire file can be removed.

    Tested-by: Guenter Roeck
    Signed-off-by: Tobias Klauser
    Acked-by: Ley Foon Tan

    Tobias Klauser
     
  • struct irq_domain_ops is not modified, so it can be made const.

    Signed-off-by: Tobias Klauser
    Acked-by: Ley Foon Tan

    Tobias Klauser
     
  • Since commit 713e9b802e21 ("nios2: Switch to generic __xchg()")
    asm/cmpxchg.h for nios2 is merely including asm-generic/cmpxchg.h. Thus,
    the wrapper can be omitted and the generic header can be used directly.

    Signed-off-by: Tobias Klauser
    Acked-by: Ley Foon Tan

    Tobias Klauser
     
  • Add .gitignore entries for nios2 specific files generated during the
    build process.

    Signed-off-by: Tobias Klauser
    Acked-by: Ley Foon Tan

    Tobias Klauser
     

02 May, 2017

1 commit

  • Pull uaccess unification updates from Al Viro:
    "This is the uaccess unification pile. It's _not_ the end of uaccess
    work, but the next batch of that will go into the next cycle. This one
    mostly takes copy_from_user() and friends out of arch/* and gets the
    zero-padding behaviour in sync for all architectures.

    Dealing with the nocache/writethrough mess is for the next cycle;
    fortunately, that's x86-only. Same for cleanups in iov_iter.c (I am
    sold on access_ok() in there, BTW; just not in this pile), same for
    reducing __copy_... callsites, strn*... stuff, etc. - there will be a
    pile about as large as this one in the next merge window.

    This one sat in -next for weeks. -3KLoC"

    * 'work.uaccess' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (96 commits)
    HAVE_ARCH_HARDENED_USERCOPY is unconditional now
    CONFIG_ARCH_HAS_RAW_COPY_USER is unconditional now
    m32r: switch to RAW_COPY_USER
    hexagon: switch to RAW_COPY_USER
    microblaze: switch to RAW_COPY_USER
    get rid of padding, switch to RAW_COPY_USER
    ia64: get rid of copy_in_user()
    ia64: sanitize __access_ok()
    ia64: get rid of 'segment' argument of __do_{get,put}_user()
    ia64: get rid of 'segment' argument of __{get,put}_user_check()
    ia64: add extable.h
    powerpc: get rid of zeroing, switch to RAW_COPY_USER
    esas2r: don't open-code memdup_user()
    alpha: fix stack smashing in old_adjtimex(2)
    don't open-code kernel_setsockopt()
    mips: switch to RAW_COPY_USER
    mips: get rid of tail-zeroing in primitives
    mips: make copy_from_user() zero tail explicitly
    mips: clean and reorder the forest of macros...
    mips: consolidate __invoke_... wrappers
    ...

    Linus Torvalds
     

27 Apr, 2017

2 commits


03 Apr, 2017

1 commit

  • Make sure to reserve the boot memory for the flattened device tree.
    Otherwise it might get overwritten, e.g. when initial_boot_params is
    copied, leading to a corrupted FDT and a boot hang/crash:

    bootconsole [early0] enabled
    Early console on uart16650 initialized at 0xf8001600
    OF: fdt: Error -11 processing FDT
    Kernel panic - not syncing: setup_cpuinfo: No CPU found in devicetree!

    ---[ end Kernel panic - not syncing: setup_cpuinfo: No CPU found in devicetree!

    Guenter Roeck says:

    > I think I found the problem. In unflatten_and_copy_device_tree(), with added
    > debug information:
    >
    > OF: fdt: initial_boot_params=c861e400, dt=c861f000 size=28874 (0x70ca)
    >
    > ... and then initial_boot_params is copied to dt, which results in corrupted
    > fdt since the memory overlaps. Looks like the initial_boot_params memory
    > is not reserved and (re-)allocated by early_init_dt_alloc_memory_arch().

    Cc: stable@vger.kernel.org
    Reported-by: Guenter Roeck
    Reference: http://lkml.kernel.org/r/20170226210338.GA19476@roeck-us.net
    Tested-by: Guenter Roeck
    Signed-off-by: Tobias Klauser
    Acked-by: Ley Foon Tan

    Tobias Klauser
     

02 Apr, 2017

1 commit


29 Mar, 2017

2 commits


10 Mar, 2017

1 commit

  • If an architecture uses 4level-fixup.h we don't need to do anything as
    it includes 5level-fixup.h.

    If an architecture uses pgtable-nop*d.h, define __ARCH_USE_5LEVEL_HACK
    before inclusion of the header. It makes asm-generic code to use
    5level-fixup.h.

    If an architecture has 4-level paging or folds levels on its own,
    include 5level-fixup.h directly.

    Signed-off-by: Kirill A. Shutemov
    Acked-by: Michal Hocko
    Signed-off-by: Linus Torvalds

    Kirill A. Shutemov
     

06 Mar, 2017

2 commits


02 Mar, 2017

2 commits