25 May, 2020

1 commit

  • The 'pengutronix' address is defunct for years. Use the proper contact
    address.

    Signed-off-by: Wolfram Sang
    Reviewed-by: Guenter Roeck
    Link: https://lore.kernel.org/r/20200502142653.19144-1-wsa@kernel.org
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Wolfram Sang
     

18 Mar, 2020

1 commit

  • .remove callback implementation doesn' call clk_disable_unprepare() which
    is buggy, actually, we can just use devm_watchdog_register_device() and
    devm_add_action_or_reset() to handle all necessary operations for remove
    action, then .remove callback can be dropped.

    Signed-off-by: Anson Huang
    Reviewed-by: Guenter Roeck
    Link: https://lore.kernel.org/r/1582512687-13312-1-git-send-email-Anson.Huang@nxp.com
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Anson Huang
     

19 Nov, 2019

3 commits


17 Sep, 2019

1 commit

  • Converting from ms to s requires dividing by 1000, not multiplying. So
    this is currently taking the smaller of new_timeout and 1.28e8,
    i.e. effectively new_timeout.

    The driver knows what it set max_hw_heartbeat_ms to, so use that
    value instead of doing a division at run-time.

    FWIW, this can easily be tested by booting into a busybox shell and
    doing "watchdog -t 5 -T 130 /dev/watchdog" - without this patch, the
    watchdog fires after 130&127 == 2 seconds.

    Fixes: b07e228eee69 "watchdog: imx2_wdt: Fix set_timeout for big timeout values"
    Cc: stable@vger.kernel.org # 5.2 plus anything the above got backported to
    Signed-off-by: Rasmus Villemoes
    Reviewed-by: Guenter Roeck
    Link: https://lore.kernel.org/r/20190812131356.23039-1-linux@rasmusvillemoes.dk
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Rasmus Villemoes
     

08 Jul, 2019

1 commit


06 May, 2019

2 commits


02 Aug, 2018

1 commit


04 Mar, 2018

1 commit


21 Jan, 2018

1 commit

  • When the watchdog device is suspended, its timeout is set to the maximum
    value. During resume, the previously set timeout should be restored.
    This does not work at the moment.

    The suspend function calls

    imx2_wdt_set_timeout(wdog, IMX2_WDT_MAX_TIME);

    and resume reverts this by calling

    imx2_wdt_set_timeout(wdog, wdog->timeout);

    However, imx2_wdt_set_timeout() updates wdog->timeout. Therefore,
    wdog->timeout is set to IMX2_WDT_MAX_TIME when we enter the resume
    function.

    Fix this by adding a new function __imx2_wdt_set_timeout() which
    only updates the hardware settings. imx2_wdt_set_timeout() now calls
    __imx2_wdt_set_timeout() and then saves the new timeout to
    wdog->timeout.

    During suspend, we call __imx2_wdt_set_timeout() directly so that
    wdog->timeout won't be updated and we can restore the previous value
    during resume. This approach makes wdog->timeout different from the
    actual setting in the hardware which is usually not a good thing.
    However, the two differ only while we're suspended and no kernel code is
    running, so it should be ok in this case.

    Signed-off-by: Martin Kaiser
    Cc: stable@vger.kernel.org
    Reviewed-by: Guenter Roeck
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Martin Kaiser
     

08 Oct, 2016

1 commit

  • The change adds watchdog pretimeout notification handling to imx2_wdt
    driver, if device data contains information about a valid interrupt.

    It is unlikely but still possible (e.g. through a software limitation)
    that only a subset of watchdogs on SoC has interrupt lines, hence
    functionally the devices from these two groups have different
    capabilities, and this is reflected in different watchdog_info
    structs assigned to the devices.

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

    Vladimir Zapolskiy
     

24 Sep, 2016

1 commit


14 May, 2016

1 commit

  • 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
     

17 Mar, 2016

1 commit


01 Mar, 2016

1 commit


13 Dec, 2015

1 commit


29 Oct, 2015

1 commit


26 Jun, 2015

2 commits


22 Jun, 2015

2 commits

  • If on watchdog device registration a parent device is not set, then
    the registered watchdog is considered to be a virtual device:

    /sys/devices/virtual/watchdog/watchdog0
    /sys/devices/virtual/watchdog/watchdog1

    Setting a correct reference to a platform device allows to
    distinguish multiple instances of iMX2+ hardware watchdogs:

    /sys/devices/soc0/soc/2000000.aips-bus/20bc000.wdog/watchdog/watchdog0
    /sys/devices/soc0/soc/2000000.aips-bus/20c0000.wdog/watchdog/watchdog1

    Signed-off-by: Vladimir Zapolskiy
    Reviewed-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Vladimir Zapolskiy
     
  • Commit faad5de0b104 ("watchdog: imx2_wdt: convert to watchdog core api")
    removes the custom ioctl function. The generic ioctl handler is not
    setting the wdog->timeout to the new_timeout but handing this preset
    value back to the userspace. This patch sets the new value in the
    drivers set_timeout function to fix that problem.

    Signed-off-by: Michael Grzeschik
    Reviewed-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Michael Grzeschik
     

18 Feb, 2015

1 commit


21 Jan, 2015

2 commits

  • Disable power down counter of the watchdog to avoid system resets. The
    watchdog power down counter is set automatically by the chip. If it is
    not set to 0 in the driver, the system resets.

    Signed-off-by: Markus Pargmann
    Acked-by: Shawn Guo
    Signed-off-by: Wim Van Sebroeck

    Markus Pargmann
     
  • Improve power management operations(suspend and resume) as part of
    dev_pm_ops for IMX2 watchdog driver.

    If PM will be supported, please make sure that the wdev->clk
    could disable the watchdog's counter input clock source or can
    mask watchdog's reset request to the core.

    If watchdog is still used by consumers and resumes from deep
    sleep state, we need to restart the watchdog again without
    enabling the timer.

    If watchdog been has started --> stopped by the consumers and
    resumes from non-deep sleep state, then start the timer again.

    If watchdog has been started --> stopped by the consumers and
    resumes from deep sleep state, will do nothing. The watchdog
    will be restarted by consumers next time to be used.

    Signed-off-by: Xiubo Li
    Reviewed-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Xiubo Li
     

18 Dec, 2014

2 commits

  • Fix the following build warning by passing the expected argument type to
    watchdog_active():

    drivers/watchdog/imx2_wdt.c: In function 'imx2_wdt_suspend':
    drivers/watchdog/imx2_wdt.c:340:2: warning: passing argument 1 of 'watchdog_active' from incompatible pointer type [enabled by default]
    In file included from drivers/watchdog/imx2_wdt.c:38:0:
    include/linux/watchdog.h:104:20: note: expected 'struct watchdog_device *' but argument is of type 'struct watchdog_device **'

    Reported-by: Olof's autobuilder
    Signed-off-by: Fabio Estevam
    Reviewed-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Fabio Estevam
     
  • Add power management operations(suspend and resume) as part of
    dev_pm_ops for IMX2 watchdog driver.

    Signed-off-by: Xiubo Li
    Reviewed-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Xiubo Li
     

04 Nov, 2014

1 commit


21 Oct, 2014

2 commits


20 Oct, 2014

1 commit


06 Aug, 2014

1 commit

  • This watchdog driver will be working on IMX2+, Vybrid, LS1, LS2+
    platforms, and will be in different endianness mode in those SoCs:

    SoCs WDT endian mode
    ------------------------------------
    IMX2+ LE
    Vybird LE
    LS1 BE
    LS2 LE

    Signed-off-by: Xiubo Li
    Reviewed-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Xiubo Li
     

11 Jun, 2014

3 commits

  • Convert the imx2_wdt driver to the new watchdog core api.

    Signed-off-by: Anatolij Gustschin
    Reviewed-by: Guenter Roeck
    Cc: Wolfram Sang
    Signed-off-by: Wim Van Sebroeck

    Anatolij Gustschin
     
  • This watchdog driver will be working on IMX2+, Vybrid, LS1, LS2+
    platforms, and will be in different endianness mode in those SoCs:

    SoCs CPU endian mode WDT endian mode
    ------------------------------------------------
    IMX2+ LE LE
    Vybird LE LE
    LS1 LE BE
    LS2 LE LE

    Other possible SoCs:
    SoCs CPU endian mode WDT endian mode
    ------------------------------------------------
    Soc1 BE BE
    Soc2 BE LE

    And also the watchdog's registers will be 32-bits for some versions,
    and though it is 16-bits in IMX2+, Vybird and LS+.

    Using the regmap APIs, could be more easy to support different
    endianness and also more easy to support 32-bits version...

    Signed-off-by: Xiubo Li
    Reviewed-by: Guenter Roeck
    Acked-by: Shawn Guo
    Signed-off-by: Wim Van Sebroeck

    Xiubo Li
     
  • Signed-off-by: Xiubo Li
    Reviewed-by: Guenter Roeck
    Acked-by: Shawn Guo
    Signed-off-by: Wim Van Sebroeck

    Xiubo Li
     

29 Jan, 2014

1 commit


18 Nov, 2013

2 commits

  • I just can't find any value in MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR)
    and MODULE_ALIAS_MISCDEV(TEMP_MINOR) statements.

    Either the device is enumerated and the driver already has a module
    alias (e.g. PCI, USB etc.) that will get the right driver loaded
    automatically.

    Or the device is not enumerated and loading its driver will lead to
    more or less intrusive hardware poking. Such hardware poking should be
    limited to a bare minimum, so the user should really decide which
    drivers should be tried and in what order. Trying them all in
    arbitrary order can't do any good.

    On top of that, loading that many drivers at once bloats the kernel
    log. Also many drivers will stay loaded afterward, bloating the output
    of "lsmod" and wasting memory. Some modules (cs5535_mfgpt which gets
    loaded as a dependency) can't even be unloaded!

    If defining char-major-10-130 is needed then it should happen in
    user-space.

    Signed-off-by: Jean Delvare
    Acked-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck
    Cc: Stephen Warren
    Cc: Mike Frysinger
    Cc: Wan ZongShun
    Cc: Ben Dooks
    Cc: Kukjin Kim
    Cc: Zwane Mwaikambo
    Cc: Jim Cromie

    Jean Delvare
     
  • Enable auto loading by udev when imx2_wdt is compiled as a module.

    Signed-off-by: Niels de Vos
    Acked-by: Shawn Guo
    Reviewed-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Niels de Vos
     

12 Jul, 2013

1 commit