All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wolfram Sang <wsa@the-dreams.de>
To: linux-watchdog@vger.kernel.org
Cc: linux-renesas-soc@vger.kernel.org,
	Wolfram Sang <wsa@the-dreams.de>,
	Wolfram Sang <wsa+renesas@sang-engineering.com>
Subject: [RFC PATCH] watchdog: HACK: disable bind attributes with NOWAYOUT
Date: Tue, 28 Aug 2018 12:29:06 +0200	[thread overview]
Message-ID: <20180828102906.12840-1-wsa@the-dreams.de> (raw)

With NOWAYOUT, prevent bind/unbind possibilities in SYSFS.
Proof-of-concept, not for upstream yet.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---

So, this is really an RFC to check if something like this is considered useful
or not. If so, we probably need to do it differently because modifying the
parent's driver is likely a layering violation. We could add the driver to
modify as an optional parameter to watchdog_set_nowayout(). I wouldn't favor
another seperate function to configure this, but am open for discussion.

Thanks,

   Wolfram

 include/linux/watchdog.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/include/linux/watchdog.h b/include/linux/watchdog.h
index 44985c4a1e86..241de0fa0010 100644
--- a/include/linux/watchdog.h
+++ b/include/linux/watchdog.h
@@ -143,8 +143,10 @@ static inline bool watchdog_hw_running(struct watchdog_device *wdd)
 /* Use the following function to set the nowayout feature */
 static inline void watchdog_set_nowayout(struct watchdog_device *wdd, bool nowayout)
 {
-	if (nowayout)
+	if (nowayout) {
 		set_bit(WDOG_NO_WAY_OUT, &wdd->status);
+		wdd->parent->driver->suppress_bind_attrs = true;
+	}
 }
 
 /* Use the following function to stop the watchdog on reboot */
-- 
2.11.0

             reply	other threads:[~2018-08-28 14:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-28 10:29 Wolfram Sang [this message]
2018-08-28 14:03 ` [RFC PATCH] watchdog: HACK: disable bind attributes with NOWAYOUT Guenter Roeck
2018-08-28 14:18   ` Wolfram Sang
2018-08-28 16:37     ` Wolfram Sang

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=20180828102906.12840-1-wsa@the-dreams.de \
    --to=wsa@the-dreams.de \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=wsa+renesas@sang-engineering.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.