26 May, 2016

1 commit

  • Pull watchdog updates from Wim Van Sebroeck:

    - add support for Fintek F81865 Super-IO chip

    - add support for watchdogs (RWDT and SWDT) found on RCar Gen3 based
    SoCs from Renesas

    - octeon: Handle the FROZEN hot plug notifier actions

    - f71808e_wdt fixes and cleanups

    - some small improvements in code and documentation

    * git://www.linux-watchdog.org/linux-watchdog:
    MAINTAINERS: Add file patterns for watchdog device tree bindings
    Documentation: Add ebc-c384_wdt watchdog-parameters.txt entry
    watchdog: shwdt: Use setup_timer()
    watchdog: cpwd: Use setup_timer()
    arm64: defconfig: enable Renesas Watchdog Timer
    watchdog: renesas-wdt: add driver
    watchdog: remove error message when unable to allocate watchdog device
    watchdog: f71808e_wdt: Fix WDTMOUT_STS register read
    watchdog: f71808e_wdt: Fix typo
    watchdog: f71808e_wdt: Add F81865 support
    watchdog: sp5100_tco: properly check for new register layouts
    watchdog: core: Fix circular locking dependency
    watchdog: core: fix trivial typo in a comment
    watchdog: hpwdt: Adjust documentation to match latest kernel module parameters.
    watchdog: imx2_wdt: add external reset support via dt prop
    watchdog: octeon: Handle the FROZEN hot plug notifier actions.
    watchdog: qcom: Report reboot reason

    Linus Torvalds
     

21 May, 2016

1 commit

  • Pull driver core updates from Greg KH:
    "Here's the "big" driver core update for 4.7-rc1.

    Mostly just debugfs changes, the long-known and messy races with
    removing debugfs files should be fixed thanks to the great work of
    Nicolai Stange. We also have some isa updates in here (the x86
    maintainers told me to take it through this tree), a new warning when
    we run out of dynamic char major numbers, and a few other assorted
    changes, details in the shortlog.

    All have been in linux-next for some time with no reported issues"

    * tag 'driver-core-4.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (32 commits)
    Revert "base: dd: don't remove driver_data in -EPROBE_DEFER case"
    gpio: ws16c48: Utilize the ISA bus driver
    gpio: 104-idio-16: Utilize the ISA bus driver
    gpio: 104-idi-48: Utilize the ISA bus driver
    gpio: 104-dio-48e: Utilize the ISA bus driver
    watchdog: ebc-c384_wdt: Utilize the ISA bus driver
    iio: stx104: Utilize the module_isa_driver and max_num_isa_dev macros
    iio: stx104: Add X86 dependency to STX104 Kconfig option
    Documentation: Add ISA bus driver documentation
    isa: Implement the max_num_isa_dev macro
    isa: Implement the module_isa_driver macro
    pnp: pnpbios: Add explicit X86_32 dependency to PNPBIOS
    isa: Decouple X86_32 dependency from the ISA Kconfig option
    driver-core: use 'dev' argument in dev_dbg_ratelimited stub
    base: dd: don't remove driver_data in -EPROBE_DEFER case
    kernfs: Move faulting copy_user operations outside of the mutex
    devcoredump: add scatterlist support
    debugfs: unproxify files created through debugfs_create_u32_array()
    debugfs: unproxify files created through debugfs_create_blob()
    debugfs: unproxify files created through debugfs_create_bool()
    ...

    Linus Torvalds
     

20 May, 2016

1 commit

  • Pull MIPS updates from Ralf Baechle:
    "This is the main pull request for MIPS for 4.7. Here's the summary of
    the changes:

    - ATH79: Support for DTB passuing using the UHI boot protocol
    - ATH79: Remove support for builtin DTB.
    - ATH79: Add zboot debug serial support.
    - ATH79: Add initial support for Dragino MS14 (Dragine 2), Onion Omega
    and DPT-Module.
    - ATH79: Update devicetree clock support for AR9132 and AR9331.
    - ATH79: Cleanup the DT code.
    - ATH79: Support newer SOCs in ath79_ddr_ctrl_init.
    - ATH79: Fix regression in PCI window initialization.
    - BCM47xx: Move SPROM driver to drivers/firmware/
    - BCM63xx: Enable partition parser in defconfig.
    - BMIPS: BMIPS5000 has I cache filing from D cache
    - BMIPS: BMIPS: Add cpu-feature-overrides.h
    - BMIPS: Add Whirlwind support
    - BMIPS: Adjust mips-hpt-frequency for BCM7435
    - BMIPS: Remove maxcpus from BCM97435SVMB DTS
    - BMIPS: Add missing 7038 L1 register cells to BCM7435
    - BMIPS: Various tweaks to initialization code.
    - BMIPS: Enable partition parser in defconfig.
    - BMIPS: Cache tweaks.
    - BMIPS: Add UART, I2C and SATA devices to DT.
    - BMIPS: Add BCM6358 and BCM63268support
    - BMIPS: Add device tree example for BCM6358.
    - BMIPS: Improve Improve BCM6328 and BCM6368 device trees
    - Lantiq: Add support for device tree file from boot loader
    - Lantiq: Allow build with no built-in DT.
    - Loongson 3: Reserve 32MB for RS780E integrated GPU.
    - Loongson 3: Fix build error after ld-version.sh modification
    - Loongson 3: Move chipset ACPI code from drivers to arch.
    - Loongson 3: Speedup irq processing.
    - Loongson 3: Add basic Loongson 3A support.
    - Loongson 3: Set cache flush handlers to nop.
    - Loongson 3: Invalidate special TLBs when needed.
    - Loongson 3: Fast TLB refill handler.
    - MT7620: Fallback strategy for invalid syscfg0.
    - Netlogic: Fix CP0_EBASE redefinition warnings
    - Octeon: Initialization fixes
    - Octeon: Add DTS files for the D-Link DSR-1000N and EdgeRouter Lite
    - Octeon: Enable add Octeon-drivers in cavium_octeon_defconfig
    - Octeon: Correctly handle endian-swapped initramfs images.
    - Octeon: Support CN73xx, CN75xx and CN78xx.
    - Octeon: Remove dead code from cvmx-sysinfo.
    - Octeon: Extend number of supported CPUs past 32.
    - Octeon: Remove some code limiting NR_IRQS to 255.
    - Octeon: Simplify octeon_irq_ciu_gpio_set_type.
    - Octeon: Mark some functions __init in smp.c
    - Octeon: Octeon: Add Octeon III CN7xxx interface detection
    - PIC32: Add serial driver and bindings for it.
    - PIC32: Add PIC32 deadman timer driver and bindings.
    - PIC32: Add PIC32 clock timer driver and bindings.
    - Pistachio: Determine SoC revision during boot
    - Sibyte: Fix Kconfig dependencies of SIBYTE_BUS_WATCHER.
    - Sibyte: Strip redundant comments from bcm1480_regs.h.
    - Panic immediately if panic_on_oops is set.
    - module: fix incorrect IS_ERR_VALUE macro usage.
    - module: Make consistent use of pr_*
    - Remove no longer needed work_on_cpu() call.
    - Remove CONFIG_IPV6_PRIVACY from defconfigs.
    - Fix registers of non-crashing CPUs in dumps.
    - Handle MIPSisms in new vmcore_elf32_check_arch.
    - Select CONFIG_HANDLE_DOMAIN_IRQ and make it work.
    - Allow RIXI to be used on non-R2 or R6 cores.
    - Reserve nosave data for hibernation
    - Fix siginfo.h to use strict POSIX types.
    - Don't unwind user mode with EVA.
    - Fix watchpoint restoration
    - Ptrace watchpoints for R6.
    - Sync icache when it fills from dcache
    - I6400 I-cache fills from dcache.
    - Various MSA fixes.
    - Cleanup MIPS_CPU_* definitions.
    - Signal: Move generic copy_siginfo to signal.h
    - Signal: Fix uapi include in exported asm/siginfo.h
    - Timer fixes for sake of KVM.
    - XPA TLB refill fixes.
    - Treat perf counter feature
    - Update John Crispin's email address
    - Add PIC32 watchdog and bindings.
    - Handle R10000 LL/SC bug in set_pte()
    - cpufreq: Various fixes for Longson1.
    - R6: Fix R2 emulation.
    - mathemu: Cosmetic fix to ADDIUPC emulation, plenty of other small fixes
    - ELF: ABI and FP fixes.
    - Allow for relocatable kernel and use that to support KASLR.
    - Fix CPC_BASE_ADDR mask
    - Plenty fo smp-cps, CM, R6 and M6250 fixes.
    - Make reset_control_ops const.
    - Fix kernel command line handling of leading whitespace.
    - Cleanups to cache handling.
    - Add brcm, bcm6345-l1-intc device tree bindings.
    - Use generic clkdev.h header
    - Remove CLK_IS_ROOT usage.
    - Misc small cleanups.
    - CM: Fix compilation error when !MIPS_CM
    - oprofile: Fix a preemption issue
    - Detect DSP ASE v3 support:1"

    * 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus: (275 commits)
    MIPS: pic32mzda: fix getting timer clock rate.
    MIPS: ath79: fix regression in PCI window initialization
    MIPS: ath79: make ath79_ddr_ctrl_init() compatible for newer SoCs
    MIPS: Fix VZ probe gas errors with binutils of MSA context in non-MSA kernels
    MIPS: cevt-r4k: Dynamically calculate min_delta_ns
    MIPS: malta-time: Take seconds into account
    MIPS: malta-time: Start GIC count before syncing to RTC
    MIPS: Force CPUs to lose FP context during mode switches
    ...

    Linus Torvalds
     

15 May, 2016

3 commits

  • The function setup_timer combines the initialization of a timer with
    the initialization of the timer's function and data fields.
    The multiline code for timer initialization is now replaced
    with function setup_timer.

    Signed-off-by: Muhammad Falak R Wani
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Muhammad Falak R Wani
     
  • The function setup_timer combines the initialization of a timer with
    the initialization of the timer's function and data fields.
    The multiline code for timer initialization is now replaced
    with function setup_timer.

    Signed-off-by: Muhammad Falak R Wani
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Muhammad Falak R Wani
     
  • Add support for watchdogs (RWDT and SWDT) found on RCar Gen3 based SoCs
    from Renesas.

    Signed-off-by: Wolfram Sang
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Wolfram Sang
     

14 May, 2016

10 commits

  • The dev_err message is superfluous because the failure is already
    printed by dev_kzalloc, so remove it.

    Signed-off-by: Colin Ian King
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Colin Ian King
     
  • Tested and verified on Lanner LEC-3030 Industrial PC (with F81865)

    Datasheet verified for
    F71808, F71858, F71862, F71869, F71869A, F71882, F71889, F81865

    Datasheet references:
    F71808A:
    http://www.electronicsdatasheets.com/download/534cf560e34e2406135f4658.pdf?format=pdf
    F71858:
    http://www.electronicsdatasheets.com/download/534cf55fe34e2406135f4635.pdf?format=pdf
    F71862:
    http://www.hardwaresecrets.com/datasheets/F71862_V027P.pdf
    F71869:
    http://www.clubedohardware.com.br/datasheets/366451_F71869.pdf
    F71869A:
    http://www.chipset-ic.com/datasheet/F71869AD.pdf
    F71882:
    http://www.digchip.com/datasheets/parts/datasheet/931/F71882-pdf.php
    F71889:
    http://pdf1.alldatasheet.com/datasheet-pdf/view/406312/FINTEK/F71889.html
    F81865:
    http://www.hardwaresecrets.com/datasheets/F81865_V028P.pdf
    http://www.alldatasheet.com/datasheet-pdf/pdf/406317/FINTEK/F81865.html

    Signed-off-by: Knud Poulsen
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Knud Poulsen
     
  • Spelling/ typo

    Signed-off-by: Knud Poulsen
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Knud Poulsen
     
  • Adds watchdog enable support for Fintek F81865 Super-IO chip to
    Fintek wdt driver (f71808e_wdt)

    Tested and verified on Lanner LEC-3030 Industrial PC

    Datasheet references:
    http://www.hardwaresecrets.com/datasheets/F81865_V028P.pdf
    http://www.alldatasheet.com/datasheet-pdf/pdf/406317/FINTEK/F81865.html

    Signed-off-by: Knud Poulsen
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Knud Poulsen
     
  • Commits 190aa4304de6 (Add AMD Mullins platform support) and
    cca118fa2a0a94 (Add AMD Carrizo platform support) enabled the
    driver on a lot more devices, but the following commit missed
    a single location in the code when checking if the SB800 register
    offsets should be used. This leads to the wrong register being
    written which in turn causes ACPI to go haywire.

    Fix this by introducing a helper function to check for the new
    register layout and use this consistently.

    https://bugzilla.kernel.org/show_bug.cgi?id=114201
    https://bugzilla.redhat.com/show_bug.cgi?id=1329910
    Fixes: bdecfcdb5461 (sp5100_tco: fix the device check for SB800
    and later chipsets)
    Cc: stable@vger.kernel.org (4.5+)
    Signed-off-by: Lucas Stach
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Lucas Stach
     
  • lockdep reports the following circular locking dependency.

    ======================================================
    INFO: possible circular locking dependency detected ]
    4.6.0-rc3-00191-gfabf418 #162 Not tainted
    -------------------------------------------------------
    systemd/1 is trying to acquire lock:
    ((&(&wd_data->work)->work)){+.+...}, at: [] flush_work+0x0/0x280

    but task is already holding lock:

    (&wd_data->lock){+.+...}, at: [] watchdog_release+0x18/0x190

    which lock already depends on the new lock.
    the existing dependency chain (in reverse order) is:

    -> #1 (&wd_data->lock){+.+...}:
    [] mutex_lock_nested+0x64/0x4a8
    [] watchdog_ping_work+0x18/0x4c
    [] process_one_work+0x1ac/0x500
    [] worker_thread+0x38/0x554
    [] kthread+0xf4/0x108
    [] ret_from_fork+0x14/0x24

    -> #0 ((&(&wd_data->work)->work)){+.+...}:
    [] lock_acquire+0x70/0x90
    [] flush_work+0x4c/0x280
    [] __cancel_work_timer+0x9c/0x1e0
    [] watchdog_release+0x3c/0x190
    [] __fput+0x80/0x1c8
    [] task_work_run+0x94/0xc8
    [] do_work_pending+0x8c/0xb4
    [] slow_work_pending+0xc/0x20

    other info that might help us debug this:
    Possible unsafe locking scenario:

    CPU0 CPU1
    ---- ----
    lock(&wd_data->lock);
    lock((&(&wd_data->work)->work));
    lock(&wd_data->lock);
    lock((&(&wd_data->work)->work));

    *** DEADLOCK ***

    1 lock held by systemd/1:

    stack backtrace:
    CPU: 2 PID: 1 Comm: systemd Not tainted 4.6.0-rc3-00191-gfabf418 #162
    Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)
    [] (unwind_backtrace) from [] (show_stack+0x10/0x14)
    [] (show_stack) from [] (dump_stack+0xa8/0xd4)
    [] (dump_stack) from [] (print_circular_bug+0x214/0x334)
    [] (print_circular_bug) from [] (check_prevs_add+0x4dc/0x8e8)
    [] (check_prevs_add) from [] (__lock_acquire+0xc6c/0x14ec)
    [] (__lock_acquire) from [] (lock_acquire+0x70/0x90)
    [] (lock_acquire) from [] (flush_work+0x4c/0x280)
    [] (flush_work) from [] (__cancel_work_timer+0x9c/0x1e0)
    [] (__cancel_work_timer) from [] (watchdog_release+0x3c/0x190)
    [] (watchdog_release) from [] (__fput+0x80/0x1c8)
    [] (__fput) from [] (task_work_run+0x94/0xc8)
    [] (task_work_run) from [] (do_work_pending+0x8c/0xb4)
    [] (do_work_pending) from [] (slow_work_pending+0xc/0x20)

    Turns out the call to cancel_delayed_work_sync() in watchdog_release()
    is not necessary and can be dropped. If the worker is no longer necessary,
    the subsequent call to watchdog_update_worker() will cancel it. If it is
    already running, it won't do anything, since the worker function checks
    if it needs to ping the watchdog or not.

    Reported-by: Clemens Gruber
    Tested-by: Clemens Gruber
    Fixes: 11d7aba9ceb7 ("watchdog: imx2: Convert to use infrastructure triggered keepalives")
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck
    Cc: stable

    Guenter Roeck
     
  • Let's have balanced round brackets.

    Signed-off-by: Wolfram Sang
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Wolfram Sang
     
  • The IMX6 watchdog supports assertion of a signal (WDOG_B) which
    can be pinmux'd to an external pin. This is typically used for boards that
    have PMIC's in control of the IMX6 power rails. In fact, failure to use
    such an external reset on boards with external PMIC's can result in various
    hangs due to the IMX6 not being fully reset [1] as well as the board failing
    to reset because its PMIC has not been reset to provide adequate voltage for
    the CPU when coming out of reset at 800Mhz.

    This uses a new device-tree property 'fsl,ext-reset-output' to indicate the
    board has such a reset and to cause the watchdog to be configured to assert
    WDOG_B instead of an internal reset both on a watchdog timeout and in
    system_restart.

    [1] http://lists.infradead.org/pipermail/linux-arm-kernel/2015-March/333689.html

    Cc: Fabio Estevam
    Cc: Lucas Stach
    Cc: Stefan Roese
    Cc: Iain Paton
    Cc: Sascha Hauer
    Signed-off-by: Tim Harvey
    Reviewed-by: Lucas Stach
    Acked-by: Shawn Guo
    Tested-by: Akshay Bhat
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Tim Harvey
     
  • When performing a suspend operation, the kernel brings all of the
    non-boot CPUs offline, calling the hot plug notifiers with the flag,
    CPU_TASKS_FROZEN, set in the action code. Similarly, during resume,
    the CPUs are brought back online, but again the notifiers have the
    FROZEN flag set.

    While some very few drivers really need to treat suspend/resume
    specially, this driver unintentionally ignores the notifications.

    This patch changes the driver to disable the watchdog interrupt
    whenever the CPU goes offline, and to enable it whenever the CPU goes
    back online. As a result, the suspended state is no longer a special
    case that leaves the watchdog active.

    Signed-off-by: Richard Cochran
    Cc: linux-watchdog@vger.kernel.org
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Richard Cochran
     
  • The Qualcom watchdog timer block reports if the system was reset by the
    watchdog. Pass the information to user space.

    Reviewed-by: Grant Grundler
    Tested-by: Grant Grundler
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Guenter Roeck
     

13 May, 2016

2 commits

  • Adds support for the deadman timer peripheral found on PIC32 class devices.

    The primary function of the deadman timer (DMT) is to reset the processor
    in the event of a software malfunction. The DMT is a free-running
    instruction fetch timer, which is clocked whenever an instruction fetch
    occurs until a count match occurs. Instructions are not fetched when
    the processor is in sleep mode.

    Signed-off-by: Purna Chandra Mandal
    Signed-off-by: Joshua Henderson
    Reviewed-by: Guenter Roeck
    Cc: Rob Herring
    Cc: Pawel Moll
    Cc: Mark Rutland
    Cc: Ian Campbell
    Cc: Kumar Gala
    Cc: Wim Van Sebroeck
    Cc: linux-kernel@vger.kernel.org
    Cc: linux-mips@linux-mips.org
    Cc: devicetree@vger.kernel.org
    Cc: linux-watchdog@vger.kernel.org
    Patchwork: https://patchwork.linux-mips.org/patch/12703/
    Signed-off-by: Ralf Baechle

    Purna Chandra Mandal
     
  • Add support for the watchdog peripheral found on PIC32 class
    devices.

    Signed-off-by: Joshua Henderson
    Signed-off-by: Purna Chandra Mandal
    Reviewed-by: Guenter Roeck
    Cc: Rob Herring
    Cc: Pawel Moll
    Cc: Mark Rutland
    Cc: Ian Campbell
    Cc: Kumar Gala
    Cc: Wim Van Sebroeck
    Cc: linux-kernel@vger.kernel.org
    Cc: linux-mips@linux-mips.org
    Cc: devicetree@vger.kernel.org
    Cc: linux-watchdog@vger.kernel.org
    Patchwork: https://patchwork.linux-mips.org/patch/12701/
    Signed-off-by: Ralf Baechle

    Joshua Henderson
     

03 May, 2016

1 commit


28 Apr, 2016

1 commit


23 Mar, 2016

1 commit

  • Commit 1717f2096b54 ("panic, x86: Fix re-entrance problem due to panic
    on NMI") introduced nmi_panic() which prevents concurrent and recursive
    execution of panic(). It also saves registers for the crash dump on x86
    by later commit 58c5661f2144 ("panic, x86: Allow CPUs to save registers
    even if looping in NMI context").

    hpwdt driver can call panic() from NMI handler, so replace it with
    nmi_panic(). Also, do some cleanups.

    Signed-off-by: Hidehiro Kawai
    Acked-by: Guenter Roeck
    Cc: Thomas Mingarelli
    Cc: Wim Van Sebroeck
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Hidehiro Kawai
     

21 Mar, 2016

1 commit

  • Pull 'objtool' stack frame validation from Ingo Molnar:
    "This tree adds a new kernel build-time object file validation feature
    (ONFIG_STACK_VALIDATION=y): kernel stack frame correctness validation.
    It was written by and is maintained by Josh Poimboeuf.

    The motivation: there's a category of hard to find kernel bugs, most
    of them in assembly code (but also occasionally in C code), that
    degrades the quality of kernel stack dumps/backtraces. These bugs are
    hard to detect at the source code level. Such bugs result in
    incorrect/incomplete backtraces most of time - but can also in some
    rare cases result in crashes or other undefined behavior.

    The build time correctness checking is done via the new 'objtool'
    user-space utility that was written for this purpose and which is
    hosted in the kernel repository in tools/objtool/. The tool's (very
    simple) UI and source code design is shaped after Git and perf and
    shares quite a bit of infrastructure with tools/perf (which tooling
    infrastructure sharing effort got merged via perf and is already
    upstream). Objtool follows the well-known kernel coding style.

    Objtool does not try to check .c or .S files, it instead analyzes the
    resulting .o generated machine code from first principles: it decodes
    the instruction stream and interprets it. (Right now objtool supports
    the x86-64 architecture.)

    From tools/objtool/Documentation/stack-validation.txt:

    "The kernel CONFIG_STACK_VALIDATION option enables a host tool named
    objtool which runs at compile time. It has a "check" subcommand
    which analyzes every .o file and ensures the validity of its stack
    metadata. It enforces a set of rules on asm code and C inline
    assembly code so that stack traces can be reliable.

    Currently it only checks frame pointer usage, but there are plans to
    add CFI validation for C files and CFI generation for asm files.

    For each function, it recursively follows all possible code paths
    and validates the correct frame pointer state at each instruction.

    It also follows code paths involving special sections, like
    .altinstructions, __jump_table, and __ex_table, which can add
    alternative execution paths to a given instruction (or set of
    instructions). Similarly, it knows how to follow switch statements,
    for which gcc sometimes uses jump tables."

    When this new kernel option is enabled (it's disabled by default), the
    tool, if it finds any suspicious assembly code pattern, outputs
    warnings in compiler warning format:

    warning: objtool: rtlwifi_rate_mapping()+0x2e7: frame pointer state mismatch
    warning: objtool: cik_tiling_mode_table_init()+0x6ce: call without frame pointer save/setup
    warning: objtool:__schedule()+0x3c0: duplicate frame pointer save
    warning: objtool:__schedule()+0x3fd: sibling call from callable instruction with changed frame pointer

    ... so that scripts that pick up compiler warnings will notice them.
    All known warnings triggered by the tool are fixed by the tree, most
    of the commits in fact prepare the kernel to be warning-free. Most of
    them are bugfixes or cleanups that stand on their own, but there are
    also some annotations of 'special' stack frames for justified cases
    such entries to JIT-ed code (BPF) or really special boot time code.

    There are two other long-term motivations behind this tool as well:

    - To improve the quality and reliability of kernel stack frames, so
    that they can be used for optimized live patching.

    - To create independent infrastructure to check the correctness of
    CFI stack frames at build time. CFI debuginfo is notoriously
    unreliable and we cannot use it in the kernel as-is without extra
    checking done both on the kernel side and on the build side.

    The quality of kernel stack frames matters to debuggability as well,
    so IMO we can merge this without having to consider the live patching
    or CFI debuginfo angle"

    * 'core-objtool-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (52 commits)
    objtool: Only print one warning per function
    objtool: Add several performance improvements
    tools: Copy hashtable.h into tools directory
    objtool: Fix false positive warnings for functions with multiple switch statements
    objtool: Rename some variables and functions
    objtool: Remove superflous INIT_LIST_HEAD
    objtool: Add helper macros for traversing instructions
    objtool: Fix false positive warnings related to sibling calls
    objtool: Compile with debugging symbols
    objtool: Detect infinite recursion
    objtool: Prevent infinite recursion in noreturn detection
    objtool: Detect and warn if libelf is missing and don't break the build
    tools: Support relative directory path for 'O='
    objtool: Support CROSS_COMPILE
    x86/asm/decoder: Use explicitly signed chars
    objtool: Enable stack metadata validation on 64-bit x86
    objtool: Add CONFIG_STACK_VALIDATION option
    objtool: Add tool to perform compile-time stack metadata validation
    x86/kprobes: Mark kretprobe_trampoline() stack frame as non-standard
    sched: Always inline context_switch()
    ...

    Linus Torvalds
     

20 Mar, 2016

1 commit

  • Pull watchdog updates from Wim Van Sebroeck:

    - new drivers for: NI 903x/913x watchdog driver, WinSystems EBC-C384
    watchdog timer and ARM SBSA watchdog driver

    - Support for NCT6102D devices

    - Improvements of the generic watchdog framework (improve restart
    handler, make set_timeout optional, introduce infrastructure
    triggered keepalives, ...

    - improvements on the pnx4008 watchdog driver

    - several smaller fixes and improvements

    * git://www.linux-watchdog.org/linux-watchdog: (28 commits)
    watchdog: Ensure that wdd is not dereferenced if NULL
    watchdog: imx2: Convert to use infrastructure triggered keepalives
    watchdog: dw_wdt: Convert to use watchdog infrastructure
    watchdog: Add support for minimum time between heartbeats
    watchdog: Make stop function optional
    watchdog: Introduce WDOG_HW_RUNNING flag
    watchdog: Introduce hardware maximum heartbeat in watchdog core
    watchdog: Make set_timeout function optional
    arm: lpc32xx: remove restart handler
    arm: lpc32xx: phy3250 remove restart hook
    watchdog: pnx4008: restart: support "cmd" from userspace
    watchdog: pnx4008: add support for soft reset
    watchdog: pnx4008: add restart handler
    watchdog: pnx4008: update logging during power-on
    watchdog: tangox_wdt: test clock rate to avoid division by 0
    watchdog: atlas7_wdt: test clock rate to avoid division by 0
    watchdog: s3c2410_wdt: Add max and min timeout values
    Watchdog: introduce ARM SBSA watchdog driver
    Documentation: add sbsa-gwdt driver documentation
    watchdog: Add watchdog timer support for the WinSystems EBC-C384
    ...

    Linus Torvalds
     

17 Mar, 2016

16 commits

  • Smatch rightfully complains that wdd is dereferenced in the watchdog
    release function after being checked for NULL. Also make sure that it
    is not accessed outside mutex protection to avoid use-after-free problems.

    Fixes: e6c71e84e4c0 ("watchdog: Introduce WDOG_HW_RUNNING flag")
    Reported-by: Dan Carpenter
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Guenter Roeck
     
  • The watchdog infrastructure now supports handling watchdog keepalive
    if the watchdog is running while the watchdog device is closed.
    Convert the driver to use this infrastructure.

    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Guenter Roeck
     
  • Convert driver to use watchdog infrastructure. This includes
    infrastructure support to handle watchdog keepalive if the watchdog
    is running while the watchdog device is closed.

    Signed-off-by: Guenter Roeck
    Tested-by: Douglas Anderson
    Signed-off-by: Wim Van Sebroeck

    Guenter Roeck
     
  • Some watchdogs require a minimum time between heartbeats.
    Examples are the watchdogs in DA9062 and AT91SAM9x.

    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Guenter Roeck
     
  • Not all hardware watchdogs can be stopped. The driver for
    such watchdogs would typically only set the WATCHDOG_HW_RUNNING
    flag in its stop function. Make the stop function optional and set
    WATCHDOG_HW_RUNNING in the watchdog core if it is not provided.

    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Guenter Roeck
     
  • The WDOG_HW_RUNNING flag is expected to be set by watchdog drivers if
    the hardware watchdog is running. If the flag is set, the watchdog
    subsystem will ping the watchdog even if the watchdog device is closed.

    The watchdog driver stop function is now optional and may be omitted
    if the watchdog can not be stopped. If stopping the watchdog is not
    possible but the driver implements a stop function, it is responsible
    to set the WDOG_HW_RUNNING flag in its stop function.

    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Guenter Roeck
     
  • Introduce an optional hardware maximum heartbeat in the watchdog core.
    The hardware maximum heartbeat can be lower than the maximum timeout.

    Drivers can set the maximum hardware heartbeat value in the watchdog data
    structure. If the configured timeout exceeds the maximum hardware heartbeat,
    the watchdog core enables a timer function to assist sending keepalive
    requests to the watchdog driver.

    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Guenter Roeck
     
  • For some watchdogs, the watchdog driver handles timeout changes without
    explicitly setting any registers. In this situation, the watchdog driver
    might only set the 'timeout' variable but do nothing else.
    This can as well be handled by the infrastructure, so make the set_timeout
    callback optional. If WDIOF_SETTIMEOUT is configured but the .set_timeout
    callback is not available, update the timeout variable in the
    infrastructure code.

    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Guenter Roeck
     
  • Added support to verify if a "cmd" is passed from the userspace program rebooting the system;
    - if a valid "cmd" is available, handle it;
    - If the received "cmd" is not supported, use the default reboot mode.

    Signed-off-by: Sylvain Lemieux
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Sylvain Lemieux
     
  • Add support for explicit soft reset using the reboot mode.

    The default reboot mode behavior is unchanged;
    you can overwrite the default reboot type in the board specific file
    "DT_MACHINE_START" definition using the "reboot_mode" parameter.

    Signed-off-by: Sylvain Lemieux
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Sylvain Lemieux
     
  • Add restart handler capability to the driver;
    the restart handler implementation was taken from
    "mach-lpc32xx" ("lpc23xx_restart" function).

    Signed-off-by: Sylvain Lemieux
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Sylvain Lemieux
     
  • There is no need to add the driver name in the text to display
    on the console during the power-on:
    pnx4008-watchdog 4003c000.watchdog: PNX4008 Watchdog Timer: heartbeat 19 sec

    Signed-off-by: Sylvain Lemieux
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Sylvain Lemieux
     
  • The clk API may return 0 on clk_get_rate, so we should check the result before
    using it as a divisor. For this, refactor the code to use a central
    error path.

    Signed-off-by: Wolfram Sang
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Wolfram Sang
     
  • The clk API may return 0 on clk_get_rate, so we should check the result before
    using it as a divisor.

    Signed-off-by: Wolfram Sang
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Wolfram Sang
     
  • The watchdog maximum timeout value is determined by the number of bits
    for the interval timer counter, its source clock frequency, the number
    of bits of the prescaler and maximum divider value.

    This can be calculated with the following equation:

    max_timeout = counter / (freq / (max_prescale + 1) / max_divider)

    Setting a maximum timeout value will allow the watchdog core to refuse
    user-space calls to the WDIOC_SETTIMEOUT ioctl that sets not supported
    timeout values.

    For example, systemd tries to set a timeout of 10 minutes on reboot to
    ensure that the machine will be rebooted even if a reboot failed. This
    leads to the following error message on an Exynos5422 Odroid XU4 board:

    [ 147.986045] s3c2410-wdt 101d0000.watchdog: timeout 600 too big

    Reported-by: Krzysztof Kozlowski
    Signed-off-by: Javier Martinez Canillas
    Reviewed-by: Krzysztof Kozlowski
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Javier Martinez Canillas
     
  • According to Server Base System Architecture (SBSA) specification,
    the SBSA Generic Watchdog has two stage timeouts: the first signal (WS0)
    is for alerting the system by interrupt, the second one (WS1) is a real
    hardware reset.
    More details about the hardware specification of this device:
    ARM DEN0029B - Server Base System Architecture (SBSA)

    This driver can operate ARM SBSA Generic Watchdog as a single stage watchdog
    or a two stages watchdog, it's set up by the module parameter "action".
    In the single stage mode, when the timeout is reached, your system
    will be reset by WS1. The first signal (WS0) is ignored.
    In the two stages mode, when the timeout is reached, the first signal (WS0)
    will trigger panic. If the system is getting into trouble and cannot be reset
    by panic or restart properly by the kdump kernel(if supported), then the
    second stage (as long as the first stage) will be reached, system will be
    reset by WS1. This function can help administrator to backup the system
    context info by panic console output or kdump.

    This driver bases on linux kernel watchdog framework, so it can get
    timeout from module parameter and FDT at the driver init stage.

    Signed-off-by: Fu Wei
    Reviewed-by: Graeme Gregory
    Tested-by: Pratyush Anand
    Acked-by: Timur Tabi
    Reviewed-by: Mathieu Poirier
    Tested-by: Suravee Suthikulpanit
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Fu Wei
     

02 Mar, 2016

1 commit