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=-8.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable 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 5C84FC388F9 for ; Mon, 23 Nov 2020 21:38:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EB77620706 for ; Mon, 23 Nov 2020 21:38:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731309AbgKWViQ (ORCPT ); Mon, 23 Nov 2020 16:38:16 -0500 Received: from relay10.mail.gandi.net ([217.70.178.230]:34543 "EHLO relay10.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728940AbgKWViP (ORCPT ); Mon, 23 Nov 2020 16:38:15 -0500 Received: from localhost (lfbn-lyo-1-997-19.w86-194.abo.wanadoo.fr [86.194.74.19]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay10.mail.gandi.net (Postfix) with ESMTPSA id BDBBC240009; Mon, 23 Nov 2020 21:38:08 +0000 (UTC) Date: Mon, 23 Nov 2020 22:38:08 +0100 From: Alexandre Belloni To: Jonathan =?iso-8859-1?Q?Neusch=E4fer?= Cc: linux-kernel@vger.kernel.org, Lee Jones , Rob Herring , Thierry Reding , Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= , Alessandro Zummo , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Sam Ravnborg , Linus Walleij , Heiko Stuebner , Stephan Gerhold , Lubomir Rintel , Mark Brown , allen , Mauro Carvalho Chehab , "David S. Miller" , devicetree@vger.kernel.org, linux-pwm@vger.kernel.org, linux-rtc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Heiko Stuebner , Josua Mayer , Andreas Kemnade , Arnd Bergmann , Daniel Palmer , Andy Shevchenko Subject: Re: [PATCH v4 5/7] rtc: New driver for RTC in Netronix embedded controller Message-ID: <20201123213808.GP348979@piout.net> References: <20201122222739.1455132-1-j.neuschaefer@gmx.net> <20201122222739.1455132-6-j.neuschaefer@gmx.net> <20201122231054.GH348979@piout.net> <20201123213105.GC456020@latitude> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20201123213105.GC456020@latitude> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 23/11/2020 22:31:05+0100, Jonathan Neuschäfer wrote: > > > + res = regmap_write(rtc->ec->regmap, NTXEC_REG_WRITE_MINUTE, ntxec_reg8(tm->tm_min)); > > > + if (res) > > > + return res; > > > + > > > + return regmap_write(rtc->ec->regmap, NTXEC_REG_WRITE_SECOND, ntxec_reg8(tm->tm_sec)); > > > > Couldn't you do a regmap_block_write or a regmap_multi_reg_write which > > would be more efficient as they would be locking the regmap only once. > > I can't find regmap_block_write anywhere, but regmap_multi_reg_write > looks like a good approach to simplify the code here. > I was thinking regmap_bulk_write but regmap_multi_reg_write is probably more fitting here. > > [...] > > Note that this won't compile after > > https://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux.git/commit/?id=fdcfd854333be5b30377dc5daa9cd0fa1643a979 > > > > We can solve that with immutable branches though. > > Thanks for the heads-up. Please let me know if/when there is any action > that I need to take here. > I wouldn't think so, I can carry a patch once Lee provides his usual immutable branch. -- Alexandre Belloni, Bootlin Embedded Linux and Kernel engineering https://bootlin.com 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=-8.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 35496C388F9 for ; Mon, 23 Nov 2020 21:39:30 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B118E20706 for ; Mon, 23 Nov 2020 21:39:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="XJqPIuX0" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B118E20706 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bootlin.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=N9yQVr5K+QY38Yf6WqpDnJau7YN+FeZNaWTuCWrs9pU=; b=XJqPIuX06KqtSFB0JLCoyIxhV Y7vINikleuPSQfXOxboDVSiZ6sbz24ZJ/s7fCTkQSYUvIwxhypfVBK3EDMp3ibP9kLTXXCfrwkmze hejJ1ZQQAmisPlsRFt73qpuII5X1P5i95cQ1I9V2ZI8UVatqJsLjqfIz3iygHXjqhXAL/6kA/OMrM aATIAFC7GOLUHvvY7cuYMwCRGHoHUGkYtu3z+zXj2LOAhuJwyIFNvcX+IK/mo9aekUPspfFGK+mz9 +J3wGjZLc1hPR6lNjxdZnr5haIxJDFrkDbSr1McU9YKHXWO/IrlhPkLrJgGe4pg5XajnLIFT1qDO5 onrHoUKHA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1khJXO-0004Th-OG; Mon, 23 Nov 2020 21:38:18 +0000 Received: from relay10.mail.gandi.net ([217.70.178.230]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1khJXL-0004Sn-6B for linux-arm-kernel@lists.infradead.org; Mon, 23 Nov 2020 21:38:16 +0000 Received: from localhost (lfbn-lyo-1-997-19.w86-194.abo.wanadoo.fr [86.194.74.19]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay10.mail.gandi.net (Postfix) with ESMTPSA id BDBBC240009; Mon, 23 Nov 2020 21:38:08 +0000 (UTC) Date: Mon, 23 Nov 2020 22:38:08 +0100 From: Alexandre Belloni To: Jonathan =?iso-8859-1?Q?Neusch=E4fer?= Subject: Re: [PATCH v4 5/7] rtc: New driver for RTC in Netronix embedded controller Message-ID: <20201123213808.GP348979@piout.net> References: <20201122222739.1455132-1-j.neuschaefer@gmx.net> <20201122222739.1455132-6-j.neuschaefer@gmx.net> <20201122231054.GH348979@piout.net> <20201123213105.GC456020@latitude> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20201123213105.GC456020@latitude> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201123_163815_368809_16C0208F X-CRM114-Status: GOOD ( 19.95 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Heiko Stuebner , devicetree@vger.kernel.org, Linus Walleij , Thierry Reding , Fabio Estevam , linux-rtc@vger.kernel.org, Arnd Bergmann , Mauro Carvalho Chehab , Sam Ravnborg , Daniel Palmer , Andy Shevchenko , Andreas Kemnade , NXP Linux Team , Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= , linux-pwm@vger.kernel.org, Stephan Gerhold , allen , Sascha Hauer , Lubomir Rintel , Rob Herring , Lee Jones , linux-arm-kernel@lists.infradead.org, Alessandro Zummo , linux-kernel@vger.kernel.org, Mark Brown , Pengutronix Kernel Team , Heiko Stuebner , Josua Mayer , Shawn Guo , "David S. Miller" Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 23/11/2020 22:31:05+0100, Jonathan Neusch=E4fer wrote: > > > + res =3D regmap_write(rtc->ec->regmap, NTXEC_REG_WRITE_MINUTE, ntxec= _reg8(tm->tm_min)); > > > + if (res) > > > + return res; > > > + > > > + return regmap_write(rtc->ec->regmap, NTXEC_REG_WRITE_SECOND, ntxec_= reg8(tm->tm_sec)); > > = > > Couldn't you do a regmap_block_write or a regmap_multi_reg_write which > > would be more efficient as they would be locking the regmap only once. > = > I can't find regmap_block_write anywhere, but regmap_multi_reg_write > looks like a good approach to simplify the code here. > = I was thinking regmap_bulk_write but regmap_multi_reg_write is probably more fitting here. > = > [...] > > Note that this won't compile after > > https://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux.git/comm= it/?id=3Dfdcfd854333be5b30377dc5daa9cd0fa1643a979 > > = > > We can solve that with immutable branches though. > = > Thanks for the heads-up. Please let me know if/when there is any action > that I need to take here. > = I wouldn't think so, I can carry a patch once Lee provides his usual immutable branch. -- = Alexandre Belloni, Bootlin Embedded Linux and Kernel engineering https://bootlin.com _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel