From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752435AbdCDPHd (ORCPT ); Sat, 4 Mar 2017 10:07:33 -0500 Received: from bh-25.webhostbox.net ([208.91.199.152]:35603 "EHLO bh-25.webhostbox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752131AbdCDPHb (ORCPT ); Sat, 4 Mar 2017 10:07:31 -0500 Subject: Re: [PATCH 4/4] watchdog: sama5d4: Add comment explaining what happens on resume To: Alexandre Belloni References: <20170302173114.28508-1-alexandre.belloni@free-electrons.com> <20170302173114.28508-5-alexandre.belloni@free-electrons.com> Cc: Wim Van Sebroeck , Nicolas Ferre , Wenyou.Yang@microchip.com, linux-watchdog@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org From: Guenter Roeck Message-ID: Date: Sat, 4 Mar 2017 07:07:28 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <20170302173114.28508-5-alexandre.belloni@free-electrons.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Authenticated_sender: linux@roeck-us.net X-OutGoing-Spam-Status: No, score=-1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bh-25.webhostbox.net X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - roeck-us.net X-Get-Message-Sender-Via: bh-25.webhostbox.net: authenticated_id: linux@roeck-us.net X-Authenticated-Sender: bh-25.webhostbox.net: linux@roeck-us.net X-Source: X-Source-Args: X-Source-Dir: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/02/2017 09:31 AM, Alexandre Belloni wrote: > Because suspending to RAM may lose the register values, they are restored > on resume. This is currently done unconditionally because there is > currently no way to know (from the driver) whether they have really been > lost or are still valid. Writing MR also pings the watchdog and this may > not be what is expected so add a comment explaining why it happens. > > Signed-off-by: Alexandre Belloni Reviewed-by: Guenter Roeck > --- > drivers/watchdog/sama5d4_wdt.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/drivers/watchdog/sama5d4_wdt.c b/drivers/watchdog/sama5d4_wdt.c > index d710014f3b7d..0ae947c3d7bc 100644 > --- a/drivers/watchdog/sama5d4_wdt.c > +++ b/drivers/watchdog/sama5d4_wdt.c > @@ -300,6 +300,11 @@ static int sama5d4_wdt_resume(struct device *dev) > { > struct sama5d4_wdt *wdt = dev_get_drvdata(dev); > > + /* > + * FIXME: writing MR also pings the watchdog which may not be desired. > + * This should only be done when the registers are lost on suspend but > + * there is no way to get this information right now. > + */ > sama5d4_wdt_init(wdt); > > return 0; >