01 Mar, 2017

10 commits

  • The retu watchdog calls into the respective mfd driver, but fails to
    link if that is diabled:

    drivers/watchdog/built-in.o: In function `retu_wdt_set_timeout':
    ziirave_wdt.c:(.text+0x8c88): undefined reference to `retu_write'
    ziirave_wdt.c:(.text+0x8c88): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `retu_write'
    drivers/watchdog/built-in.o: In function `retu_wdt_start':
    ziirave_wdt.c:(.text+0x8cc8): undefined reference to `retu_write'
    ziirave_wdt.c:(.text+0x8cc8): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `retu_write'

    This restores the dependency as it was before

    Fixes: da2a68b3eb47 ("watchdog: Enable COMPILE_TEST where possible")
    Signed-off-by: Arnd Bergmann
    Signed-off-by: Guenter Roeck

    Arnd Bergmann
     
  • When the db8500 watchdog is enabled without the PRCMU, we get a lot of
    warnings about duplicate or missing helper functions:

    In file included from drivers/watchdog/ux500_wdt.c:21:0:
    include/linux/mfd/dbx500-prcmu.h:422:19: error: redefinition of 'prcmu_abb_read'
    static inline int prcmu_abb_read(u8 slave, u8 reg, u8 *value, u8 size)

    This restores the dependency as it was.

    Fixes: da2a68b3eb47 ("watchdog: Enable COMPILE_TEST where possible")
    Signed-off-by: Arnd Bergmann
    Signed-off-by: Guenter Roeck

    Arnd Bergmann
     
  • gcc-4.3 can't decide whether the constant value in
    kempld_prescaler[PRESCALER_21] is built-time constant or
    not, and gets confused by the logic in do_div():

    drivers/watchdog/kempld_wdt.o: In function `kempld_wdt_set_stage_timeout':
    kempld_wdt.c:(.text.kempld_wdt_set_stage_timeout+0x130): undefined reference to `__aeabi_uldivmod'

    This adds a call to ACCESS_ONCE() to force it to not consider
    it to be constant, and leaves the more efficient normal case
    in place for modern compilers, using an #ifdef to annotate
    why we do this hack.

    Signed-off-by: Arnd Bergmann
    Signed-off-by: Guenter Roeck

    Arnd Bergmann
     
  • Checking for timer expiration is done from the softirq TIMER_SOFTIRQ.

    Since commit 4cd13c21b207 ("softirq: Let ksoftirqd do its job"),
    pending softirqs are no longer always handled immediately, instead,
    if there are pending softirqs, and ksoftirqd is in state TASK_RUNNING,
    the handling of the softirqs are deferred, and are instead supposed
    to be handled by ksoftirqd, when ksoftirqd gets scheduled.

    If a user space process with a real-time policy starts to misbehave
    by never relinquishing the CPU while ksoftirqd is in state TASK_RUNNING,
    what will happen is that all softirqs will get deferred, while ksoftirqd,
    which is supposed to handle the deferred softirqs, will never get to run.

    To make sure that the watchdog is able to fire even when we do not get
    to run softirqs, replace the timers with hrtimers.

    Signed-off-by: Niklas Cassel
    Signed-off-by: Guenter Roeck

    Niklas Cassel
     
  • The kempld watchdog driver requires the respective MFD driver:

    drivers/watchdog/built-in.o: In function `kempld_wdt_probe':
    kempld_wdt.c:(.text+0x5c78): undefined reference to `kempld_get_mutex'
    kempld_wdt.c:(.text+0x5c84): undefined reference to `kempld_read8'
    kempld_wdt.c:(.text+0x5c8e): undefined reference to `kempld_release_mutex'
    kempld_wdt.c:(.text+0x5d1c): undefined reference to `kempld_read8'
    kempld_wdt.c:(.text+0x5d2c): undefined reference to `kempld_write8'

    This adds the Kconfig dependency back.

    Fixes: da2a68b3eb47 ("watchdog: Enable COMPILE_TEST where possible")
    Signed-off-by: Arnd Bergmann
    Signed-off-by: Guenter Roeck

    Arnd Bergmann
     
  • Without CONFIG_OF, the driver fails to link:

    drivers/watchdog/built-in.o: In function `bcm2835_power_off':
    bcm2835_wdt.c:(.text+0x1946): undefined reference to `of_find_device_by_node'

    This adds a new dependency, to allow the COMPILE_TEST check to succeed.

    Fixes: da2a68b3eb47 ("watchdog: Enable COMPILE_TEST where possible")
    Signed-off-by: Arnd Bergmann
    Signed-off-by: Guenter Roeck

    Arnd Bergmann
     
  • The driver fails to link if ARM_AMBA is disabled:

    drivers/watchdog/sp805_wdt.o: In function `sp805_wdt_driver_init':
    sp805_wdt.c:(.init.text+0x4): undefined reference to `amba_driver_register'

    It seems that the COMPILE_TEST was added in the wrong place, as there
    is no architecture dependency, but a bus dependency. This moves
    the dependency accordingly.

    Fixes: da2a68b3eb47 ("watchdog: Enable COMPILE_TEST where possible")
    Signed-off-by: Arnd Bergmann
    Signed-off-by: Guenter Roeck

    Arnd Bergmann
     
  • This driver fails to link when CONFIG_I2C is disabled or a loadable module while
    the watchdog is built-in:

    drivers/watchdog/built-in.o: In function `menf21bmc_wdt_shutdown':
    menf21bmc_wdt.c:(.text+0x9b44): undefined reference to `i2c_smbus_write_word_data'
    menf21bmc_wdt.c:(.text+0x9b44): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `i2c_smbus_write_word_data'

    This adds a Kconfig dependency for it, to enforce a valid configuration.

    Fixes: da2a68b3eb47 ("watchdog: Enable COMPILE_TEST where possible")
    Signed-off-by: Arnd Bergmann
    Signed-off-by: Guenter Roeck

    Arnd Bergmann
     
  • Wtihout CONFIG_CS5535_MFGPT, the driver does not link right:

    drivers/watchdog/built-in.o: In function `geodewdt_probe':
    geodewdt.c:(.init.text+0xca3): undefined reference to `cs5535_mfgpt_alloc_timer'
    geodewdt.c:(.init.text+0xcd4): undefined reference to `cs5535_mfgpt_write'
    geodewdt.c:(.init.text+0xcef): undefined reference to `cs5535_mfgpt_toggle_event'

    This adds back the dependency on this base driver.

    Fixes: da2a68b3eb47 ("watchdog: Enable COMPILE_TEST where possible")
    Signed-off-by: Arnd Bergmann
    Signed-off-by: Guenter Roeck

    Arnd Bergmann
     
  • The wm831x watchdog driver can now be built without the wm831x mfd
    driver, which results in a link error:

    (.text+0x1a95c): undefined reference to `wm831x_set_bits'
    (.text+0x1a95c): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `wm831x_set_bits'
    (.text+0x1a968): undefined reference to `wm831x_reg_lock'
    (.text+0x1a968): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `wm831x_reg_lock'
    (.text+0x1a9dc): undefined reference to `wm831x_reg_unlock'
    (.text+0x1a9dc): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `wm831x_reg_unlock'

    This adds back the dependency that was removed. We can still build test
    this driver on all architectures by enabling the MFD driver for it first.

    Fixes: da2a68b3eb47 ("watchdog: Enable COMPILE_TEST where possible")
    Signed-off-by: Arnd Bergmann
    Signed-off-by: Guenter Roeck

    Arnd Bergmann
     

28 Feb, 2017

1 commit


25 Feb, 2017

29 commits

  • Functions marked static inline might not be inlined so a driver-specific
    prefix for function name helps when looking through call backtrace.

    Signed-off-by: Krzysztof Kozlowski
    Signed-off-by: Guenter Roeck

    Krzysztof Kozlowski
     
  • Syscon is used not only on Exynos5 SoCs but also on Exynos3250,
    Exynos4412 and ARMv8 versions (Exynos5433, Exynos7).

    Signed-off-by: Krzysztof Kozlowski
    Signed-off-by: Guenter Roeck

    Krzysztof Kozlowski
     
  • Replace the 'debug' module parameter and pr_info() with proper device
    dynamic debug calls because this is the preferred and flexible way of
    enabling debugging printks.

    Also remove some obvious debug printks.

    Signed-off-by: Krzysztof Kozlowski
    Signed-off-by: Guenter Roeck

    Krzysztof Kozlowski
     
  • In soft (no-reboot) mode, the driver self-pings watchdog upon expiration
    of an interrupt. However the interrupt itself was not cleared thus on
    first hit, the system enters infinite interrupt handling loop.

    On Odroid U3 (Exynos4412), when booted with s3c2410_wdt.soft_noboot=1
    argument the console is flooded:
    # killall -9 watchdog
    [ 60.523760] s3c2410-wdt 10060000.watchdog: watchdog timer expired (irq)
    [ 60.536744] s3c2410-wdt 10060000.watchdog: watchdog timer expired (irq)

    Fix this by writing something to the WTCLRINT register to clear the
    interrupt. The register WTCLRINT however appeared in S3C6410 so a new
    watchdog quirk and flavor are needed.

    Signed-off-by: Krzysztof Kozlowski
    Reviewed-by: Guenter Roeck
    Signed-off-by: Guenter Roeck

    Krzysztof Kozlowski
     
  • The CONFIG prefix from defines in the s3c2410_wdt.c might suggest that
    these constants come from Kconfig.

    Signed-off-by: Krzysztof Kozlowski
    Reviewed-by: Guenter Roeck
    Signed-off-by: Guenter Roeck

    Krzysztof Kozlowski
     
  • It occurred to me that the panic pretimeout governor will stall the
    softdog, because it is purely software which simply breaks when the
    kernel panics. Testing governors with the softdog on the other hand is
    really useful, so make this feature a compile time option which nees to
    be enabled explicitly. This also removes the overhead if pretimeout
    support is not used because it will now be compiled away (saving ~10% on
    ARM32).

    Signed-off-by: Wolfram Sang
    Reviewed-by: Vladimir Zapolskiy
    Reviewed-by: Guenter Roeck
    Signed-off-by: Guenter Roeck

    Wolfram Sang
     
  • This patch adds watchdog controller driver for ZTE's zx2967 family.

    Signed-off-by: Baoyou Xie
    Signed-off-by: Guenter Roeck

    Baoyou Xie
     
  • When resuming for the deepest state on sama5d2, it is necessary to restore
    MR as the registers are lost.

    Signed-off-by: Alexandre Belloni
    Signed-off-by: Guenter Roeck

    Alexandre Belloni
     
  • .config is used to cache a part of WDT_MR at probe time and is not used
    afterwards. Instead of doing that, actually cache MR and avoid reading it
    every time it is modified.

    Signed-off-by: Alexandre Belloni
    Signed-off-by: Guenter Roeck

    Alexandre Belloni
     
  • Cleanup this driver and convert it to use the watchdog framework API.

    Signed-off-by: H Hartley Sweeten
    Cc: Mika Westerberg
    [groeck: Dropped initialization of static variable]
    Signed-off-by: Guenter Roeck

    H Hartley Sweeten
     
  • Cleanup this driver and remove the 200ms heartbeat timer. The core now
    has the ability to handle the heartbeat.

    Signed-off-by: H Hartley Sweeten
    [groeck: Dropped 0-initialization of static variable]
    Signed-off-by: Guenter Roeck

    H Hartley Sweeten
     
  • Without this dependency, platforms not supporting PCI (such as m68k)
    report the following build warning when building allmodconfig
    or allyesconfig.

    drivers/watchdog/rdc321x_wdt.c: In function 'rdc321x_wdt_ioctl':
    ./arch/m68k/include/asm/uaccess_mm.h:61:1: warning:
    'value' may be used uninitialized in this function

    Fixes: f4c3de659054 ("watchdog: Enable COMPILE_TEST where possible")
    Signed-off-by: Guenter Roeck

    Guenter Roeck
     
  • This add support for the Cortina systems Gemini (SL3516)
    SoC watchdog.

    I have tried to use all the right new kernel interfaces
    and tested with busybox' "watchdog" command both to kick
    and get timeouts and reboots.

    Signed-off-by: Linus Walleij
    Signed-off-by: Guenter Roeck

    Linus Walleij
     
  • Declare watchdog_ops structures as const as they are only stored in the
    ops field of a watchdog_device structure. This field is of type const, so
    watchdog_ops structures having this property can be made const too.
    Done using Coccinelle:

    @r disable optional_qualifier@
    identifier x;
    position p;
    @@
    static struct watchdog_ops x@p={...};

    @ok@
    struct watchdog_device w;
    identifier r.x;
    position p;
    @@
    w.ops=&x@p;

    @bad@
    position p != {r.p,ok.p};
    identifier r.x;
    @@
    x@p

    @depends on !bad disable optional_qualifier@
    identifier r.x;
    @@
    +const
    struct watchdog_ops x;

    File size details before and after patching.
    First line of every .o file shows the file size before patching
    and second line shows the size after patching.

    text data bss dec hex filename

    1340 544 0 1884 75c drivers/watchdog/bcm_kona_wdt.o
    1436 440 0 1876 754 drivers/watchdog/bcm_kona_wdt.o

    1176 544 4 1724 6bc drivers/watchdog/digicolor_wdt.o
    1272 440 4 1716 6b4 drivers/watchdog/digicolor_wdt.o

    925 580 89 1594 63a drivers/watchdog/ep93xx_wdt.o
    1021 476 89 1586 632 drivers/watchdog/ep93xx_wdt.o

    4932 288 17 5237 1475 drivers/watchdog/s3c2410_wdt.o
    5028 192 17 5237 1475 drivers/watchdog/s3c2410_wdt.o

    1977 292 1 2270 8de drivers/watchdog/sama5d4_wdt.o
    2073 196 1 2270 8de drivers/watchdog/sama5d4_wdt.o

    1375 484 1 1860 744 drivers/watchdog/sirfsoc_wdt.o
    1471 380 1 1852 73c drivers/watchdog/sirfsoc_wdt.o

    Size remains the same for the files drivers/watchdog/diag288_wdt.o
    drivers/watchdog/asm9260_wdt.o and drivers/watchdog/atlas7_wdt.o

    The following .o files did not compile:
    drivers/watchdog/sun4v_wdt.o, drivers/watchdog/sbsa_gwdt.o,
    drivers/watchdog/rt2880_wdt.o, drivers/watchdog/booke_wdt.o
    drivers/watchdog/mt7621_wdt.o

    Signed-off-by: Bhumika Goyal
    Signed-off-by: Guenter Roeck

    Bhumika Goyal
     
  • Many watchdog drivers explicitly stop the watchdog when unregistering it.
    While it is unclear if this is actually needed (the whatdog should not be
    running at that time if it can be stopped), introduce a helper to
    explicitly stop the watchdog in the watchdog core when unregistering it.
    This helps reducing driver code size while retaining functionality.

    Signed-off-by: Guenter Roeck

    Guenter Roeck
     
  • The devm_ resource manager functions allow memory to be automatically
    released when a device is unbound. This patch takes advantage of the
    resource manager functions and replaces the watchdog_register_device
    call with the devm_watchdog_register_device call. In addition, the
    ebc_c384_wdt_remove function has been removed as no longer necessary due
    to the use of the relevant devm_ resource manager functions.

    Signed-off-by: William Breathitt Gray
    Signed-off-by: Guenter Roeck

    William Breathitt Gray
     
  • Use device managed functions to simplify error handling, reduce
    source code size, improve readability, and reduce the likelyhood of bugs.

    The conversion was done automatically with coccinelle using the
    following semantic patches. The semantic patches and the scripts used
    to generate this commit log are available at
    https://github.com/groeck/coccinelle-patches

    - Use devm_watchdog_register_driver() to register watchdog device

    Cc: Stephen Warren
    Cc: Thierry Reding
    Cc: Alexandre Courbot
    Signed-off-by: Guenter Roeck
    Acked-by: Thierry Reding
    Signed-off-by: Guenter Roeck

    Guenter Roeck
     
  • Use device managed functions to simplify error handling, reduce
    source code size, improve readability, and reduce the likelyhood of bugs.

    The conversion was done automatically with coccinelle using the
    following semantic patches. The semantic patches and the scripts used
    to generate this commit log are available at
    https://github.com/groeck/coccinelle-patches

    - Replace 'val = e; return val;' with 'return e;'
    - Replace 'if (e) return e; return 0;' with 'return e;'
    - Drop assignments to otherwise unused variables
    - Drop unused variables
    - Drop remove function
    - Drop dev_set_drvdata()
    - Use devm_watchdog_register_driver() to register watchdog device

    Acked-by: Adam Thomson
    Signed-off-by: Guenter Roeck

    Guenter Roeck
     
  • Use device managed functions to simplify error handling, reduce
    source code size, improve readability, and reduce the likelyhood of bugs.

    The conversion was done automatically with coccinelle using the
    following semantic patches. The semantic patches and the scripts used
    to generate this commit log are available at
    https://github.com/groeck/coccinelle-patches

    - Replace 'val = e; return val;' with 'return e;'
    - Drop assignments to otherwise unused variables
    - Drop remove function
    - Drop dev_set_drvdata()
    - Use devm_watchdog_register_driver() to register watchdog device

    Acked-by: Adam Thomson
    Signed-off-by: Guenter Roeck

    Guenter Roeck
     
  • Use device managed functions to simplify error handling, reduce
    source code size, improve readability, and reduce the likelyhood of bugs.

    The conversion was done automatically with coccinelle using the
    following semantic patches. The semantic patches and the scripts used
    to generate this commit log are available at
    https://github.com/groeck/coccinelle-patches

    - Replace 'goto l; ... l: return e;' with 'return e;'
    - Drop assignments to otherwise unused variables
    - Drop remove function
    - Drop platform_set_drvdata()
    - Use devm_watchdog_register_driver() to register watchdog device

    Acked-by: Adam Thomson
    Signed-off-by: Guenter Roeck

    Guenter Roeck
     
  • Use device managed functions to simplify error handling, reduce
    source code size, improve readability, and reduce the likelyhood of bugs.

    The conversion was done automatically with coccinelle using the
    following semantic patches. The semantic patches and the scripts used
    to generate this commit log are available at
    https://github.com/groeck/coccinelle-patches

    - Replace 'goto l; ... l: return e;' with 'return e;'
    - Replace 'val = e; return val;' with 'return e;'
    - Drop assignments to otherwise unused variables
    - Replace 'if (e) { return expr; }' with 'if (e) return expr;'
    - Drop remove function
    - Drop platform_set_drvdata()
    - Use devm_watchdog_register_driver() to register watchdog device

    Acked-by: Adam Thomson
    Signed-off-by: Guenter Roeck

    Guenter Roeck
     
  • Use device managed functions to simplify error handling, reduce
    source code size, improve readability, and reduce the likelyhood of bugs.
    Other improvements as listed below.

    The conversion was done automatically with coccinelle using the
    following semantic patches. The semantic patches and the scripts used
    to generate this commit log are available at
    https://github.com/groeck/coccinelle-patches

    - Drop assignments to otherwise unused variables
    - Replace of_iomap() with platform_get_resource() followed by
    devm_ioremap_resource()
    - Replace &pdev->dev with dev if 'struct device *dev' is a declared
    variable
    - Use devm_watchdog_register_driver() to register watchdog device
    - Replace shutdown function with call to watchdog_stop_on_reboot()

    Cc: Stephen Warren
    Cc: Lee Jones
    Cc: Florian Fainelli
    Cc: Ray Jui
    Cc: Scott Branden
    Acked-by: Eric Anholt
    Signed-off-by: Guenter Roeck

    Guenter Roeck
     
  • Use device managed functions to simplify error handling, reduce
    source code size, improve readability, and reduce the likelyhood of bugs.
    Other improvements as listed below.

    The conversion was done automatically with coccinelle using the
    following semantic patches. The semantic patches and the scripts used
    to generate this commit log are available at
    https://github.com/groeck/coccinelle-patches

    - Replace 'goto l; ... l: return e;' with 'return e;'
    - Drop assignments to otherwise unused variables
    - Drop remove function
    - Drop unnecessary mutex_destroy() on allocated data
    - Use devm_watchdog_register_driver() to register watchdog device

    Acked-by: Johannes Thumshirn
    Signed-off-by: Guenter Roeck

    Guenter Roeck
     
  • Use device managed functions to simplify error handling, reduce
    source code size, improve readability, and reduce the likelyhood of bugs.

    The conversion was done automatically with coccinelle using the
    following semantic patches. The semantic patches and the scripts used
    to generate this commit log are available at
    https://github.com/groeck/coccinelle-patches

    - Replace 'goto l; ... l: return e;' with 'return e;'
    - Replace 'val = e; return val;' with 'return e;'
    - Drop assignments to otherwise unused variables
    - Replace 'if (e) { return expr; }' with 'if (e) return expr;'
    - Drop remove function
    - Drop platform_set_drvdata()
    - Use devm_watchdog_register_driver() to register watchdog device

    Acked-by: Charles Keepax
    Signed-off-by: Guenter Roeck

    Guenter Roeck
     
  • Use device managed functions to simplify error handling, reduce
    source code size, improve readability, and reduce the likelyhood of bugs.
    Other improvements as listed below.

    The conversion was done automatically with coccinelle using the
    following semantic patches. The semantic patches and the scripts used
    to generate this commit log are available at
    https://github.com/groeck/coccinelle-patches

    - Replace 'goto l; ... l: return e;' with 'return e;'
    - Replace 'val = e; return val;' with 'return e;'
    - Drop assignments to otherwise unused variables
    - Replace 'if (e) { return expr; }' with 'if (e) return expr;'
    - Drop remove function
    - Replace of_iomap() with platform_get_resource() followed by
    devm_ioremap_resource()
    - Drop platform_set_drvdata()
    - Replace &pdev->dev with dev if 'struct device *dev' is a declared
    variable
    - Use devm_watchdog_register_driver() to register watchdog device
    - Replace shutdown function with call to watchdog_stop_on_reboot()

    Acked-by: Baruch Siach
    Tested-by: Baruch Siach
    Signed-off-by: Guenter Roeck

    Guenter Roeck
     
  • The shutdown function calls the stop function.
    Call watchdog_stop_on_reboot() from probe instead.

    The conversion was done automatically with coccinelle using the
    following semantic patches. The semantic patches and the scripts used
    to generate this commit log are available at
    https://github.com/groeck/coccinelle-patches

    - Replace shutdown function with call to watchdog_stop_on_reboot()

    Reviewed-by: Andy Shevchenko
    Signed-off-by: Guenter Roeck

    Guenter Roeck
     
  • Use device managed functions to simplify error handling, reduce
    source code size, improve readability, and reduce the likelyhood of bugs.

    The conversion was done automatically with coccinelle using the
    following semantic patches. The semantic patches and the scripts used
    to generate this commit log are available at
    https://github.com/groeck/coccinelle-patches

    - Drop assignments to otherwise unused variables
    - Drop remove function
    - Drop platform_set_drvdata()
    - Use devm_watchdog_register_driver() to register watchdog device

    Reviewed-by: Andy Shevchenko
    Signed-off-by: Guenter Roeck

    Guenter Roeck
     
  • Use device managed functions to simplify error handling, reduce
    source code size, improve readability, and reduce the likelyhood of bugs.
    Other improvements as listed below.

    The conversion was done automatically with coccinelle using the
    following semantic patches. The semantic patches and the scripts used
    to generate this commit log are available at
    https://github.com/groeck/coccinelle-patches

    - Drop assignments to otherwise unused variables
    - Drop remove function
    - Drop platform_set_drvdata()
    - Use devm_watchdog_register_driver() to register watchdog device
    - Replace shutdown function with call to watchdog_stop_on_reboot()

    Cc: Carlo Caione
    Acked-by: Kevin Hilman
    Signed-off-by: Guenter Roeck

    Guenter Roeck
     
  • Use device managed functions to simplify error handling, reduce
    source code size, improve readability, and reduce the likelyhood of bugs.
    Other improvements as listed below.

    The conversion was done automatically with coccinelle using the
    following semantic patches. The semantic patches and the scripts used
    to generate this commit log are available at
    https://github.com/groeck/coccinelle-patches

    - Drop assignments to otherwise unused variables
    - Drop remove function
    - Drop platform_set_drvdata()
    - Use devm_watchdog_register_driver() to register watchdog device
    - Replace shutdown function with call to watchdog_stop_on_reboot()

    Cc: Chen-Yu Tsai
    Acked-by: Maxime Ripard
    Signed-off-by: Guenter Roeck

    Guenter Roeck