From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5464EC77B7E for ; Sun, 28 May 2023 19:27:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230096AbjE1T1E (ORCPT ); Sun, 28 May 2023 15:27:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43944 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230101AbjE1T1D (ORCPT ); Sun, 28 May 2023 15:27:03 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7ABC81B4 for ; Sun, 28 May 2023 12:26:48 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 068A861C54 for ; Sun, 28 May 2023 19:26:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 245F4C433D2; Sun, 28 May 2023 19:26:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1685302007; bh=7eLY0e0u0n1cXrl+zwmS+i0aQaEpAcOHri/0Eqa7Yz4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pNyxi5ayjnT5l38Ghc5qgSA5mDlFPOBK4vD93k/YYBn3NhwT+iYE1Gk02MKyxJ3L2 q0UY1RD4N4YLhBof5mzs6uGz1LpYoFQ6uk7h7O6/c2NtXlDWTzrV+Iac4D/d5QNJSd 7b1OX7VFip+LksjeZsFgvyuRKH3zht+2x2EDcsvU= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Gregory Oakes , Guenter Roeck , Wim Van Sebroeck , Mario Limonciello Subject: [PATCH 5.4 123/161] watchdog: sp5100_tco: Immediately trigger upon starting. Date: Sun, 28 May 2023 20:10:47 +0100 Message-Id: <20230528190840.930555395@linuxfoundation.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230528190837.051205996@linuxfoundation.org> References: <20230528190837.051205996@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Gregory Oakes commit 4eda19cc8a29cde3580ed73bf11dc73b4e757697 upstream. The watchdog countdown is supposed to begin when the device file is opened. Instead, it would begin countdown upon the first write to or close of the device file. Now, the ping operation is called within the start operation which ensures the countdown begins. From experimenation, it does not appear possible to do this with a single write including both the start bit and the trigger bit. So, it is done as two distinct writes. Signed-off-by: Gregory Oakes Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20230316201312.17538-1-gregory.oakes@amd.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck Cc: Mario Limonciello Signed-off-by: Greg Kroah-Hartman --- drivers/watchdog/sp5100_tco.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/drivers/watchdog/sp5100_tco.c +++ b/drivers/watchdog/sp5100_tco.c @@ -98,6 +98,10 @@ static int tco_timer_start(struct watchd val |= SP5100_WDT_START_STOP_BIT; writel(val, SP5100_WDT_CONTROL(tco->tcobase)); + /* This must be a distinct write. */ + val |= SP5100_WDT_TRIGGER_BIT; + writel(val, SP5100_WDT_CONTROL(tco->tcobase)); + return 0; }