Received: by 2002:ab2:7a55:0:b0:1f4:4a7d:290d with SMTP id u21csp668619lqp; Fri, 5 Apr 2024 05:40:40 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXXegfOmSq9qkXvY8Z0AwHyQCG3c8bGYEsuw6GzXeFEJFG0b9AXpEh2WMKsco1IGGAAO/CZ1E9v2IE7n156eJug5nBMuL3gFDzrk6GmVA== X-Google-Smtp-Source: AGHT+IGao/IaksjsclMChkQfYvshT1KYxGXgVYMokhgLhrzC1u9cmpdntMchqzBan18SaSNOr/rZ X-Received: by 2002:a05:6359:5590:b0:17b:f637:7bb with SMTP id ny16-20020a056359559000b0017bf63707bbmr1951121rwb.30.1712320839945; Fri, 05 Apr 2024 05:40:39 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712320839; cv=pass; d=google.com; s=arc-20160816; b=0YEFSAkFV92JPl71FNof95foJIblx09ngAVoO/QBXzGKx47wGCKRXLn1xZ8uq76Y1N Y7R/BuK4PtJILZRlkm8sAbQ60pwZtUzXRVwHIsJqId2/k2e7SA3fYLW61GzdZj8zUiLV XLn7xoRuPJrZ1TJKUf0CB3gY8KwL55+EPijIR7NVpBeUoyT/KXFi+Cwu1HV61RyaiqSw 25H8hlKjLe31Hq8F2pousImMW40Ei/LZMyPRfyQIjSR2EBTLQ68YXXAfpHYA/Le3qEZ+ F1wLtwq5HvmyGWg7BpOKMVTcwk0bp/VuQWWupS8JQEWz9VfUj7R5MV1wkQ31omc3QZvM ZQuA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:feedback-id :dkim-signature:dkim-signature; bh=9yZNkFVecyVcwhuRWOOXDSmgJ0AyNeDXvYjOa+3vzUY=; fh=h9bg0XHS/00zs4/s1Kmp+c1IOx72uacwqVdEaObOV+E=; b=ytILCuJ3LUYQjiTW0TkOsp9iID29xBvcow4eug7mNLS1UAnyTzAThdRnIowNvJUeza cfLv1kFWan4+PB4Hc+8y1sICL5akOWtJUfm9J7ATgnr0CB7tEgt3+E1lmvpe1oT1CIEt 4LRK8k72Kypf/UBhxR4jSVBYq+6/TXRsQlCzQHnPSJv2FUi2W9kn4Wy9KROcpXOC7zv2 Vvy6aCOEczUlKGk734P4AI/Ll1/5X/CtLmyGv64CL8VOGGPMqF7MI5DvrG4eHtxJKI6B vbl9Th5yrzkxnBdc54wPp6WB9lBlaKrAst5DEoQIWKtbZjDnH5uvWDagKR7S+SDiMD21 HIYw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@beims.me header.s=fm2 header.b="yo6V/mDP"; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=XR7uKliT; arc=pass (i=1 spf=pass spfdomain=beims.me dkim=pass dkdomain=beims.me dkim=pass dkdomain=messagingengine.com dmarc=pass fromdomain=beims.me); spf=pass (google.com: domain of linux-kernel+bounces-133002-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-133002-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=beims.me Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id h5-20020a636c05000000b005dc4da211fdsi1326391pgc.141.2024.04.05.05.40.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Apr 2024 05:40:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-133002-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@beims.me header.s=fm2 header.b="yo6V/mDP"; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=XR7uKliT; arc=pass (i=1 spf=pass spfdomain=beims.me dkim=pass dkdomain=beims.me dkim=pass dkdomain=messagingengine.com dmarc=pass fromdomain=beims.me); spf=pass (google.com: domain of linux-kernel+bounces-133002-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-133002-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=beims.me Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id C46D2B21B2C for ; Fri, 5 Apr 2024 12:38:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2B94115FA66; Fri, 5 Apr 2024 12:38:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=beims.me header.i=@beims.me header.b="yo6V/mDP"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="XR7uKliT" Received: from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com [64.147.123.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 59A081DFE4; Fri, 5 Apr 2024 12:38:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=64.147.123.25 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712320687; cv=none; b=ZZjxsmG8uqkuRudwL07SYZJEOGePN378ybsLkMmza2R0L8L55wb/4nhxJSL21Oqxm9xiyq8hCT9HhjpsV2WIcL6VkGtjVofc9nudmSqP1MzfDUNMvkTfnPnDcFnB5NbCr7cJXgEQoj49OwncBhHPIo3pTA/baSvRgUlxPEPSkwo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712320687; c=relaxed/simple; bh=mXnXA9x4NmE809L3U4eMhTHrd1MAnRHvb+EIUqVwVp4=; h=Message-ID:Date:MIME-Version:Subject:To:References:From: In-Reply-To:Content-Type; b=LB+ThZMTcBXLR3P3FX0BIulH7VOb9sA7zV5ju4sYODz9LxNkDGj4EZWv0SE5ppaswIL7KdRx53GirH6W867+xfgs2hCkueBsIlNNLzUvCiNIjLCUqnBWimKBfvrK4/X9aMyl/vfx5Em7y48TrGUAaSRjkZ0socBmJudh1AeE9lY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=beims.me; spf=pass smtp.mailfrom=beims.me; dkim=pass (2048-bit key) header.d=beims.me header.i=@beims.me header.b=yo6V/mDP; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=XR7uKliT; arc=none smtp.client-ip=64.147.123.25 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=beims.me Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=beims.me Received: from compute7.internal (compute7.nyi.internal [10.202.2.48]) by mailout.west.internal (Postfix) with ESMTP id D092932003D3; Fri, 5 Apr 2024 08:38:02 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Fri, 05 Apr 2024 08:38:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=beims.me; h=cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1712320682; x=1712407082; bh=9yZNkFVecyVcwhuRWOOXDSmgJ0AyNeDXvYjOa+3vzUY=; b= yo6V/mDPxcaesGpYwKN7NilaBjW8TDQzbJHV6dR6PXUyQE+KVO4EqskWHPse/HJJ 3jdDJPdOCWdV/zObaaHuq9EsTV1cP/xgfUBny7QSHrpVC+09/oomxs4113zQP34s YRsRuoLxcvtIlYifbLcVPKo8toznDYchSqvC4c2MAkunx7BAXJMuJFyvFHPQwyrR JvJfD32vWQCJp2zSjDK6s4EwNL+KQE8Bgk5oNJ013OmSKksi4lGtXypBKOSmvM3w Q3g9Z6peViCVbkr1mvBxBDltadzjya8+qb+r2DXVp67VzZ7qDGd/XEsskdJdDmYH FWFpOBqrenepwcVjyQw6Tw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1712320682; x= 1712407082; bh=9yZNkFVecyVcwhuRWOOXDSmgJ0AyNeDXvYjOa+3vzUY=; b=X R7uKliTKPNFdeXBUaphD0b13JnZc8hwIMv5yv9YTKIoGyOgrMrOryWOqR+DurFlp +vs+/pM6GPryMg3YGKhIKGJy9RbiAiYmAJ9QRZ57/M2dhtsUxY8UAZqA2f/+2VPa IM3qTEEnx7/BuTvhhdGqBpT17FULVVHdyCwrQXblRcHH4jMcPOj5eqtTnQ0XWB8j ZMCuhYsROOFK0mSbKqt/tiKo6QHB1TnCE1jJWIkg9XTzEEIMcrtqjvbWlsIpyjka nAL2CCZbc5GBptJoqOk83hmLJJEZUhIK7/8+u1syC//GuEq9UcCfahDoznvwc1/F WukmQ5Ot7Lr4/187woAhQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudegtddgheehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvfhfhjggtgfesthejredttddvjeenucfhrhhomheptfgrfhgr vghluceuvghimhhsuceorhgrfhgrvghlsegsvghimhhsrdhmvgeqnecuggftrfgrthhtvg hrnhepleehtdfhiefgieethfetgeegudehgeejuedujedvfeduveetheevtdfgudfhueel necuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprhgrfh grvghlsegsvghimhhsrdhmvg X-ME-Proxy: Feedback-ID: idc214666:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 5 Apr 2024 08:38:00 -0400 (EDT) Message-ID: <9fe44ea8-3e60-4bac-9362-63a3138f1493@beims.me> Date: Fri, 5 Apr 2024 09:37:57 -0300 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] watchdog: rti_wdt: Set min_hw_heartbeat_ms to accommodate 5% safety margin Content-Language: en-US To: Judith Mendez , Wim Van Sebroeck , Guenter Roeck , linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org References: <20240403212426.582727-1-jm@ti.com> From: Rafael Beims In-Reply-To: <20240403212426.582727-1-jm@ti.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 03/04/2024 18:24, Judith Mendez wrote: > On AM62x, the watchdog is pet before the valid window > is open. Fix min_hw_heartbeat and accommodate a 5% safety > margin with the exception of open window size < 10%, > which shall use <5% due to the smaller open window size. > > Signed-off-by: Judith Mendez > --- > drivers/watchdog/rti_wdt.c | 24 +++++++++++++----------- > 1 file changed, 13 insertions(+), 11 deletions(-) > > diff --git a/drivers/watchdog/rti_wdt.c b/drivers/watchdog/rti_wdt.c > index 8e1be7ba0103..0b16ada659cc 100644 > --- a/drivers/watchdog/rti_wdt.c > +++ b/drivers/watchdog/rti_wdt.c > @@ -92,7 +92,7 @@ static int rti_wdt_start(struct watchdog_device *wdd) > * to be 50% or less than that; we obviouly want to configure the open > * window as large as possible so we select the 50% option. > */ > - wdd->min_hw_heartbeat_ms = 500 * wdd->timeout; > + wdd->min_hw_heartbeat_ms = 550 * wdd->timeout; > > /* Generate NMI when wdt expires */ > writel_relaxed(RTIWWDRX_NMI, wdt->base + RTIWWDRXCTRL); > @@ -126,31 +126,33 @@ static int rti_wdt_setup_hw_hb(struct watchdog_device *wdd, u32 wsize) > * be petted during the open window; not too early or not too late. > * The HW configuration options only allow for the open window size > * to be 50% or less than that. > + * To avoid any glitches, we accommodate 5% safety margin, with the > + * exception of open window size < 10%. > */ > switch (wsize) { > case RTIWWDSIZE_50P: > - /* 50% open window => 50% min heartbeat */ > - wdd->min_hw_heartbeat_ms = 500 * heartbeat; > + /* 50% open window => 55% min heartbeat */ > + wdd->min_hw_heartbeat_ms = 550 * heartbeat; > break; > > case RTIWWDSIZE_25P: > - /* 25% open window => 75% min heartbeat */ > - wdd->min_hw_heartbeat_ms = 750 * heartbeat; > + /* 25% open window => 80% min heartbeat */ > + wdd->min_hw_heartbeat_ms = 800 * heartbeat; > break; > > case RTIWWDSIZE_12P5: > - /* 12.5% open window => 87.5% min heartbeat */ > - wdd->min_hw_heartbeat_ms = 875 * heartbeat; > + /* 12.5% open window => 92.5% min heartbeat */ > + wdd->min_hw_heartbeat_ms = 925 * heartbeat; > break; > > case RTIWWDSIZE_6P25: > - /* 6.5% open window => 93.5% min heartbeat */ > - wdd->min_hw_heartbeat_ms = 935 * heartbeat; > + /* 6.5% open window => 96.5% min heartbeat */ > + wdd->min_hw_heartbeat_ms = 965 * heartbeat; > break; > > case RTIWWDSIZE_3P125: > - /* 3.125% open window => 96.9% min heartbeat */ > - wdd->min_hw_heartbeat_ms = 969 * heartbeat; > + /* 3.125% open window => 97.9% min heartbeat */ > + wdd->min_hw_heartbeat_ms = 979 * heartbeat; > break; > > default: I tested this patch by enabling the systemd watchdog adding RuntimeWatchdogSec=30 to system.conf on a Verdin AM62. This setup causes watchdog resets without the patch, and with the patch applied I didn't see any watchdog related reboots. Tested-by: Rafael Beims Rafael