Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp2445262ybc; Sun, 24 Nov 2019 21:40:26 -0800 (PST) X-Google-Smtp-Source: APXvYqyhS9g86Y3M6vwUtik1w6a8Y6UlJfCACbLEfziayoVXoi5TLQM3e1Kw+/Yy6kQdMMxLhWd6 X-Received: by 2002:aa7:d5ce:: with SMTP id d14mr16516502eds.64.1574660426261; Sun, 24 Nov 2019 21:40:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574660426; cv=none; d=google.com; s=arc-20160816; b=m4d4GpjuwWalmAplI6ge/51YfrCrbdp/5DL9CI43RhyHFX6Waz1WBBwazQyRRrcPlH YGHz2UZpmdcKqTiAUzGrH+usi3v3vG+q1dfVE2wUUacrdUWP4PqPEgRPpmG2a6ZK8NEy r7yizXYUG948VgjiNRJKvpY4zlVmj1Qk0U1OGAer/hTp5Njz2tlDRThcP8bMELNww80h V7ctgYbFVsYsGLFrrKRtfPfrulrS/ms4cy5v9myssatdr9CHMxXdEUNUuE46lnARu2cI WlcclWZxkall6vsnvOnLVPklY3bEJlGv3OV+ocFtwXv16+3/1BSgtEfrFtqULvrlGHnf sOKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=wXFe5IRkpmYw35jezCOFXYaWV3iTtdk0uF/bLAb2KN8=; b=Eaap3Mc3gu87pR+Vj8ErM6IzdsukEyRf5wqNMQE851Cdq1GAw1+PSLkgJnN+muDle8 f/Grx1O9sPPvlusa77ou2RFbQzInRNqCxxqdoZ3d4tDsbqBPW8flNWL9XvZHKzKIDJsd eAzhDalzTHRREV9UNA2VqebGZ2fMlwRjg1U5fkzVeYLpj6J2sH9UXonL9Tz394sDtg8O +h1NHsxYIKNadPB+vM/1cc89gkMua/F8BeW0aGRNDJ44H1f1Dq24vAOwFWNMWUj+DSt9 j02aid3kiCbnOpGWGCHFMCw9xIRsovWgzXPh1rHD5Dj2AC4/q+/MiHludkdpB2Dm99bt 48FA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=OGTycsad; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k13si5183292edj.324.2019.11.24.21.40.02; Sun, 24 Nov 2019 21:40:26 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=OGTycsad; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727188AbfKYFfQ (ORCPT + 99 others); Mon, 25 Nov 2019 00:35:16 -0500 Received: from mail-ot1-f65.google.com ([209.85.210.65]:35321 "EHLO mail-ot1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725497AbfKYFfQ (ORCPT ); Mon, 25 Nov 2019 00:35:16 -0500 Received: by mail-ot1-f65.google.com with SMTP id 23so9749300otf.2; Sun, 24 Nov 2019 21:35:15 -0800 (PST) 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=wXFe5IRkpmYw35jezCOFXYaWV3iTtdk0uF/bLAb2KN8=; b=OGTycsadouQJuXYb24/RO8prEiQyQtwqh6DAC5aCfAwdv914oShVGMkOrPoEgLQe2+ KoZCnNlVh95l1bojLoxUDPJEVSqQgYj69W9UUvdQKh1LkOKVCD/yP7qDM+eXxGMQ87Wr hPBI9S1kOwLSjZ6J1nLb4CAhjzy2X/Q/RSckk1oeeVtzhq1sRecaazofHmef5DVYAyV9 NrwdpfOgSrNae72KucHXjKtz7W1x9oLQOdkdlfYpzEs0idJYAUVYZTsWzi5wJMNzt11W VSfPN+mi/o8/+fLnDJGwQhxFrrCMgEuZjX/iWvD9s0WqbGENHzsQmNYxGVKxWM9JTBzZ bspQ== 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=wXFe5IRkpmYw35jezCOFXYaWV3iTtdk0uF/bLAb2KN8=; b=lBptrgb0QABxEj/MhryFUgFE3X58SxE2Wo6c247tNQ955pnyRde8qW+XiTgGfz8Nni n51kD03w7G5gJn48wHE+Jhhpa044ioLkOKDK5K2SjxEVVnCtF7KCHePTkQKLahT5e/yg I/fPpLuG0U2kHJbV13oaDKR9VtaXoQz9+BPhZFm86sNPweze/+6GM6rBoXaLnzJ1Khuh 0RNsa/zGwJ4Qt6LkuWc5ZAnYwaEqn0GmYZzAdMaq71LJJDYmAdVeoELoKgjYFhNZyFZ9 0Uc0Po1UF3Vywur7TkJuGuSzHI+AaXOtGUeLRWdLjdY05EhzO/bwyJLaGqcZP1M63C54 G7rg== X-Gm-Message-State: APjAAAXlJNTmtCpFtPBi8a6RXDTuzJdB7zhuDVuTznEEhz+JrJ8L3Lwe HEYHUvtImLA9f3EUs5tv0qvT1cGW X-Received: by 2002:a9d:7b50:: with SMTP id f16mr1052382oto.264.1574660115047; Sun, 24 Nov 2019 21:35:15 -0800 (PST) Received: from localhost ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id u1sm2233860oie.37.2019.11.24.21.35.13 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 24 Nov 2019 21:35:14 -0800 (PST) Date: Sun, 24 Nov 2019 21:35:12 -0800 From: Guenter Roeck To: "Wang, Peng 1. (NSB - CN/Hangzhou)" Cc: Guenter Roeck , Guenter Roeck , "wim@linux-watchdog.org" , "linux-watchdog@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v2.1] watchdog: make DesignWare watchdog allow users to set bigger timeout value Message-ID: <20191125053512.GA5636@roeck-us.net> References: <8fa54e92c6cd4544a7a3eb60a373ac43@nokia-sbell.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8fa54e92c6cd4544a7a3eb60a373ac43@nokia-sbell.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 25, 2019 at 02:04:13AM +0000, Wang, Peng 1. (NSB - CN/Hangzhou) wrote: > From aabaa4b709bd451e566c906e8d1dca48f92f9b12 Mon Sep 17 00:00:00 2001 > From: Peng Wang > Date: Wed, 20 Nov 2019 15:12:59 +0800 > Subject: [PATCH v2.1] watchdog: make DesignWare watchdog allow users to set bigger > timeout value > > watchdog_dev.c provides means to allow users to set bigger timeout value > than HW can support, make DesignWare watchdog align with this. > > Signed-off-by: Peng Wang Reviewed-by: Guenter Roeck > --- > > v2 -> v2.1: > - move Signed-off-by to be ahead of section separator > > v1 -> v2: > - use top_s to compare with wdd->max_hw_heartbeat_ms > - update wdd->timeout in case it's greater than HW supports > - fix comments error > > v1: initial version > > --- > drivers/watchdog/dw_wdt.c | 10 +++++++++- > 1 file changed, 9 insertions(+), 1 deletion(-) > > diff --git a/drivers/watchdog/dw_wdt.c b/drivers/watchdog/dw_wdt.c > index fef7c61..12c116e 100644 > --- a/drivers/watchdog/dw_wdt.c > +++ b/drivers/watchdog/dw_wdt.c > @@ -114,7 +114,15 @@ static int dw_wdt_set_timeout(struct watchdog_device *wdd, unsigned int top_s) > writel(top_val | top_val << WDOG_TIMEOUT_RANGE_TOPINIT_SHIFT, > dw_wdt->regs + WDOG_TIMEOUT_RANGE_REG_OFFSET); > > - wdd->timeout = dw_wdt_top_in_seconds(dw_wdt, top_val); > + /* > + * In case users set bigger timeout value than HW can support, > + * kernel(watchdog_dev.c) helps to feed watchdog before > + * wdd->max_hw_heartbeat_ms > + */ > + if (top_s * 1000 <= wdd->max_hw_heartbeat_ms) > + wdd->timeout = dw_wdt_top_in_seconds(dw_wdt, top_val); > + else > + wdd->timeout = top_s; > > return 0; > } > -- > 1.8.3.1 >