Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1250326ybi; Fri, 14 Jun 2019 11:09:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqwyIyaJx+Cf7jF267kHP9Sligft+LvPz8HVvF44pW44MRM7rGwdnylEqy4fMQnAGYirJQce X-Received: by 2002:a62:bd11:: with SMTP id a17mr26440160pff.126.1560535768354; Fri, 14 Jun 2019 11:09:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560535768; cv=none; d=google.com; s=arc-20160816; b=h2AwYXGFmr9bVKwzIrfHPNbsMDUqtkh9DspBrbER3akgb0iQTsu/Zff715rimRC5Np 1trAlg+7OssJtjQoO5tqiGgFraUgJ6VcS5vlXquXFKe9zD+8fAvAPyIoVgzxUZDuFFNu mTIL3oL37pEOW0FPdKLP8V4C69Of/rkng3AgEsI+hwtz745UTiX1/XFOgQZUx88dLQY/ fdZvR4hlvzOOTSNtkTVrjB+A7XGCxwy+hXXCCAzw1ONPllQYAfE3cx6TlMYd59PCmZxB h0YwYee0F5E3rjeFAQfL/A7FcASL1qvIDUtEc/6+tUxTgbr2XKcXFZ9jgnVBn+mnXUaB 4tLw== 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; bh=vBYX/pFS+i5pEur5Kxd5hjvHxqNslPCxqEPW5DSW+AI=; b=UthH0H1QUJcgnz0SmVR1aYlchcsuRscaeKTt2wUgRZtpQ2YgV5N5L5s/Ee7b4lEeUR c2kXmCEPKmpQaPQHUnVnyFAwkO8gXfUUbofCo+/M5M07zDRMr9Uj64QYEZxSDdKdrQ75 nEEe0QGzyvJnIpF8zfCU26IOaMU4V6Q/MeM4qThSkp34CBQmPvmVW1sVqu/wYJFOxPvz fD2tB8K/8HGKFF3LVubh/qNAgbCNF6KE5xyXw1U8ZqCyPWsRxhum+ZsJ1A4Ovku0rfsP TbD/Zf2OChdmjr4hnElyDk5TIbwk+C2zzauTQhUZ9IZH7Yfim299xZRV/xbbbeNnQnId YWLQ== ARC-Authentication-Results: i=1; mx.google.com; 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 h12si2800045pjt.4.2019.06.14.11.09.13; Fri, 14 Jun 2019 11:09:28 -0700 (PDT) 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; 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 S1726178AbfFNSIj (ORCPT + 99 others); Fri, 14 Jun 2019 14:08:39 -0400 Received: from relay2-d.mail.gandi.net ([217.70.183.194]:52461 "EHLO relay2-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725808AbfFNSIi (ORCPT ); Fri, 14 Jun 2019 14:08:38 -0400 X-Originating-IP: 37.205.120.66 Received: from localhost (unknown [37.205.120.66]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay2-d.mail.gandi.net (Postfix) with ESMTPSA id 5A6AF40003; Fri, 14 Jun 2019 18:08:29 +0000 (UTC) Date: Fri, 14 Jun 2019 20:08:26 +0200 From: Alexandre Belloni To: Ken Sloat Cc: Guenter Roeck , "nicolas.ferre@microchip.com" , "ludovic.desroches@microchip.com" , "wim@linux-watchdog.org" , "linux-arm-kernel@lists.infradead.org" , "linux-watchdog@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v2 1/1] watchdog: atmel: atmel-sama5d4-wdt: Disable watchdog on system suspend Message-ID: <20190614180826.GD3369@piout.net> References: <20190614125310.29458-1-ksloat@aampglobal.com> <20190614164609.GA29814@roeck-us.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.4 (2019-03-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 14/06/2019 17:53:01+0000, Ken Sloat wrote: > > The call to sama5d4_wdt_init() above now explicitly stops the watchdog > > even if we want to (re)start it. I think this would be better handled with an > > else case here > > > > else > > sama5d4_wdt_stop(&wdt->wdd); > > > > So we completely remove the sama5d4_wdt_init() call then correct? > > To leave the code as it behaves today with the addition > of wdt stop/start, shouldn't we call init in the else instead? > > if (watchdog_active(&wdt->wdd)) > sama5d4_wdt_start(&wdt->wdd); > else > sama5d4_wdt_init(); > > I guess I don't really understand the purpose of having the init statement in resume > in the first place. I agree, calling this first does end up essentially resetting the wdt > it will start again if it was running before, but the count will be reset. > There is a nice comment explaining why ;) -- Alexandre Belloni, Bootlin Embedded Linux and Kernel engineering https://bootlin.com