Message ID | 20230419-mfd-wm831x-maple-v1-1-e03e39d7bb0b@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp3591669vqo; Tue, 25 Apr 2023 11:22:05 -0700 (PDT) X-Google-Smtp-Source: AKy350bszZNoTOfokr23lE7N6kvY+Vlz1hNkzrOhsc5W0mPYQ2EMNoC6XCkicFfDDhNqE+KwXADb X-Received: by 2002:a17:902:d4d1:b0:19a:9880:175f with SMTP id o17-20020a170902d4d100b0019a9880175fmr22215100plg.51.1682446925533; Tue, 25 Apr 2023 11:22:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682446925; cv=none; d=google.com; s=arc-20160816; b=XT3qnnnxl2isHwleO8xsMzzeAvQAhWSM9IqOjoiPAK8VIwYfh8dF6F+Jov2FnyAgmS 5oxHx48d6rANENhJNw0G2aeiPMPMuZ/TtyMtB+VjUsLDM71RSEJcCAMzPlwTegljqNM5 qJIzcpjmBwtPepnsORWzEamh7ZQhdX+vw5I1xcYDfLmtqn32i5lfoUkyr2tJK8rkXPJu qoRBnDmJOhwhAWeY4/DMil1ScOty5CnPCCzlbaGVRt2S05USBFlQw4Wi9ugb/PxqbGlW 7KvLnJ+hPcT5xxSpTaF0b1Bs6l0EuuPgude6aHFkRGBX+5tXogYqdzytAxDhQqZvJYVZ aopQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:message-id:content-transfer-encoding :mime-version:subject:date:from:dkim-signature; bh=L3HSI6l67HnmtRr5hDUhNP7lI2SXQnyhMVQQiQDF94U=; b=dnCpR4n7P9KGQxDptUCumGPyqTDFSySbN3Jxs5tjbyzZDSqOpUsQETVwENlorVq+sm 22CdHuMrIB2vHY+Wysyom2ekATjQYuipWufLOp51AXULiEcv+lx6aVn/nd/7VE2vjfUU dQiodTPukqZY2JT/NX63Nd0knMrrWlbMjN2yp/HrXsC5u2kdVWKmzSTvLNi97pYidIoI ETlNqlvjQWae+1IE3exaxJI/gWnNfVtvUYiXsTtUfto9cxG955gOpTq46Y+Dwjh9DYZp z6w4RaSLUIXlAzskGWzlUMxtGgvzTMCfVY9M1BK8tXhjknewOWPLufkbrETvDClPH3zf A4wg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=eFup6VJr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j17-20020a170902759100b001a511921c06si13698502pll.358.2023.04.25.11.21.20; Tue, 25 Apr 2023 11:22:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=eFup6VJr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234990AbjDYSD4 (ORCPT <rfc822;zxc52fgh@gmail.com> + 99 others); Tue, 25 Apr 2023 14:03:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56436 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234963AbjDYSDw (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 25 Apr 2023 14:03:52 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7643C17A25 for <linux-kernel@vger.kernel.org>; Tue, 25 Apr 2023 11:03:39 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0D93E6296A for <linux-kernel@vger.kernel.org>; Tue, 25 Apr 2023 18:03:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 81E06C433EF; Tue, 25 Apr 2023 18:03:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1682445818; bh=kcvnS38dqteSFxCDyzJt6TsrX4wlKiMlwbZ7L3FPe6g=; h=From:Date:Subject:To:Cc:From; b=eFup6VJrMD2Lx/o0ER5E0DrDaSsdeb10+pPBJaVSI/J0IbrD2DrgEpQqoCxlHTmVS AHOzONtcafhQQ2N7mnrcTG5Z29tQC4hvumarSah+NKJA5Ilf2tvh1qOU6VFmpm6OXl +3u8n73qQtRGQbCblJrBqDrIyxR/7HE38ZKVH1xdVyERqVy4CmsG5bdvUQuqqBpTKm WlMDz9aSzYPLdBZB8cUBELJI8OBgqxYZ32PitCssChs+jWF6bx7Gy69Ew9BwDnU+rE hAAiYZ5Qv+cjIe4wqO9V6IUrl7FTlplL57pBTZ3ujwS/YOtmyGhXDKqHPK5QNLgsmo zH8GjkUBoi9jw== From: Mark Brown <broonie@kernel.org> Date: Tue, 25 Apr 2023 19:03:33 +0100 Subject: [PATCH] mfd: wm831x: Use maple tree register cache MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20230419-mfd-wm831x-maple-v1-1-e03e39d7bb0b@kernel.org> X-B4-Tracking: v=1; b=H4sIAPQVSGQC/x2NQQqDMBAAvyJ77oIxUrRfKT1skk1d2kTZQBXEv zd6nIFhdiiswgUezQ7KPyky5wrm1oCfKL8ZJVSGru1s25sRUwy4psGaDRMtX8Yh0H00zluOHmr mqDA6peynM1xn/Zx6UY6yXafn6zj+dGkcRnkAAAA= To: Lee Jones <lee@kernel.org> Cc: patches@opensource.cirrus.com, linux-kernel@vger.kernel.org, Mark Brown <broonie@kernel.org> X-Mailer: b4 0.13-dev-00e42 X-Developer-Signature: v=1; a=openpgp-sha256; l=1475; i=broonie@kernel.org; h=from:subject:message-id; bh=kcvnS38dqteSFxCDyzJt6TsrX4wlKiMlwbZ7L3FPe6g=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBkSBX4R9ogytMQ57hP+qeDhW1qtar4vRSfN/mlQ7lt 3VSnjg6JATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCZEgV+AAKCRAk1otyXVSH0OEGB/ 9RkAdaZzdGPd2HvXuzxpbQTDLY5/pTPAhtJUjoycsNv5uDtfys20RX6k70hrzVIqQGnoXGKTLMFlCo C1ksi+hF2Lt4luXxETyD3qpQ7h02n2FWHPFKA3/5LI8CPNE8gY7cZPj95eFSR2n//aKpLQDxYTYTWG +Gf+3HFsnuTl+JVHbrbrGsLr1T8Qe2YRP+G6cXsU/iKe0oVIGMcUju2xJiXhfU4Eczfa6P7ERfTgP8 hEjWAjAaLI45gNJ/kgCvZSWNBAEi64ZmULWrlXTjgPenc/DJ9Eveq4sJ0nePZkoPHeTgCTPRmWg4da SbzHWiidPVCEgZvQaXOygbwfrb59Y4 X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764173467588519891?= X-GMAIL-MSGID: =?utf-8?q?1764173467588519891?= |
Series |
mfd: wm831x: Use maple tree register cache
|
|
Commit Message
Mark Brown
April 25, 2023, 6:03 p.m. UTC
regmap has introduced a maple tree based register cache which makes use of
this more advanced data structure which has been added to the kernel
recently. Maple trees are much flatter than rbtrees, meaning that they do
not grow to such depths when the register map is sparse which makes access
a bit more efficient. The maple tree cache type is still a bit of a work
in progress but should be effective for some devices already.
The wm831x devices have a pretty sparse register map and being always on
devices never do cache syncs so don't hit the major current disadvantage
so they should be good candiates for using the maple tree cache. Update
to do so, there should be little if any visible difference at runtime.
Signed-off-by: Mark Brown <broonie@kernel.org>
---
drivers/mfd/wm831x-core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
base-commit: 4a670ac3e75e517c96cbd01ef870dbd598c3ce71
change-id: 20230419-mfd-wm831x-maple-8da691bc3efc
Best regards,
Comments
On Tue, Apr 25, 2023 at 07:03:33PM +0100, Mark Brown wrote: > regmap has introduced a maple tree based register cache which makes use of > this more advanced data structure which has been added to the kernel > recently. Maple trees are much flatter than rbtrees, meaning that they do > not grow to such depths when the register map is sparse which makes access > a bit more efficient. The maple tree cache type is still a bit of a work > in progress but should be effective for some devices already. > > The wm831x devices have a pretty sparse register map and being always on > devices never do cache syncs so don't hit the major current disadvantage > so they should be good candiates for using the maple tree cache. Update > to do so, there should be little if any visible difference at runtime. > > Signed-off-by: Mark Brown <broonie@kernel.org> > --- Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com> Thanks, Charles
On Tue, 25 Apr 2023, Mark Brown wrote: > regmap has introduced a maple tree based register cache which makes use of > this more advanced data structure which has been added to the kernel > recently. Maple trees are much flatter than rbtrees, meaning that they do > not grow to such depths when the register map is sparse which makes access > a bit more efficient. The maple tree cache type is still a bit of a work > in progress but should be effective for some devices already. > > The wm831x devices have a pretty sparse register map and being always on > devices never do cache syncs so don't hit the major current disadvantage > so they should be good candiates for using the maple tree cache. Update > to do so, there should be little if any visible difference at runtime. > > Signed-off-by: Mark Brown <broonie@kernel.org> > --- > drivers/mfd/wm831x-core.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Applied, thanks
On Thu, Apr 27, 2023 at 04:11:34PM +0100, Lee Jones wrote: > On Tue, 25 Apr 2023, Mark Brown wrote: > > > regmap has introduced a maple tree based register cache which makes use of > > this more advanced data structure which has been added to the kernel > > recently. Maple trees are much flatter than rbtrees, meaning that they do > Applied, thanks Note that the maple tree support for regmap has only landed in Linus' tree during the current merge window, I wasn't anticipating this being applied until -rc1 due to it being sent after the merge window opened.
On Thu, 27 Apr 2023, Mark Brown wrote: > On Thu, Apr 27, 2023 at 04:11:34PM +0100, Lee Jones wrote: > > On Tue, 25 Apr 2023, Mark Brown wrote: > > > > > regmap has introduced a maple tree based register cache which makes use of > > > this more advanced data structure which has been added to the kernel > > > recently. Maple trees are much flatter than rbtrees, meaning that they do > > > Applied, thanks > > Note that the maple tree support for regmap has only landed in Linus' > tree during the current merge window, I wasn't anticipating this being > applied until -rc1 due to it being sent after the merge window opened. It's been applied to for-mfd-next-next which will become for-mfd-next *after* the merge-window closes. IOW, it's due for v6.5.
diff --git a/drivers/mfd/wm831x-core.c b/drivers/mfd/wm831x-core.c index d2f444d2ae78..e86b6a4896a6 100644 --- a/drivers/mfd/wm831x-core.c +++ b/drivers/mfd/wm831x-core.c @@ -1430,7 +1430,7 @@ struct regmap_config wm831x_regmap_config = { .reg_bits = 16, .val_bits = 16, - .cache_type = REGCACHE_RBTREE, + .cache_type = REGCACHE_MAPLE, .max_register = WM831X_DBE_CHECK_DATA, .readable_reg = wm831x_reg_readable,