Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp2890006ybc; Mon, 18 Nov 2019 06:21:18 -0800 (PST) X-Google-Smtp-Source: APXvYqzYPhy8/tkT/QQzzr6I/0MxpnXIAxggg82dqXCpRH+nrAI/NsuvF+ia1UUJjs33UVOWevjD X-Received: by 2002:a17:907:2070:: with SMTP id qp16mr27266058ejb.115.1574086878165; Mon, 18 Nov 2019 06:21:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574086878; cv=none; d=google.com; s=arc-20160816; b=NjCJWO/V9plgLjr23j1Jsnuqqg5jRafX2aoR3Kqx2OijrXKlTnygYJT8XSXc3kLlIV U0XOLAtFAAn5+TkurjwPpAN8e9pausCOMm5Me1oPHlAgzTyYxFV6Gs94Ic3G8ja2nHrM dQpOvXBnU1GDMbE0X/mMr/8+SuBQlP++ucBZPLXYWkv6onkeTnfAZv+JwtTuSQracs8P Qm49yDeYEYzEB911HoQGBY1Clqybp/ZTVHu333Sc31HWa10u1NzzO9BAyHr7gpnDn8+G 5U5MCCzUojzdTOP3V7EWfX4Xnaxu6PV2c8bvpd9WBk7cr8HlTGij9PKw3wyDhDIGTyHY UygA== 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=U7dyIDZekdziHy+WbHnd+JhmF1A59r7Iva+JfXUnR54=; b=aLilnPa5X2k2ScVFYdpgi4txz1v/itjTA/6suAk2F59vMm7JXNgSywWqcCSjMTnl/c vzNhhp+OzflDp3t1vxgv6yrcaGIQ1AKd6GKkxjs4Rro+zyqmTkV4AhOfbTJcpbijatDe utXUdQ14I0ulhZ7akawYYMf7BwZ9wwSAdGqf1HatScprzG3Kmnfj1cTWRPHcciKT0dup KKGi8WVtD47dPLP8ks0IoceNZrCB/I9mx3AL8b7+W+Zzf19ejRUfxvwRu08QVm/FfEuf 3nFAKJiB3qt4wzOhAc5apZSANMv1+IoYYhgQWOImxvtzvGIWwSCnxt+w5iHtl4HMulQP CrrQ== 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 md8si11273232ejb.386.2019.11.18.06.20.53; Mon, 18 Nov 2019 06:21:18 -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; 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 S1727173AbfKROTM (ORCPT + 99 others); Mon, 18 Nov 2019 09:19:12 -0500 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:56183 "EHLO relay4-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726631AbfKROTM (ORCPT ); Mon, 18 Nov 2019 09:19:12 -0500 X-Originating-IP: 92.184.107.65 Received: from localhost (unknown [92.184.107.65]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 41404E0007; Mon, 18 Nov 2019 14:19:10 +0000 (UTC) Date: Mon, 18 Nov 2019 15:19:09 +0100 From: Alexandre Belloni To: Kars de Jong Cc: Alessandro Zummo , linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: Re: [PATCH] rtc: msm6242: Remove unneeded msm6242_set()/msm6242_clear() functions Message-ID: <20191118141909.GF3632@piout.net> References: <20191116114620.9193-1-jongk@linux-m68k.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191116114620.9193-1-jongk@linux-m68k.org> User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 16/11/2019 12:46:20+0100, Kars de Jong wrote: > The msm6242_set()/msm6242_clear() functions are used when writing to Control > Register D to set or clear the HOLD bit when reading the current time from > the RTC. > > Doing this with a read-modify-write cycle will potentially clear an > interrupt condition which occurs between the read and the write. > > The datasheet states the following about this: > > When writing the HOLD or 30 second adjust bits of register D, it is > necessary to write the IRQ FLAG bit to a "1". > > Since the only other bits in the register are the 30 second adjust bit > (which is not used) and the BUSY bit (which is read-only), the > read-modify-write cycle can be replaced by a simple write with the IRQ FLAG > bit set to 1 and the other bits (except HOLD) set to 0. > > Cc: Geert Uytterhoeven > Tested-by: Kars de Jong > Signed-off-by: Kars de Jong > --- > drivers/rtc/rtc-msm6242.c | 20 ++++---------------- > 1 file changed, 4 insertions(+), 16 deletions(-) > Applied, thanks. -- Alexandre Belloni, Bootlin Embedded Linux and Kernel engineering https://bootlin.com