Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp834943pxb; Fri, 16 Apr 2021 21:24:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwjvZzR18uh1FPCI43U11ozCqKYjSVBJKzRmrh4F8lNX4ht1EmGDcf/yGkgr7vVhsAw2i6r X-Received: by 2002:a17:906:46d6:: with SMTP id k22mr11140949ejs.243.1618633462778; Fri, 16 Apr 2021 21:24:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618633462; cv=none; d=google.com; s=arc-20160816; b=QzJ3o5KMWNkHmHyRi1C4KonCwjBmnCFn3NOv72gQ425mq5g2hxwU+/y7tmUInH4Od4 +Hn5SbakRG6vgKcMEiblj6Ep/u32A5lchq6zR+Xi29pfRzpyuNU7xNDaKvv7by4yJSnl GdpFLnyjTFJtkQkbBiKTmXMM/xK5Buo+CMO6Vp0h8Q+TvHJ0HvlNicj9KAL2foAAwN+J FsXybnKhU7c614Gd8byS8ZqWg9lykD6Mzov2KCZ8nnShlMGsNMaTtx6hjxsRMvHJco22 p/dW4D90IavamsAM8MAM10H6Kx7xBSQl1JtTE3k1SiVVVL27RqzauadD7Qh1nCVV246a d/Bg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:sender :dkim-signature; bh=Yf4cGa1gDUioK7Tp5qZNGmRyNKmLAms5q26b5QKwv4I=; b=HHsBOPYv7EHI0HaeAMQ9gcq088mrnXJXiUdGvIKT/A4vVJYqI8I2iUj/jXS9X7x+Zt ksoX+DlVkP2b9h3d9V9Hy/ohI35mM6jMokaBuDwCuUiQQAp+Hmx51VZpwUrXRwgjsrjI nG+JRbUAXfM3H6Jeeu+7DDn7mfHEAOeS/KrFeawIChR1C8zuD0tRoqPfyi9b8trVkJkA 2XlGG9x2BjLyRC1h0FdnIJh213yKqi/oDXR4nU/hsPi3S+yomqxUK5JfXqPY0/qUE3ZC 92q+fEkzoEfHBXBukxyorkkQs7YZs1sB83Sc8D/gIU9ReckPHIA/HWTvf0sIv29wpOZc CXCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=piQInaLB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qt4si3321390ejb.126.2021.04.16.21.23.58; Fri, 16 Apr 2021 21:24:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=piQInaLB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230339AbhDQEVS (ORCPT + 99 others); Sat, 17 Apr 2021 00:21:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56816 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229465AbhDQEVR (ORCPT ); Sat, 17 Apr 2021 00:21:17 -0400 Received: from mail-oi1-x22a.google.com (mail-oi1-x22a.google.com [IPv6:2607:f8b0:4864:20::22a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9B6A0C061574; Fri, 16 Apr 2021 21:20:51 -0700 (PDT) Received: by mail-oi1-x22a.google.com with SMTP id k25so29986349oic.4; Fri, 16 Apr 2021 21:20:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Yf4cGa1gDUioK7Tp5qZNGmRyNKmLAms5q26b5QKwv4I=; b=piQInaLBoIAceOzFkrF0BoCeDSvSZtOAd8AiEd43+fyfVbehfg9SI7YxxzSHizd1xk 76N94AEBwmsNbyaM0xNh7YAmEMg6EBFyU3J9+3p5gxmSXeo8eiMdOrMj/xb88dPk4Oy4 fInFcdW9LXm29s0pPouGUFfihn0wmDNyptLw3JMhglRHeukM/2WtNI/yowPcNbkc5coE kSOTsXPHDhq9aBPe06d4kiCIyRVkqR/e6aiWCJaLBOQG3rFP7hJVB07fW/tsYdtbOc0J mshqqYuvvk5FCkcw8uzD68QKqCRbUvTIgsCDDdzVfyfEjjSF5brz7IqljNzUSYRKiOP9 jDeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=Yf4cGa1gDUioK7Tp5qZNGmRyNKmLAms5q26b5QKwv4I=; b=TYdRjeLiiPPZ+X5seF981TRnj93IIKyfEZQ9gf9gjbRB8Houy1KLo5Ah4CMhCi4I1o yG43qwzPcmC/M4R9gNzijqm6qKRY3iESOyiYhx80dqh9acfShVN3vwHJNQu0gxOQiogu cu2fzGcnbq3RiMZvxpQnpDJRMyglt1v6V0nBMHwRZa+LEHBM9vtvCCE4/Qzn5CHXqE2a qPq4e2b8FLtdpN6Aj9MT5XtySRL0h7l2vu09HJa/LuYACK+tFXwVkL/A9QUtPO/qnMG5 IatrJI/J9TQpJuoK3m25MGYv35OTacMqWLkIiFqIYWXNjkgE3aRbmeEK6Qi++4LIZkEK Ep6A== X-Gm-Message-State: AOAM532E8CjXNI0I3UMQe1LyDOp2MDaJfYO9/cD2KP9rCIUkGaO/R3aQ dbVUrm5R2YFAwNKhmvVkaqriJZ7/ed0= X-Received: by 2002:aca:a990:: with SMTP id s138mr9144164oie.80.1618633250989; Fri, 16 Apr 2021 21:20:50 -0700 (PDT) Received: from localhost ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id h184sm1866764oia.1.2021.04.16.21.20.49 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 16 Apr 2021 21:20:50 -0700 (PDT) Sender: Guenter Roeck Date: Fri, 16 Apr 2021 21:20:48 -0700 From: Guenter Roeck To: rentao.bupt@gmail.com Cc: Wim Van Sebroeck , Joel Stanley , Andrew Jeffery , linux-watchdog@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org, linux-kernel@vger.kernel.org, openbmc@lists.ozlabs.org, Tao Ren , Amithash Prasad Subject: Re: [PATCH] watchdog: aspeed: fix hardware timeout calculation Message-ID: <20210417042048.GA109800@roeck-us.net> References: <20210417034249.5978-1-rentao.bupt@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210417034249.5978-1-rentao.bupt@gmail.com> User-Agent: Mutt/1.9.4 (2018-02-28) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 16, 2021 at 08:42:49PM -0700, rentao.bupt@gmail.com wrote: > From: Tao Ren > > Fix hardware timeout calculation in aspeed_wdt_set_timeout function to > ensure the reload value does not exceed the hardware limit. > > Fixes: efa859f7d786 ("watchdog: Add Aspeed watchdog driver") > Reported-by: Amithash Prasad > Signed-off-by: Tao Ren Reviewed-by: Guenter Roeck > --- > drivers/watchdog/aspeed_wdt.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/watchdog/aspeed_wdt.c b/drivers/watchdog/aspeed_wdt.c > index 7e00960651fa..507fd815d767 100644 > --- a/drivers/watchdog/aspeed_wdt.c > +++ b/drivers/watchdog/aspeed_wdt.c > @@ -147,7 +147,7 @@ static int aspeed_wdt_set_timeout(struct watchdog_device *wdd, > > wdd->timeout = timeout; > > - actual = min(timeout, wdd->max_hw_heartbeat_ms * 1000); > + actual = min(timeout, wdd->max_hw_heartbeat_ms / 1000); > > writel(actual * WDT_RATE_1MHZ, wdt->base + WDT_RELOAD_VALUE); > writel(WDT_RESTART_MAGIC, wdt->base + WDT_RESTART); > -- > 2.17.1 >