mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: Mark Brown <broonie@kernel.org>,
	Oder Chiou <oder_chiou@realtek.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>
Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ASoC: rt5682: Use a maple tree based register cache
Date: Tue, 23 May 2023 14:24:53 -0500	[thread overview]
Message-ID: <1ce6bb84-3140-3953-e995-00eb7b16f386@linux.intel.com> (raw)
In-Reply-To: <20230419-asoc-rt5682-maple-v1-1-ed40369c9099@kernel.org>



On 4/25/23 12:22, 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.
> 
> RT5682 seems like a good candidate for maple tree. It only supports single
> register read/write operations so will gain minimal benefit from storing
> the register data in device native format like rbtree does (none for
> SoundWire) and has some sparsity in the register map which is a good fit
> for maple tree.
> 
> Convert to use maple tree. There should be little if any visible difference
> at runtime.

Wondering if this is the root cause of the regression we're seeing in
[1] on a Chromebook with rt5682 in SoundWire mode?

I don't see any other changes to this codec driver and the first problem
detected seemed to happen when we did an upstream merge last week.
Unfortunately the last merge was on April 24 (sof-dev-rebase-20230424)
which is just the day before this commit was added...

[1] https://github.com/thesofproject/linux/issues/4371

> 
> Signed-off-by: Mark Brown <broonie@kernel.org>
> ---
>  sound/soc/codecs/rt5682-sdw.c | 2 +-
>  sound/soc/codecs/rt5682s.c    | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/sound/soc/codecs/rt5682-sdw.c b/sound/soc/codecs/rt5682-sdw.c
> index 5f80a5d59b65..fb7951f11c92 100644
> --- a/sound/soc/codecs/rt5682-sdw.c
> +++ b/sound/soc/codecs/rt5682-sdw.c
> @@ -79,7 +79,7 @@ static const struct regmap_config rt5682_sdw_indirect_regmap = {
>  	.max_register = RT5682_I2C_MODE,
>  	.volatile_reg = rt5682_volatile_register,
>  	.readable_reg = rt5682_readable_register,
> -	.cache_type = REGCACHE_RBTREE,
> +	.cache_type = REGCACHE_MAPLE,
>  	.reg_defaults = rt5682_reg,
>  	.num_reg_defaults = RT5682_REG_NUM,
>  	.use_single_read = true,
> diff --git a/sound/soc/codecs/rt5682s.c b/sound/soc/codecs/rt5682s.c
> index 9c34dca58f54..36102fa2b806 100644
> --- a/sound/soc/codecs/rt5682s.c
> +++ b/sound/soc/codecs/rt5682s.c
> @@ -3046,7 +3046,7 @@ static const struct regmap_config rt5682s_regmap = {
>  	.max_register = RT5682S_MAX_REG,
>  	.volatile_reg = rt5682s_volatile_register,
>  	.readable_reg = rt5682s_readable_register,
> -	.cache_type = REGCACHE_RBTREE,
> +	.cache_type = REGCACHE_MAPLE,
>  	.reg_defaults = rt5682s_reg,
>  	.num_reg_defaults = ARRAY_SIZE(rt5682s_reg),
>  	.use_single_read = true,
> 
> ---
> base-commit: 4a670ac3e75e517c96cbd01ef870dbd598c3ce71
> change-id: 20230419-asoc-rt5682-maple-7da060991ca4
> 
> Best regards,

  reply	other threads:[~2023-05-23 19:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-25 17:22 Mark Brown
2023-05-23 19:24 ` Pierre-Louis Bossart [this message]
2023-05-23 19:28   ` Mark Brown
2023-05-23 19:36     ` Pierre-Louis Bossart
2023-05-23 19:41   ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1ce6bb84-3140-3953-e995-00eb7b16f386@linux.intel.com \
    --to=pierre-louis.bossart@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oder_chiou@realtek.com \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®