From patchwork Tue Apr 28 18:22:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 226945 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0C5D8C83007 for ; Tue, 28 Apr 2020 18:26:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E2B302085B for ; Tue, 28 Apr 2020 18:26:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588098415; bh=ddR3lY7X7Py94OEnLYZZsrm3gr2MaNXEqKJZwflfaEg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=sYTI3FhGruh93hZHKjLVbYtbB6SuGIyf3GG0tuuufvqscq8/iO0zzD54MZMLukRMv l1NswTAIaHWrKRmO3vENQE+1onql68J4b/hRgMTPRbhmyuX/zvIRJvjjdI40H7PJk5 8P748kWrZeswFNo+kOdGW0pUe689gr5bBpaDJKKc= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728852AbgD1S0z (ORCPT ); Tue, 28 Apr 2020 14:26:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:38736 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728850AbgD1S0y (ORCPT ); Tue, 28 Apr 2020 14:26:54 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 08D8E20B80; Tue, 28 Apr 2020 18:26:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588098414; bh=ddR3lY7X7Py94OEnLYZZsrm3gr2MaNXEqKJZwflfaEg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=R/9nDNxl+7Xf+hTDEFDkqiOcWFxa78+xeAFy6MpQRg5pkEgYi43PbfYsPvlSBqLjm pr4SofjIAaEgqQQ7/SmWkyViukFgvXmScgSU3NCAJmmL+zBQO279u9ZpW/RhcjxU9k V4OeonkK357Px+jWflWjFLgqfMBqPrbG2zO8n98I= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tero Kristo , Guenter Roeck , Wim Van Sebroeck , Sasha Levin Subject: [PATCH 5.6 003/167] watchdog: reset last_hw_keepalive time at start Date: Tue, 28 Apr 2020 20:22:59 +0200 Message-Id: <20200428182225.838482997@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200428182225.451225420@linuxfoundation.org> References: <20200428182225.451225420@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Tero Kristo [ Upstream commit 982bb70517aef2225bad1d802887b733db492cc0 ] Currently the watchdog core does not initialize the last_hw_keepalive time during watchdog startup. This will cause the watchdog to be pinged immediately if enough time has passed from the system boot-up time, and some types of watchdogs like K3 RTI does not like this. To avoid the issue, setup the last_hw_keepalive time during watchdog startup. Signed-off-by: Tero Kristo Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20200302200426.6492-3-t-kristo@ti.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck Signed-off-by: Sasha Levin --- drivers/watchdog/watchdog_dev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/watchdog/watchdog_dev.c b/drivers/watchdog/watchdog_dev.c index 8b5c742f24e81..7e4cd34a8c20e 100644 --- a/drivers/watchdog/watchdog_dev.c +++ b/drivers/watchdog/watchdog_dev.c @@ -282,6 +282,7 @@ static int watchdog_start(struct watchdog_device *wdd) if (err == 0) { set_bit(WDOG_ACTIVE, &wdd->status); wd_data->last_keepalive = started_at; + wd_data->last_hw_keepalive = started_at; watchdog_update_worker(wdd); }