14 Oct, 2016

1 commit

  • Pull watchdog updates from Wim Van Sebroeck:

    - a new watchdog pretimeout governor framework

    - support to upload the firmware on the ziirave_wdt

    - several fixes and cleanups

    * git://www.linux-watchdog.org/linux-watchdog: (26 commits)
    watchdog: imx2_wdt: add pretimeout function support
    watchdog: softdog: implement pretimeout support
    watchdog: pretimeout: add pretimeout_available_governors attribute
    watchdog: pretimeout: add option to select a pretimeout governor in runtime
    watchdog: pretimeout: add panic pretimeout governor
    watchdog: pretimeout: add noop pretimeout governor
    watchdog: add watchdog pretimeout governor framework
    watchdog: hpwdt: add support for iLO5
    fs: compat_ioctl: add pretimeout functions for watchdogs
    watchdog: add pretimeout support to the core
    watchdog: imx2_wdt: use preferred BIT macro instead of open coded values
    watchdog: st_wdt: Remove support for obsolete platforms
    watchdog: bindings: Remove obsolete platforms from dt doc.
    watchdog: mt7621_wdt: Remove assignment of dev pointer
    watchdog: rt2880_wdt: Remove assignment of dev pointer
    watchdog: constify watchdog_ops structures
    watchdog: tegra: constify watchdog_ops structures
    watchdog: iTCO_wdt: constify iTCO_wdt_pm structure
    watchdog: cadence_wdt: Fix the suspend resume
    watchdog: txx9wdt: Add missing clock (un)prepare calls for CCF
    ...

    Linus Torvalds
     

12 Oct, 2016

1 commit

  • Pull uaccess.h prepwork from Al Viro:
    "Preparations to tree-wide switch to use of linux/uaccess.h (which,
    obviously, will allow to start unifying stuff for real). The last step
    there, ie

    PATT='^[[:blank:]]*#[[:blank:]]*include[[:blank:]]*'
    sed -i -e "s!$PATT!#include !" \
    `git grep -l "$PATT"|grep -v ^include/linux/uaccess.h`

    is not taken here - I would prefer to do it once just before or just
    after -rc1. However, everything should be ready for it"

    * 'work.uaccess2' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
    remove a stray reference to asm/uaccess.h in docs
    sparc64: separate extable_64.h, switch elf_64.h to it
    score: separate extable.h, switch module.h to it
    mips: separate extable.h, switch module.h to it
    x86: separate extable.h, switch sections.h to it
    remove stray include of asm/uaccess.h from cacheflush.h
    mn10300: remove a bogus processor.h->uaccess.h include
    xtensa: split uaccess.h into C and asm sides
    bonding: quit messing with IOCTL
    kill __kernel_ds_p off
    mn10300: finish verify_area() off
    frv: move HAVE_ARCH_UNMAPPED_AREA to pgtable.h
    exceptions: detritus removal

    Linus Torvalds
     

08 Oct, 2016

7 commits

  • 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
     
  • Give devices which do not have hardware support for pretimeout at least a
    software version of it.

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

    Wolfram Sang
     
  • The change adds an option to a user with CONFIG_WATCHDOG_SYSFS and
    CONFIG_WATCHDOG_PRETIMEOUT_GOV enabled to get information about all
    registered watchdog pretimeout governors by reading watchdog device
    attribute named "pretimeout_available_governors".

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

    Vladimir Zapolskiy
     
  • The change converts watchdog device attribute "pretimeout_governor" from
    read-only to read-write type to allow users to select a desirable
    watchdog pretimeout governor in runtime, e.g.

    % echo -n panic > /sys/..../watchdog/watchdog0/pretimeout

    To get this working a list of registered pretimeout governors is created
    and a new helper function watchdog_pretimeout_governor_set() is exported
    to watchdog_dev.c.

    If a selected governor is gone, a watchdog device pretimeout notification
    is delegated to a default built-in pretimeout governor.

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

    Vladimir Zapolskiy
     
  • The change adds panic watchdog pretimeout governor, on watchdog
    pretimeout event the kernel shall panic. In general watchdog
    pretimeout event means that something essentially bad is going on the
    system, for example a process scheduler stalls or watchdog feeder is
    killed due to OOM, so printing out information attendant to panic and
    before likely unavoidable reboot caused by a watchdog may help to
    determine a root cause of the issue.

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

    Vladimir Zapolskiy
     
  • The change adds noop watchdog pretimeout governor, only an
    informational message is printed to the kernel log buffer when a
    watchdog triggers a pretimeout event.

    While introducing the first pretimeout governor the selected design
    assumes that the default pretimeout governor is selected by its name
    and it is always built-in, thus the default pretimeout governor can
    not be unregistered and the correspondent check can be removed from
    the watchdog_unregister_governor() function.

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

    Vladimir Zapolskiy
     
  • The change adds a simple watchdog pretimeout framework infrastructure,
    its purpose is to allow users to select a desired handling of watchdog
    pretimeout events, which may be generated by some watchdog devices.

    A user selects a default watchdog pretimeout governor during
    compilation stage.

    Watchdogs with WDIOF_PRETIMEOUT capability now have one more device
    attribute in sysfs, pretimeout_governor attribute is intended to display
    the selected watchdog pretimeout governor.

    The framework has no impact at runtime on watchdog devices with no
    WDIOF_PRETIMEOUT capability set.

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

    Vladimir Zapolskiy
     

06 Oct, 2016

1 commit


04 Oct, 2016

1 commit

  • Pull usb/phy/extcon updates from Greg KH:
    "Here is the big USB, and PHY, and extcon, patchsets for 4.9-rc1.

    Full details are in the shortlog, but generally a lot of new hardware
    support, usb gadget updates, and Wolfram's great cleanup of USB error
    message handling, making the kernel image a tad bit smaller.

    All of this has been in linux-next with no reported issues"

    * tag 'usb-4.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (343 commits)
    Revert "usbtmc: convert to devm_kzalloc"
    USB: serial: cp210x: Add ID for a Juniper console
    usb: Kconfig: using select for USB_COMMON dependency
    bluetooth: bcm203x: don't print error when allocating urb fails
    mmc: host: vub300: don't print error when allocating urb fails
    usb: hub: change CLEAR_FEATURE to SET_FEATURE
    usb: core: Introduce a USB port LED trigger
    USB: bcma: drop Northstar PHY 2.0 initialization code
    usb: core: hcd: add missing header dependencies
    usb: musb: da8xx: fix error handling message in probe
    usb: musb: Fix session based PM for first invalid VBUS
    usb: musb: Fix PM runtime for disconnect after unconfigure
    musb: Export musb_root_disconnect for use in modules
    usb: misc: legousbtower: Fix NULL pointer deference
    cdc-acm: hardening against malicious devices
    Revert "usb: gadget: NCM: Protect dev->port_usb using dev->lock"
    include: extcon: Fix compilation error caused because of incomplete merge
    MAINTAINERS: add tree entry for USB Serial
    phy-twl4030-usb: initialize charging-related stuff via pm_runtime
    phy-twl4030-usb: better handle musb_mailbox() failure
    ...

    Linus Torvalds
     

03 Oct, 2016

1 commit

  • iLO5 will offer the same watchdog timer as previous generations, but the
    PCI subsystem vendor ID will be PCI_VENDOR_ID_HP_3PAR (0x1590) instead of
    PCI_VENDOR_ID_HP (0x103c). Add 0x1590 to the whitelist and be more
    specific when ignoring the 103c,1979 device.

    Signed-off-by: Brian Boylston
    Reviewed-by: Guenter Roeck
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Brian Boylston
     

29 Sep, 2016

2 commits


24 Sep, 2016

14 commits

  • Since the watchdog framework centrializes the IOCTL interfaces of device
    drivers now, SETPRETIMEOUT and GETPRETIMEOUT need to be added in the
    common code.

    Signed-off-by: Robin Gong
    Signed-off-by: Wolfram Sang
    [vzapolskiy: added conditional pretimeout sysfs attribute visibility]
    Signed-off-by: Vladimir Zapolskiy
    Reviewed-by: Guenter Roeck
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Wolfram Sang
     
  • This is a nonfunctional change, declare register bit values with BIT()
    helper macro.

    The issues are reported by checkpatch:

    CHECK: Prefer using the BIT macro
    #40: FILE: drivers/watchdog/imx2_wdt.c:40:
    +#define IMX2_WDT_WCR_WDA (1 << 5) /* -> External Reset WDOG_B */

    etc.

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

    Vladimir Zapolskiy
     
  • STiH415/6 SoC support is being removed from the kernel.
    This patch updates the watchdog driver to remove references
    to these obsolete platforms.

    Signed-off-by: Peter Griffin
    Cc:
    Reviewed-by: Guenter Roeck
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Peter Griffin
     
  • Commit 0254e953537c ("watchdog: Drop pointer to watchdog device from
    struct watchdog_device") removed the dev pointer from struct
    watchdog_device, but this driver was still assigning it, leading to
    a compilation error:

    drivers/watchdog/mt7621_wdt.c: In function 'mt7621_wdt_probe':
    drivers/watchdog/mt7621_wdt.c:142:16: error:
    'struct watchdog_device' has no member named 'dev'

    Fix this by removing the assignment.

    Fixes: 0254e953537c ("watchdog: Drop pointer to watchdog device ...")
    Signed-off-by: Guenter Roeck
    Cc: stable@vger.kernel.org # v4.5+
    Signed-off-by: Wim Van Sebroeck

    Guenter Roeck
     
  • Commit 0254e953537c ("watchdog: Drop pointer to watchdog device from
    struct watchdog_device") removed the dev pointer from struct
    watchdog_device, but this driver was still assigning it, leading to a
    compilation error:

    drivers/watchdog/rt2880_wdt.c: In function ‘rt288x_wdt_probe’:
    drivers/watchdog/rt2880_wdt.c:161:16: error: ‘struct watchdog_device’
    has no member named ‘dev’
    rt288x_wdt_dev.dev = &pdev->dev;
    ^
    scripts/Makefile.build:289: recipe for target
    'drivers/watchdog/rt2880_wdt.o' failed

    Fix this by removing the assignment.

    Fixes: 0254e953537c ("watchdog: Drop pointer to watchdog device ...")
    Signed-off-by: Matt Redfearn
    Cc: stable@vger.kernel.org # v4.5+
    Reviewed-by: Guenter Roeck
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Matt Redfearn
     
  • Check for watchdog_ops structures that are only stored in the ops field of
    a watchdog_device structure. This field is declared const, so watchdog_ops
    structures that have this property can be declared as const also.

    The semantic patch that makes this change is as follows:
    (http://coccinelle.lip6.fr/)

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

    @ok@
    identifier r.i;
    struct watchdog_device e;
    position p;
    @@
    e.ops = &i@p;

    @bad@
    position p != {r.p,ok.p};
    identifier r.i;
    struct watchdog_ops e;
    @@
    e@i@p

    @depends on !bad disable optional_qualifier@
    identifier r.i;
    @@
    static
    +const
    struct watchdog_ops i = { ... };
    //

    Signed-off-by: Julia Lawall
    Reviewed-by: Guenter Roeck
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Julia Lawall
     
  • Check for watchdog_ops structures that are only stored in the ops field of
    a watchdog_device structure. This field is declared const, so watchdog_ops
    structures that have this property can be declared as const also.

    The semantic patch that makes this change is as follows:
    (http://coccinelle.lip6.fr/)

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

    @ok@
    identifier r.i;
    struct watchdog_device e;
    position p;
    @@
    e.ops = &i@p;

    @bad@
    position p != {r.p,ok.p};
    identifier r.i;
    struct watchdog_ops e;
    @@
    e@i@p

    @depends on !bad disable optional_qualifier@
    identifier r.i;
    @@
    static
    +const
    struct watchdog_ops i = { ... };
    //

    Signed-off-by: Julia Lawall
    Acked-by: Thierry Reding
    Reviewed-by: Guenter Roeck
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Julia Lawall
     
  • iTCO_wdt_pm, of type struct dev_pm_ops, is never modified, so declare it as
    const.

    Done with the help of Coccinelle.

    Signed-off-by: Julia Lawall
    Reviewed-by: Guenter Roeck
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Julia Lawall
     
  • Currently even if no users are there the suspend tries to
    stop the watchdog and resume starts it.

    so after resume the watchdog starts and resets the board.
    Fix the same by adding a check for users.

    Reviewed-by: Guenter Roeck
    Signed-off-by: Shubhrajyoti Datta
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Shubhrajyoti Datta
     
  • Starting from Intel Skylake the iTCO watchdog timer registers were moved to
    reside in the same register space with SMBus host controller. Not all
    needed registers are available though and we need to unhide P2SB (Primary
    to Sideband) device briefly to be able to read status of required NO_REBOOT
    bit. The i2c-i801.c SMBus driver used to handle this and creation of the
    iTCO watchdog platform device.

    Windows, on the other hand, does not use the iTCO watchdog hardware
    directly even if it is available. Instead it relies on ACPI Watchdog Action
    Table (WDAT) table to describe the watchdog hardware to the OS. This table
    contains necessary information about the the hardware and also set of
    actions which are executed by a driver as needed.

    This patch implements a new watchdog driver that takes advantage of the
    ACPI WDAT table. We split the functionality into two parts: first part
    enumerates the WDAT table and if found, populates resources and creates
    platform device for the actual driver. The second part is the driver
    itself.

    The reason for the split is that this way we can make the driver itself to
    be a module and loaded automatically if the WDAT table is found. Otherwise
    the module is not loaded.

    Signed-off-by: Mika Westerberg
    Reviewed-by: Guenter Roeck
    Signed-off-by: Rafael J. Wysocki

    Mika Westerberg
     
  • While the custom minimal TXx9 clock implementation doesn't need or use
    clock (un)prepare calls (they are dummies if !CONFIG_HAVE_CLK_PREPARE),
    they are mandatory when using the Common Clock Framework.

    Hence add them, to prepare for the advent of CCF.

    Signed-off-by: Geert Uytterhoeven
    Reviewed-by: Guenter Roeck
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Geert Uytterhoeven
     
  • The field "owner" is set by core. Thus delete an extra initialisation.

    Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci
    Signed-off-by: Markus Elfring
    Reviewed-by: Guenter Roeck
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Markus Elfring
     
  • This patch adds and entry to the sysfs to start firmware upload process
    on the specified device with the requested firmware.

    The uploading of the firmware needs only to happen once per firmware
    upgrade, as the firmware is stored in persistent storage. If the
    firmware upload or the firmware verification fails then we print and
    error message and exit.

    Signed-off-by: Enric Balletbo i Serra
    Reviewed-by: Guenter Roeck
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Enric Balletbo i Serra
     
  • Add support for the clock. Currently we enable
    at probe and relinquish at remove.

    Reviewed-by: Guenter Roeck
    Acked-by: Sören Brinkmann
    Signed-off-by: Shubhrajyoti Datta
    Acked-by: Rob Herring
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Shubhrajyoti Datta
     

23 Sep, 2016

3 commits

  • kmalloc will print enough information in case of failure.

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

    Wolfram Sang
     
  • Coverity reports:

    divide_by_zero: In expression readl(dw_wdt->regs + 8) /
    clk_get_rate(dw_wdt->clk), division by expression clk_get_rate(dw_wdt->clk)
    which may be zero has undefined behavior.

    The clock used for the watchdog timer won't change its rate, so read it
    only once during probe. Also validate it and abort the probe function
    with an error if it is 0.

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

    Guenter Roeck
     
  • Coverity reports:

    Passing argument 152UL /* sizeof (*wdd) */ to function __devres_alloc_node
    and then casting the return value to struct watchdog_device ** is
    suspicious.

    Allocation size needs to be sizeof(*rcwdd), not sizeof(*wdd).

    Fixes: 83fbae5a148c ("watchdog: Add a device managed API for ...")
    Cc: Neil Armstrong
    Signed-off-by: Guenter Roeck
    Acked-by: Neil Armstrong
    Signed-off-by: Wim Van Sebroeck

    Guenter Roeck
     

31 Aug, 2016

1 commit


27 Jul, 2016

1 commit


25 Jul, 2016

5 commits

  • WDOG_HW_RUNNING indicates that the hardware watchdog is running while the
    watchdog device is closed. The flag may be set by the driver when it is
    instantiated to indicate that the watchdog is running, and that the
    watchdog core needs to send heartbeat requests to the driver until the
    watchdog device is opened.

    When the watchdog device is closed, the flag can be used by the driver's
    stop function to indicate to the watchdog core that it was unable to stop
    the watchdog, and that the watchdog core needs to send heartbeat requests.
    This only works if the flag is actually cleared when the watchdog is
    stopped. To avoid having to clear the flag in each driver's stop function,
    clear it in the watchdog core before calling the stop function.

    Reported-by: Rasmus Villemoes
    Fixes: ee142889e32f ("watchdog: Introduce WDOG_HW_RUNNING flag")
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Guenter Roeck
     
  • Fix the error handling paths of watchdog_dev_init().

    Signed-off-by: Wei Yongjun
    Reviewed-by: Guenter Roeck
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Wei Yongjun
     
  • In case of error, the function devm_ioremap() returns NULL pointer
    not ERR_PTR(). The IS_ERR() test in the return value check should
    be replaced with NULL test.

    Signed-off-by: Wei Yongjun
    Reviewed-by: Guenter Roeck
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Wei Yongjun
     
  • Remove .owner field if calls are used which set it automatically.

    Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci

    Signed-off-by: Wei Yongjun
    Reviewed-by: Guenter Roeck
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Wei Yongjun
     
  • Remove .owner field if calls are used which set it automatically.

    Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci

    Signed-off-by: Wei Yongjun
    Reviewed-by: Guenter Roeck
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Wei Yongjun
     

19 Jul, 2016

2 commits

  • The watchdog status function is supposed to return WDIOF_ flags,
    not internal status flags. The available WDIOF_ flags are now
    returned by the watchdog core, so the status function in this driver
    is unnecessary.

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

    Guenter Roeck
     
  • Up to now, the watchdog status function called a driver function,
    which was supposed to return the watchdog status. All but one
    driver using the watchdog core did not implement this function,
    and the driver implementing it did not implement it correctly
    (the function is supposed to return WDIOF_ flags). At the same time,
    at least some of the status information can be provided by the watchdog
    core.

    Provide the available status bits directly from the watchdog driver core.
    Call the driver status function if it exists to get the boot status, but
    always provide WDIOF_MAGICCLOSE and WDIOF_KEEPALIVEPING internally.
    This patch makes the 'status' sysfs attribute always available.
    This attribute is now displayed as hex number with 0x prepended to be
    easier to decode.

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

    Guenter Roeck