From patchwork Tue Aug 28 10:29:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 10578165 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 083D9139B for ; Tue, 28 Aug 2018 10:29:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E415A297CB for ; Tue, 28 Aug 2018 10:29:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D7DCC297D4; Tue, 28 Aug 2018 10:29:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 375A4297CB for ; Tue, 28 Aug 2018 10:29:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727209AbeH1OUP (ORCPT ); Tue, 28 Aug 2018 10:20:15 -0400 Received: from sauhun.de ([88.99.104.3]:39146 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727177AbeH1OUO (ORCPT ); Tue, 28 Aug 2018 10:20:14 -0400 Received: from localhost (p54B335A5.dip0.t-ipconnect.de [84.179.53.165]) by pokefinder.org (Postfix) with ESMTPSA id C5B2632F580; Tue, 28 Aug 2018 12:29:14 +0200 (CEST) From: Wolfram Sang To: linux-watchdog@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, Wolfram Sang , Wolfram Sang Subject: [RFC PATCH] watchdog: HACK: disable bind attributes with NOWAYOUT Date: Tue, 28 Aug 2018 12:29:06 +0200 Message-Id: <20180828102906.12840-1-wsa@the-dreams.de> X-Mailer: git-send-email 2.11.0 Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP With NOWAYOUT, prevent bind/unbind possibilities in SYSFS. Proof-of-concept, not for upstream yet. Signed-off-by: Wolfram Sang --- 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 */