Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp4053043ybc; Thu, 21 Nov 2019 18:44:54 -0800 (PST) X-Google-Smtp-Source: APXvYqyepr+27I7Mhe2OLykptWyOBxDi3XDbDGOyTp0u5N8jTy69IC2AkHWqnX4JuHFIYxn6HBNr X-Received: by 2002:a17:906:2e52:: with SMTP id r18mr18965401eji.178.1574390694886; Thu, 21 Nov 2019 18:44:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574390694; cv=none; d=google.com; s=arc-20160816; b=0Jygb78S6wn+aZS8Va3ZgL2Y4Du3VmqLHT/58uh+2hKzVYM405zb+sWtmuD3mt1Xk/ amzYrXRjFBJW0IGmIpaJPJUWBWlAOUOOHirOVkYmGUXRVG9h+2Tlgn2IZBLPGuHy/byX 2kJf3WyYjQztpfsszGQoaEKJJZ3zZB8fhh2Yc3H0J7pqblydLA1cycQP4lHfhysPvnXv tuFXD3Nmbz7qQCZhSb4D88hEJrDJJTbUYOEKwAFvd69/3PkdgpoNR4jeF31LZ+wzf8Z+ JDizaCB5JU+UCpsg9CSg6YDi1zI20Ct5c5c6EP7r0rrlGoxje+sibeTpLpisXgDsvM+T W8tA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=Dv1bxAvHpHd/W1kU7AoVueS3lUuNaiq9DlOEZQ0S9UI=; b=NuatlIly/IgblCu5feuNNtkM5y2bnXhj5AG4b/c6JyyacqmVk5MYv5NqyvnOSBaU+p kP2Hp9ln4sq6tCH1QVbdaV7a3XyFUGpJrWLsP/JRAvM5viiNGPoIoBdPF83LzkqWEQJh zNyaZot8KjObvqpAYbsqy4jpgxUkR1qoCD45ilX/OZnQyIjGM1gIr/Rlo4eI/5jCH2CK l8vtUkYzlumQDvwy5OC3yQ0g09EercY6f2i/q0jeHkX+zYvTcJ8yJVA8EWmH5O2Tnb7N W5Da9SlOLEZ+9shhDQG5SmfSZDLYJTGmVXpx1VhH2L87qkHn3+xOMkmhM3gs+B7s+7SD Xy1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=Ck5RoPaz; 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 a16si725243ejb.55.2019.11.21.18.44.31; Thu, 21 Nov 2019 18:44:54 -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=Ck5RoPaz; 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 S1726719AbfKVClP (ORCPT + 99 others); Thu, 21 Nov 2019 21:41:15 -0500 Received: from mail-pf1-f195.google.com ([209.85.210.195]:37834 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726541AbfKVClP (ORCPT ); Thu, 21 Nov 2019 21:41:15 -0500 Received: by mail-pf1-f195.google.com with SMTP id p24so2739091pfn.4; Thu, 21 Nov 2019 18:41:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=Dv1bxAvHpHd/W1kU7AoVueS3lUuNaiq9DlOEZQ0S9UI=; b=Ck5RoPazJp2/Fe93Xp/p3B+Tf1cJhqLlqrJt7AyPUyfWbnJKO44BDgNd7jL+o38yV6 MhP8c1OW5EHyjRDQJC4/0b+GzdxXn7+pkqo8yYQFJqc0A87Xd3A4GbqzYC6kuXDZ1o/d Zp57fo+9lFG6HahMFJKt7iL85ZqrD4jrIayWabtyVkRvqRKrxB2xokPhND6x0SGHnrbq NQGZFRrly3NIveJfdOK7BAQ2sHTpv+Vz/lAx0adHAuRcxiBiHsRsLc5v9ywLLdNOpbsQ Rmd6BnkFq8g1uZw5gJn2BnJwDRvN8rd3/39TUgq9PKaPiVJFZ+hiJE3P5mMOYiGmOACN +fEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Dv1bxAvHpHd/W1kU7AoVueS3lUuNaiq9DlOEZQ0S9UI=; b=hg77QTwBsVdvCCWokgl8I77oTxl/53ZA2MsA+Qirb00JmOHHTDFIrQ7k1Bza7lU+Ou geBpButrZQkUxzU/z0j5NS1brSIR/5ueBWInfuyb4t1XJ8OF1bGmbqODXBJ6VlW6j7T9 Z9JDM0MqgUg/KNsgoNkLqe4ubRu1plLVOG0WCxPfnN2qbS2547BklSDP3XMv0Ul/NPDp l1rMGTsE65fHy6TGVS5R/0tk3D1bkhJwQtlDjBLvoU4Oj2O8awPGBsslCAPzavV5cVai 01zbxwYd0RiWwOgwK0MSun62KXdTqrXWIQqcLLYiJ4zPT4nUbX0pXOaQojfigBAGnAoj WquQ== X-Gm-Message-State: APjAAAVExqW6bpiVwTQb9MbJTG4dIfigrSKDsvPQOrh1fvmAbPWKWLPw SWveaohvMsWlW3XXIzkEEZv9YWQJ X-Received: by 2002:aa7:9189:: with SMTP id x9mr14884350pfa.41.1574390473807; Thu, 21 Nov 2019 18:41:13 -0800 (PST) Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id s6sm5180464pfd.24.2019.11.21.18.41.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Nov 2019 18:41:12 -0800 (PST) Subject: Re: [PATCH v2] watchdog: make DesignWare watchdog allow users to set bigger timeout value To: "Wang, Peng 1. (NSB - CN/Hangzhou)" Cc: Guenter Roeck , "wim@linux-watchdog.org" , "linux-watchdog@vger.kernel.org" , "linux-kernel@vger.kernel.org" References: <20191121141508.GA13249@roeck-us.net> From: Guenter Roeck Message-ID: <8c198e4e-488b-efd0-4caf-b2dddb830ea3@roeck-us.net> Date: Thu, 21 Nov 2019 18:41:11 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/21/19 5:16 PM, Wang, Peng 1. (NSB - CN/Hangzhou) wrote: >> Reviewed-by: Guenter Roeck > > Roeck, thanks for your time to guide me to finish the review. Do I need to re-send a mail with your sign? > No, that won't be necessary. Guenter > Peng Wang > > -----Original Message----- > From: Guenter Roeck [mailto:groeck7@gmail.com] On Behalf Of Guenter Roeck > Sent: Thursday, November 21, 2019 10:15 PM > To: Wang, Peng 1. (NSB - CN/Hangzhou) > Cc: Guenter Roeck ; wim@linux-watchdog.org; linux-watchdog@vger.kernel.org; linux-kernel@vger.kernel.org > Subject: Re: [PATCH v2] watchdog: make DesignWare watchdog allow users to set bigger timeout value > > On Thu, Nov 21, 2019 at 10:35:12AM +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] 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. >> >> --- >> >> v2 -> v1: >> - 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 >> >> Signed-off-by: Peng Wang > > Reviewed-by: Guenter Roeck > >> --- >> 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 >> >