mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Wim Van Sebroeck <wim@iguana.be>
To: Guenter Roeck <linux@roeck-us.net>
Cc: linux-watchdog@vger.kernel.org,
	Pratyush Anand <panand@redhat.com>,
	Hans de Goede <hdegoede@redhat.com>,
	Damien Riegel <damien.riegel@savoirfairelinux.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 0/6] watchdog: Replace driver based refcounting
Date: Tue, 29 Dec 2015 21:00:42 +0100	[thread overview]
Message-ID: <20151229200042.GA12170@spo001.leaseweb.nl> (raw)
In-Reply-To: <1451088105-1722-1-git-send-email-linux@roeck-us.net>

Hi Guenter,

> 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. This mechanism was
> introduced with commit e907df327252 ("watchdog: Add support for
> dynamically allocated watchdog_device structs").
> 
> 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 the variables it uses 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.
> 
> The 'ref' and 'unref' callbacks in struct watchdog_driver are no longer
> used and marked as deprecated for the time being.
> 
> Patch 1/6 moves watchdog device creation from watchdog_core.c to
> watchdog_dev.c to simplify watchdog device handling.
> 
> Patch 2/6 modifies the diag288 watchdog to no longer use and overload
> watchdog core internal flags.
> 
> Patch 3/6 separates variables in watchdog_device based on variable
> lifetime.
> 
> Patch 4/6 to 6/6 remove existing ref/unref functions from the drivers
> implementing it. Two of those patches (for da9052 and da9055) fix a
> previously introduced bug as side effect.
> 
> The series applies on top of the current watchdog-next as well as the
> pending patches introducing sysfs support ("watchdog: Use static struct
> class watchdog_class in stead of pointer" and "watchdog: Read device
> status through sysfs attributes") by Pratyush Anand.
> 
> ---
> v2: Add patch 2/6.
>     Add more detailed description to patch 3/6.
>     Rename internal data structure to watchdog_core_data, and the variable
>     pointing to it to wd_data. Move its declaration into watchdog_dev.c.
>     Reorder include files in watchdog_dev.c to alphabetic order.
>     Remove _watchdog_ping helper function and call watchdog_ping()
>     directly. Handle locks in the calling code.
>     Drop locking from watchdog_open(). It is already protected against
>     parallel device removal in the driver core code, and file access
>     functions won't be called before the function returns.
>     Remove previously added message "watchdog still running". It wasn't
>     there before, and we should avoid user visible changes.
>     Add missing kfree() to the sch56xx patch.
>     Add comments to da9052 and da9055 patches indicating that the
>     patches fix a bug.

This patchset has been added to linux-watchdog-next.

Kind regards,
Wim.


      parent reply	other threads:[~2015-12-29 20:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-26  0:01 Guenter Roeck
2015-12-26  0:01 ` [PATCH v2 1/6] watchdog: Create watchdog device in watchdog_dev.c Guenter Roeck
2015-12-26  0:01 ` [PATCH v2 2/6] watchdog: diag288: Stop re-using watchdog core internal flags Guenter Roeck
2015-12-26  0:01 ` [PATCH v2 3/6] watchdog: Separate and maintain variables based on variable lifetime Guenter Roeck
2015-12-26  0:01 ` [PATCH v2 4/6] watchdog: da9052_wdt: Drop reference counting Guenter Roeck
2015-12-26  0:01 ` [PATCH v2 5/6] watchdog: da9055_wdt: " Guenter Roeck
2015-12-26  0:01 ` [PATCH v2 6/6] hwmon: (sch56xx) Drop watchdog driver data reference count callbacks Guenter Roeck
2015-12-29 20:00 ` Wim Van Sebroeck [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151229200042.GA12170@spo001.leaseweb.nl \
    --to=wim@iguana.be \
    --cc=damien.riegel@savoirfairelinux.com \
    --cc=hdegoede@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=panand@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®