From patchwork Sat Feb 12 02:10:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Valentin X-Patchwork-Id: 12744182 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E0FAAC433EF for ; Sat, 12 Feb 2022 02:12:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:CC :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=9O+a9zzuCO+gR8P9PoOhcGZ5pkYq8SC0EkP2IQwqyYA=; b=LYt7gXnObJ+VEQ dV1Nq1fRE1P66n+Cgh7Ed/EBeKG97yaqpSu2687qhyw890kyjwXvgK9l1tnwRXpFb+yqUihswOAKN LGwT+QsBI3BLj9LJ8XxEXUrD9XIA9LK9raCOHUXlDz/rbvQTSlH2KLQXB+NSJfz+1ym70p3gWbCJ8 8jM8IYCbIa9Kq1Nzn1dZPNMBK5M3RBPjHUMHCNRgBe97IRF3wkKFYO8X78cFVMgGA5c6YIbN9QTxL UodQ+XhjUKfmGPohnP1h+a45UWttoM711l/ySuYcfNvcCh6VWTfmrwSsM4pdQ9UUgq+0mIXRGEa8h gZ6rCO33kHYOsEstF4mw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nIhsX-009INM-4H; Sat, 12 Feb 2022 02:11:13 +0000 Received: from smtp-fw-33001.amazon.com ([207.171.190.10]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nIhsT-009IM2-4z for linux-arm-kernel@lists.infradead.org; Sat, 12 Feb 2022 02:11:10 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1644631870; x=1676167870; h=from:to:cc:subject:date:message-id:mime-version; bh=ZdFF+bThzOqaGF0GLmUjP5ltWoniFt4/T378NNzf4jM=; b=OaebrGJkXDXbBxGtmfbKtIHSwThqktcANt6ENzAq2/XEcvwIzbVzlxqg aihdA5XSHVz529JqHkK8F9a9bSnT/bmHUXENZg90dkcGiaKdiHI0r31pg 6pIh3SztT4hD6eLZnN1j+ET8mlRluwjZq0bStcbn/6S6U5UUdNA5fvS/W Q=; X-IronPort-AV: E=Sophos;i="5.88,361,1635206400"; d="scan'208";a="175587638" Received: from iad12-co-svc-p1-lb1-vlan2.amazon.com (HELO email-inbound-relay-pdx-2c-a264e6fe.us-west-2.amazon.com) ([10.43.8.2]) by smtp-border-fw-33001.sea14.amazon.com with ESMTP; 12 Feb 2022 02:11:05 +0000 Received: from EX13MTAUWB001.ant.amazon.com (pdx1-ws-svc-p6-lb9-vlan2.pdx.amazon.com [10.236.137.194]) by email-inbound-relay-pdx-2c-a264e6fe.us-west-2.amazon.com (Postfix) with ESMTPS id 4957D419DC; Sat, 12 Feb 2022 02:11:04 +0000 (UTC) Received: from EX13D05UWB001.ant.amazon.com (10.43.161.181) by EX13MTAUWB001.ant.amazon.com (10.43.161.207) with Microsoft SMTP Server (TLS) id 15.0.1497.28; Sat, 12 Feb 2022 02:11:04 +0000 Received: from EX13MTAUWB001.ant.amazon.com (10.43.161.207) by EX13D05UWB001.ant.amazon.com (10.43.161.181) with Microsoft SMTP Server (TLS) id 15.0.1497.28; Sat, 12 Feb 2022 02:11:03 +0000 Received: from localhost (10.106.101.26) by mail-relay.amazon.com (10.43.161.249) with Microsoft SMTP Server id 15.0.1497.28 via Frontend Transport; Sat, 12 Feb 2022 02:11:03 +0000 From: Eduardo Valentin To: , Wim Van Sebroeck , "Guenter Roeck" CC: Joel Stanley , Andrew Jeffery , , , , , "Eduardo Valentin" Subject: [PATCH 1/1] watchdog: aspeed: add nowayout support Date: Fri, 11 Feb 2022 18:10:33 -0800 Message-ID: <20220212021033.2344-1-eduval@amazon.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Precedence: Bulk X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220211_181109_257840_9811BA0A X-CRM114-Status: GOOD ( 12.52 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add support for not stopping the watchdog when the userspace application quits. At closing of the device, the driver cannot determine if this was a graceful closure or if the app crashed. If the support of nowayout on this driver, the system integrator can select the behaviour by setting the kernel config and enabling it. Cc: Wim Van Sebroeck (maintainer:WATCHDOG DEVICE DRIVERS) Cc: Guenter Roeck (maintainer:WATCHDOG DEVICE DRIVERS) Cc: Joel Stanley (supporter:ARM/ASPEED MACHINE SUPPORT) Cc: Andrew Jeffery (reviewer:ARM/ASPEED MACHINE SUPPORT) Cc: linux-watchdog@vger.kernel.org (open list:WATCHDOG DEVICE DRIVERS) Cc: linux-arm-kernel@lists.infradead.org (moderated list:ARM/ASPEED MACHINE SUPPORT) Cc: linux-aspeed@lists.ozlabs.org (moderated list:ARM/ASPEED MACHINE SUPPORT) Cc: linux-kernel@vger.kernel.org (open list) Signed-off-by: Eduardo Valentin Signed-off-by: Eduardo Valentin Reviewed-by: Guenter Roeck --- drivers/watchdog/aspeed_wdt.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/watchdog/aspeed_wdt.c b/drivers/watchdog/aspeed_wdt.c index 436571b6fc79..bd06622813eb 100644 --- a/drivers/watchdog/aspeed_wdt.c +++ b/drivers/watchdog/aspeed_wdt.c @@ -13,6 +13,11 @@ #include #include +static bool nowayout = WATCHDOG_NOWAYOUT; +module_param(nowayout, bool, 0); +MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" + __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); + struct aspeed_wdt { struct watchdog_device wdd; void __iomem *base; @@ -266,6 +271,8 @@ static int aspeed_wdt_probe(struct platform_device *pdev) wdt->wdd.timeout = WDT_DEFAULT_TIMEOUT; watchdog_init_timeout(&wdt->wdd, 0, dev); + watchdog_set_nowayout(&wdt->wdd, nowayout); + np = dev->of_node; ofdid = of_match_node(aspeed_wdt_of_table, np);