From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 83137C3A5A1 for ; Thu, 22 Aug 2019 21:28:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 26B272339F for ; Thu, 22 Aug 2019 21:28:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732398AbfHVV21 (ORCPT ); Thu, 22 Aug 2019 17:28:27 -0400 Received: from relay5-d.mail.gandi.net ([217.70.183.197]:43053 "EHLO relay5-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730897AbfHVV21 (ORCPT ); Thu, 22 Aug 2019 17:28:27 -0400 X-Originating-IP: 90.65.161.137 Received: from localhost (lfbn-1-1545-137.w90-65.abo.wanadoo.fr [90.65.161.137]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id 3F3241C0003; Thu, 22 Aug 2019 21:28:25 +0000 (UTC) Date: Thu, 22 Aug 2019 23:28:25 +0200 From: Alexandre Belloni To: Bruno Thomsen Cc: linux-rtc@vger.kernel.org, linux-watchdog@vger.kernel.org, a.zummo@towertech.it, wim@linux-watchdog.org, linux@roeck-us.net, u.kleine-koenig@pengutronix.de, bth@kamstrup.com Subject: Re: [PATCH v3 3/5] rtc: pcf2127: bugfix: read rtc disables watchdog Message-ID: <20190822212825.GI27031@piout.net> References: <20190822131936.18772-1-bruno.thomsen@gmail.com> <20190822131936.18772-3-bruno.thomsen@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190822131936.18772-3-bruno.thomsen@gmail.com> User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-rtc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rtc@vger.kernel.org On 22/08/2019 15:19:34+0200, Bruno Thomsen wrote: > The previous fix listed bulk read of registers as root cause of > accendential disabling of watchdog, since the watchdog counter > register (WD_VAL) was zeroed. > > Fixes: 3769a375ab83 rtc: pcf2127: bulk read only date and time registers. > > Tested with the same PCF2127 chip as Sean reveled root cause > of WD_VAL register value zeroing was caused by reading CTRL2 > register which is one of the watchdog feature control registers. > > So the solution is to not read the first two control registers > (CTRL1 and CTRL2) in pcf2127_rtc_read_time as they are not > needed anyway. Size of local buf variable is kept to allow > easy usage of register defines to improve readability of code. > > Debug trace line was updated after CTRL1 and CTRL2 are no longer > read from the chip. Also replaced magic numbers in buf access > with register defines. > > Signed-off-by: Bruno Thomsen > --- > v3: no change. > v2: new bugfix, not in v1. > > drivers/rtc/rtc-pcf2127.c | 32 ++++++++++++-------------------- > 1 file changed, 12 insertions(+), 20 deletions(-) > Applied, thanks. -- Alexandre Belloni, Bootlin Embedded Linux and Kernel engineering https://bootlin.com