1. 29 Dec, 2015 4 commits
    • Guenter Roeck's avatar
      watchdog: da9052_wdt: Drop reference counting · 756d1e92
      Guenter Roeck authored
      Reference counting is now implemented in the watchdog core and no longer
      required in watchdog drivers.
      
      Since it was implememented a no-op, and since the local memory is allocated
      with devm_kzalloc(), the reference counting code in the driver really did
      not really work anyway, and this patch effectively fixes a bug which could
      cause a crash on unloading if the watchdog device was still open.
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: default avatarWim Van Sebroeck <wim@iguana.be>
      756d1e92
    • Guenter Roeck's avatar
      watchdog: Separate and maintain variables based on variable lifetime · b4ffb190
      Guenter Roeck authored
      All variables required by the watchdog core to manage a watchdog are
      currently stored in struct watchdog_device. The lifetime of those
      variables is determined by the watchdog driver. However, the lifetime
      of variables used by the watchdog core differs from the lifetime of
      struct watchdog_device. To remedy this situation, watchdog drivers
      can implement ref and unref callbacks, to be used by the watchdog
      core to lock struct watchdog_device in memory.
      
      While this solves the immediate problem, it depends on watchdog drivers
      to actually implement the ref/unref callbacks. This is error prone,
      often not implemented in the first place, or not implemented correctly.
      
      To solve the problem without requiring driver support, split the variables
      in struct watchdog_device into two data structures - one for variables
      associated with the watchdog driver, one for variables associated with
      the watchdog core. With this approach, the watchdog core can keep track
      of its variable lifetime and no longer depends on ref/unref callbacks
      in the driver. As a side effect, some of the variables originally in
      struct watchdog_driver are now private to the watchdog core and no longer
      visible in watchdog drivers.
      
      As a side effect of the changes made, an ioctl will now always fail
      with -ENODEV after a watchdog device was unregistered with the character
      device still open. Previously, it would only fail with -ENODEV in some
      situations. Also, ioctl operations are now atomic from driver perspective.
      With this change, it is now guaranteed that the driver will not unregister
      a watchdog between a timeout change and the subsequent ping.
      
      The 'ref' and 'unref' callbacks in struct watchdog_driver are no longer
      used and marked as deprecated.
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: default avatarWim Van Sebroeck <wim@iguana.be>
      b4ffb190
    • Guenter Roeck's avatar
      watchdog: diag288: Stop re-using watchdog core internal flags · e7d162fa
      Guenter Roeck authored
      A watchdog driver should not use watchdog subsystem internal flags.
      Use a driver variable and flag instead to maintain the watchdog state
      and to determine if a suspend operation is possible or not.
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: default avatarWim Van Sebroeck <wim@iguana.be>
      e7d162fa
    • Guenter Roeck's avatar
      watchdog: Create watchdog device in watchdog_dev.c · 32ecc639
      Guenter Roeck authored
      The watchdog character device is currently created in watchdog_dev.c,
      and the watchdog device in watchdog_core.c. This results in
      cross-dependencies, since device creation needs to know the watchdog
      character device number as well as the watchdog class, both of which
      reside in watchdog_dev.c.
      
      Create the watchdog device in watchdog_dev.c to simplify the code.
      
      Inspired by earlier patch set from Damien Riegel.
      
      Cc: Damien Riegel <damien.riegel@savoirfairelinux.com>
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: default avatarWim Van Sebroeck <wim@iguana.be>
      32ecc639
  2. 28 Dec, 2015 16 commits
  3. 27 Dec, 2015 11 commits
  4. 13 Dec, 2015 9 commits