From patchwork Thu Apr 11 19:14:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Belloni X-Patchwork-Id: 10896713 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 4BA851669 for ; Thu, 11 Apr 2019 19:14:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 35A7928D36 for ; Thu, 11 Apr 2019 19:14:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 294B728D78; Thu, 11 Apr 2019 19:14:46 +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 AD29328D36 for ; Thu, 11 Apr 2019 19:14:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726667AbfDKTOm (ORCPT ); Thu, 11 Apr 2019 15:14:42 -0400 Received: from relay5-d.mail.gandi.net ([217.70.183.197]:59853 "EHLO relay5-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726538AbfDKTOm (ORCPT ); Thu, 11 Apr 2019 15:14:42 -0400 X-Originating-IP: 90.66.53.80 Received: from localhost (lfbn-1-3034-80.w90-66.abo.wanadoo.fr [90.66.53.80]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id D531E1C000C; Thu, 11 Apr 2019 19:14:38 +0000 (UTC) From: Alexandre Belloni To: Guenter Roeck , Vladimir Zapolskiy Cc: Wim Van Sebroeck , Sylvain Lemieux , Gregory Clement , linux-arm-kernel@lists.infradead.org, linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org, Alexandre Belloni Subject: [PATCH v2] watchdog: pnx4008: readout watchdog state Date: Thu, 11 Apr 2019 21:14:37 +0200 Message-Id: <20190411191437.12173-1-alexandre.belloni@bootlin.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Sender: linux-watchdog-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-watchdog@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Readout the enabled state so it is possible to get the pre-userspace handler working. Also, avoid disabling the watchdog to ensure it continues working and triggers if there is an issue later in the boot or if userspace fails to start. Signed-off-by: Alexandre Belloni Reviewed-by: Guenter Roeck Tested-by: Gregory CLEMENT --- drivers/watchdog/pnx4008_wdt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/watchdog/pnx4008_wdt.c b/drivers/watchdog/pnx4008_wdt.c index 8e261799c84e..4ce0389d1442 100644 --- a/drivers/watchdog/pnx4008_wdt.c +++ b/drivers/watchdog/pnx4008_wdt.c @@ -209,7 +209,8 @@ static int pnx4008_wdt_probe(struct platform_device *pdev) watchdog_set_nowayout(&pnx4008_wdd, nowayout); watchdog_set_restart_priority(&pnx4008_wdd, 128); - pnx4008_wdt_stop(&pnx4008_wdd); /* disable for now */ + if (readl(WDTIM_CTRL(wdt_base)) & COUNT_ENAB) + set_bit(WDOG_HW_RUNNING, &pnx4008_wdd.status); ret = watchdog_register_device(&pnx4008_wdd); if (ret < 0) {