Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp817833pxb; Fri, 16 Apr 2021 20:44:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzReHIaR+19Adv0f8lthScrrm1miwPlcHGMYZ1Z+RzCNAWwqROtsDvfgdNl3dzLfJf7P1mU X-Received: by 2002:a65:6496:: with SMTP id e22mr1960222pgv.46.1618631059521; Fri, 16 Apr 2021 20:44:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618631059; cv=none; d=google.com; s=arc-20160816; b=ukI7tjFyf737/pTgfjEle6I2LSiMlVccg78+v/jxvASlsCH5QRZYMoQKF4FjBeX2/W IOBqnV6ehuIoV0v0rDnEZqgD8zvDsQM/KzsBuf/2vBd9MxtlERgBzg/ice8KmsMZfNOI /e9ydcwj1VX61V9S+PgjQZwz+5KzVaqWPitzF6VO3VCupygLY2oC0e5ZSKATiXK+ue8e wfJI7LIUvzJBk2GEqorymk9VpwFvKFwK/XXCjl6YJQR2vOdZZn13vpH4aiI+vRduQgwX vWXt6w5b4tUakOMSNevPcbyFDvsKRQrDJNehqOeVgHXwJhXwdhEBuux0BYk96X+LcklE ZYpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from :dkim-signature; bh=KEgAGlMIMGSD4Y3PLpFSkmFQK4X2O5FS+oaEvb1q+lY=; b=QKdiWihlm9wduKPpHxAaOlzJ2EIt/wApjtHvG+cilNBw2Cf/9XlNJtapAjQx73QCfB NzUny467ScToCrNyf1Afu8wygm4zgrpFP6eCmUn1yY3VwRwRIqSWqCEwjC1fymaPeFhC D3rU6YjQ6it97nrZ5P+k1eXvXs3eJ36DUiUukdCp2v5EVBtFUg2cbktr/f1tF99ETYGe tWAxGqZ/MmIeommauN8WX9uqCpwuY950Wgipge8hjOB+5/Kb8wi6zqfD0tJ5yBV0H/bK gz1Qdm4dCCdT1n0Vz6YetBvrzJoX927i4vhhPTzrvMcOKPJxWVFeKUoIxzZpFF2fagJz K64Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=K0b5nLAi; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lk18si10137581pjb.42.2021.04.16.20.43.52; Fri, 16 Apr 2021 20:44:19 -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=K0b5nLAi; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235638AbhDQDnX (ORCPT + 99 others); Fri, 16 Apr 2021 23:43:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48706 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234999AbhDQDnX (ORCPT ); Fri, 16 Apr 2021 23:43:23 -0400 Received: from mail-pg1-x529.google.com (mail-pg1-x529.google.com [IPv6:2607:f8b0:4864:20::529]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A314AC061574; Fri, 16 Apr 2021 20:42:57 -0700 (PDT) Received: by mail-pg1-x529.google.com with SMTP id y32so20448488pga.11; Fri, 16 Apr 2021 20:42:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=KEgAGlMIMGSD4Y3PLpFSkmFQK4X2O5FS+oaEvb1q+lY=; b=K0b5nLAizD7TGQDjgaOycW3pVacY3L7Ep+L1M4RObdMN2U6homi3AL+6ANBGRcLLyP wk2KHAqRuihRNK6M8acRbWXEB0Yl5BTqeVmylR0C3oBJkWqwK/TMaIKX9RziEPXg30as njFyJGypqwQaTqgu51A9+FAsuVyKn9MV7JecT/nWsdZrWboOJ9fWObm2t0QhjdsHZUaJ nNQceK0PgPxSCKW8hCWNwXpGqh0yWzx/fhIG7ta341FjY68/Gbaz4qLCPTvlRk4JyIwX R9r/KuAf3Fa3rKTMMiOOp7VTE/aytP8eME68cR+Kq4UukzCmlj+h07YXZOeBOhnirMgu WcQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=KEgAGlMIMGSD4Y3PLpFSkmFQK4X2O5FS+oaEvb1q+lY=; b=bj6tPsx2uB8SDwuEDf34IX/oDr2wxO+STpeaDky3im2I7IqkDx88V6K7mFX2uNoDEL UJiG9mo9bV0dW3SUNtbJKU7gzPe5C24AnEENTch3LeBtkFU5SrOOsKTZqKUqzVx/9DKl tOOzWG20ogFEMftCApk8Cwq4fBG4Qns8/vB9lmQMLchbu6Y2SicpwjEY6EZfVgjK2MRu iTpHnmhbDxcMHHwa5fUHPAZG72ssnPhzoaSTqLsSq6zPVRNLv3wQF6oSu/R+N2633fcL kPQ2R5aHsE3L+YNgKlD2DX6JBE8wWb6U4kK1JTxa5+TPsHdJcphlRNg1nmQ7d4flmiLk w+Pg== X-Gm-Message-State: AOAM531fae2M2zv/xuzdRsJHElNIDioiNkdsWg/m8hj2XNo+Iem+azeE vGrNOU5JbHiSMSLXhcrWPpAeVRUd7hynNagNqnQ= X-Received: by 2002:a63:c14c:: with SMTP id p12mr1872172pgi.417.1618630977196; Fri, 16 Apr 2021 20:42:57 -0700 (PDT) Received: from taoren-ubuntu-R90MNF91.thefacebook.com (c-73-252-146-110.hsd1.ca.comcast.net. [73.252.146.110]) by smtp.gmail.com with ESMTPSA id f18sm4434821pfk.144.2021.04.16.20.42.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Apr 2021 20:42:56 -0700 (PDT) From: rentao.bupt@gmail.com To: Wim Van Sebroeck , Guenter Roeck , 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 Cc: Tao Ren Subject: [PATCH] watchdog: aspeed: fix hardware timeout calculation Date: Fri, 16 Apr 2021 20:42:49 -0700 Message-Id: <20210417034249.5978-1-rentao.bupt@gmail.com> X-Mailer: git-send-email 2.17.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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