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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id ADB6CCCD1AB for ; Fri, 24 Oct 2025 10:20:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date :Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=rqG8JJU//jSyD1VSfucL8dQuWMQhrSSAEzNnNmDf/cs=; b=pxzR8YVZPwQCXW20/lbYoR5hyl wasIajtKRddeUrc72CMtzrn4+LFsVtazFLnSKDMaNh3B/DgxWzHcmL5HtCe57W00D23CYKvJ0lnvn f9uZ+lQoykLSYpK1aoZANvs84PywdJB9j+yaNjAqg6SEWZyGf9mzsLS6C4ojK8AeFDEz5NX/fBwo8 NaisjEWFK3z6bedIm+fPcCt3vfrhDlIyU/w2cksJUdCeS9MmG6udyj12zIEI65BAu2LOSFVDwf9Gq n1i/6GVflRocvyVbXVzex9rDJeMMSJUoApZj1Pw4s/dmt7nuGOqZwHDvVWN5egx79NyrW6ZbJCv2U g7A5lvUw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1vCEuL-000000090ei-3aZI; Fri, 24 Oct 2025 10:20:29 +0000 Received: from tor.source.kernel.org ([172.105.4.254]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1vCEuL-000000090ec-25b2 for linux-riscv@lists.infradead.org; Fri, 24 Oct 2025 10:20:29 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id D90B6601A4; Fri, 24 Oct 2025 10:20:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BA4A3C4CEF5; Fri, 24 Oct 2025 10:20:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1761301228; bh=FnW71TqPVzXRwI0dpG/xTBjzIyGRYlri2cV1BYifyeg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=P+m0hwPsa1c9TUACFZRnUOkfnRR//EoynKUc2HkHZer4k0ASAdUGyETGx+4DOd4/D T3BqTR1lnp9a2tyc+UYGQKADQtoqLD6TKmNynKgNei1ThL7+S7Qk+DaJLUdwveuo5b HtBPY6ZVlCVnkqYfuwh95NS8VnGSBjY2NgGwvXRiFc/WCjF454xtDd5274z7ReMfI8 tcCSlkNAa1y5lEccmQSqjwiZl+s58PvTDSo0TQ0rqZPmOpqAFZds6QPnGoU6K7Lw2e Xpfa/CwIuZtVVUObftnAU0Rf0fmDrS/VxKJiCOehPFsRC4AKWT8n8Gpl4/wPjXPcMt SXf+1m6g715zw== Date: Fri, 24 Oct 2025 11:20:23 +0100 From: Conor Dooley To: Claudiu Beznea Cc: Conor Dooley , Daire McNamara , pierre-henry.moussay@microchip.com, valentina.fernandezalanis@microchip.com, Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Philipp Zabel , linux-riscv@lists.infradead.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Brian Masney Subject: Re: [PATCH v5 5/9] clk: microchip: mpfs: use regmap for clocks Message-ID: <20251024-dimness-everyday-1c074ce1f203@spud> References: <20251013-album-bovine-faf9f5ebc5d4@spud> <20251013-undercook-flatfoot-70dca974cd19@spud> MIME-Version: 1.0 In-Reply-To: X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============8801808890472724113==" Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org --===============8801808890472724113== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="CLHXK2iYVH1gz/Qf" Content-Disposition: inline --CLHXK2iYVH1gz/Qf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Oct 23, 2025 at 07:06:01AM +0300, Claudiu Beznea wrote: > On 10/13/25 20:45, Conor Dooley wrote: > > From: Conor Dooley > > +static int mpfs_cfg_clk_set_rate(struct clk_hw *hw, unsigned long rate= , unsigned long prate) > > +{ > > + struct mpfs_cfg_hw_clock *cfg_hw =3D to_mpfs_cfg_clk(hw); > > + struct mpfs_cfg_clock *cfg =3D &cfg_hw->cfg; > > + unsigned long flags; > > + u32 val; > > + int divider_setting; >=20 > This could be moved near flags to keep the reverse christmas tree order as > in the rest of this patch. The driver doesn't (intentionally) use reverse christmas tree. If it does, that's just a byproduct of putting bigger types before smaller ones. > > + divider_setting =3D divider_get_val(rate, prate, cfg->table, cfg->wid= th, 0); > > + > > + if (divider_setting < 0) > > + return divider_setting; > > + > > + spin_lock_irqsave(&mpfs_clk_lock, flags); >=20 > As spin locking is introduced in this file by this patch, you can go > directly w/ cleanup helpers for locking. >=20 > > + > > + regmap_read(cfg->map, cfg->map_offset, &val); > > + val &=3D ~(clk_div_mask(cfg->width) << cfg_hw->cfg.shift); >=20 > Why cfg_hw->cfg.shift here --------------------^ but cfg->shift on the ne= xt > line? >=20 > > + val |=3D divider_setting << cfg->shift; > > + regmap_write(cfg->map, cfg->map_offset, val); >=20 > Can't the regmap_read() + updated + regmap_write() be replaced by > regmap_update_bits() ? Yeah, I suppose it could. Ultimately what's here is a revert of with readl()/writel() replaced by regmap operations directly, so the answer to the above three items is that that's how they were done before the patch I am reverting. That's probably the answer to 90% of the things you've said here, this is how they were done prior to the commit I am reverting. --CLHXK2iYVH1gz/Qf Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCaPtS5wAKCRB4tDGHoIJi 0sNMAQDlxAVOoPeGx0hK7BMub2zdWhzl5Z42VCSLO0sdhyD3IAEAiM0jeYZctPm/ LnrQTlUDFXDzYmq5VgkJDAkrhjUULgk= =KbJi -----END PGP SIGNATURE----- --CLHXK2iYVH1gz/Qf-- --===============8801808890472724113== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv --===============8801808890472724113==--