mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Charles Keepax <ckeepax@opensource.cirrus.com>
To: Mark Brown <broonie@kernel.org>
Cc: Richard Fitzgerald <rf@opensource.cirrus.com>,
	Lee Jones <lee@kernel.org>, <alsa-devel@alsa-project.org>,
	<patches@opensource.cirrus.com>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 08/11] mfd: wm5110: Update to use maple tree register cache
Date: Tue, 18 Jul 2023 17:00:35 +0000	[thread overview]
Message-ID: <20230718170035.GH103419@ediswmail.ad.cirrus.com> (raw)
In-Reply-To: <20230718154200.GG103419@ediswmail.ad.cirrus.com>

On Tue, Jul 18, 2023 at 03:42:00PM +0000, Charles Keepax wrote:
> On Thu, Jul 13, 2023 at 01:49:26AM +0100, Mark Brown wrote:
> > The maple tree register cache is based on a much more modern data structure
> > than the rbtree cache and makes optimisation choices which are probably
> > more appropriate for modern systems than those made by the rbtree cache. In
> > v6.5 it has also acquired the ability to generate multi-register writes in
> > sync operations, bringing performance up to parity with the rbtree cache
> > there.
> > 
> > Update the wm5110 driver to use the more modern data structure.
> > 
> > Signed-off-by: Mark Brown <broonie@kernel.org>
> > ---
> >  drivers/mfd/wm5110-tables.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/mfd/wm5110-tables.c b/drivers/mfd/wm5110-tables.c
> > index 65b9b1d6daec..eba324875afd 100644
> > --- a/drivers/mfd/wm5110-tables.c
> > +++ b/drivers/mfd/wm5110-tables.c
> > @@ -3218,7 +3218,7 @@ const struct regmap_config wm5110_i2c_regmap = {
> >  	.readable_reg = wm5110_readable_register,
> >  	.volatile_reg = wm5110_volatile_register,
> >  
> > -	.cache_type = REGCACHE_RBTREE,
> > +	.cache_type = REGCACHE_MAPLE,
> >  	.reg_defaults = wm5110_reg_default,
> >  	.num_reg_defaults = ARRAY_SIZE(wm5110_reg_default),
> >  };
> > 
> > -- 
> > 2.39.2
> > 
> 
> This one appears to cause me some issues, seems to get the IRQs
> into a weird state when doing compressed stream stuff. The
> issue seems to also require commit bfa0b38c1483 ("regmap:
> maple: Implement block sync for the maple tree cache") to be
> present. So it definitely seems to relate to the cache sync,
> but not sure if it is something todo with the device itself,
> or the maple tree stuff yet.
> 

Ah... I think I see the regcache_sync sets async=true, but then
the maple tree code immediately deletes the buffer after calling
_regmap_raw_write. So its a racy use after free.

How would we feel about having the maple tree code, clear async
again?

Thanks,
Charles

  reply	other threads:[~2023-07-18 17:04 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-13  0:49 [PATCH 00/11] mfd:: Update Cirrus Logic drivers to use maple tree register caches Mark Brown
2023-07-13  0:49 ` [PATCH 01/11] mfd: cs47l15: Update to use maple tree register cache Mark Brown
2023-07-13  0:49 ` [PATCH 02/11] mfd: cs47l24: " Mark Brown
2023-07-13  0:49 ` [PATCH 03/11] mfd: cs47l35: " Mark Brown
2023-07-13  0:49 ` [PATCH 04/11] mfd: cs47l85: " Mark Brown
2023-07-13  0:49 ` [PATCH 05/11] mfd: cs47l90: " Mark Brown
2023-07-13  0:49 ` [PATCH 06/11] mfd: cs47l92: " Mark Brown
2023-07-13  0:49 ` [PATCH 07/11] mfd: wm5102: " Mark Brown
2023-07-13  0:49 ` [PATCH 08/11] mfd: wm5110: " Mark Brown
2023-07-18 15:42   ` Charles Keepax
2023-07-18 17:00     ` Charles Keepax [this message]
2023-07-18 17:16       ` Mark Brown
2023-07-13  0:49 ` [PATCH 09/11] mfd: wm8994: " Mark Brown
2023-07-13  0:49 ` [PATCH 10/11] mfd: wm8997: " Mark Brown
2023-07-13  0:49 ` [PATCH 11/11] mfd: wm8998: " Mark Brown
2023-07-13 19:18 ` [PATCH 00/11] mfd:: Update Cirrus Logic drivers to use maple tree register caches Lee Jones

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=20230718170035.GH103419@ediswmail.ad.cirrus.com \
    --to=ckeepax@opensource.cirrus.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=lee@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=patches@opensource.cirrus.com \
    --cc=rf@opensource.cirrus.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®