From: Charles Keepax <ckeepax@opensource.cirrus.com>
To: Mark Brown <broonie@kernel.org>
Cc: lgirdwood@gmail.com, yung-chuan.liao@linux.intel.com,
pierre-louis.bossart@linux.dev, linux-sound@vger.kernel.org,
linux-kernel@vger.kernel.org, patches@opensource.cirrus.com
Subject: Re: [PATCH v3 2/4] ASoC: SDCA: Populate IRQ data earlier
Date: Tue, 21 Jul 2026 11:30:53 +0100 [thread overview]
Message-ID: <al9KXWTZAVG5A5NI@opensource.cirrus.com> (raw)
In-Reply-To: <al4xKTNo9+Zm96IM@opensource.cirrus.com>
On Mon, Jul 20, 2026 at 03:31:05PM +0100, Charles Keepax wrote:
> On Sun, Jul 19, 2026 at 02:24:26PM +0100, Mark Brown wrote:
> > On Thu, Jul 16, 2026 at 03:26:37PM +0100, Charles Keepax wrote:
> > > Currently, the IRQ data (attached Entity/Control/etc) is populated
> > > as the IRQ is requested. However, this can cause issues as
> > > occasionally the setup process wants to access specifics of
> > > an IRQ before the IRQ is actually enabled. To facilitate this
> > > cache all the IRQ data during sdca_irq_populate_early() and make
> > > sdca_irq_populate() simply request the outstanding IRQs. This
> > > also has the advantage that sdca_irq_populate() can now just
> > > iterate through the IRQ array which is much smaller/faster than
> > > going through every Entity in the Function for Controls.
> >
> > > --- a/sound/soc/sdca/sdca_interrupts.c
> > > +++ b/sound/soc/sdca/sdca_interrupts.c
> > > @@ -375,7 +375,7 @@ int sdca_irq_data_populate(struct device *dev, struct regmap *regmap,
> > > if (!dev)
> > > return -ENODEV;
> > >
> > > - name = kasprintf(GFP_KERNEL, "%s %s", entity->label, control->label);
> > > + name = devm_kasprintf(dev, GFP_KERNEL, "%s %s", entity->label, control->label);
> > > if (!name)
> > > return -ENOMEM;
> > >
> >
> > Moving to devm_ makes me a bit nervous.
>
> Moving to devm should be good here. The expectation is that
> sdca_irq_populate_early() is called from device probe and this
> moves all the allocations into there. Even before this series
> we had devm_ allocations being done by sdca_fdl_alloc_state(),
> so the requirement to call sdca_irq_populate_early() from device
> probe already existed.
>
> With the split of the cleanup into two steps though, we could
> move everything onto manually allocations and clean them up there
> if we felt this was a little too hidden behind the API? Or
> document it more in the kernel doc I guess?
Ok looking at the patch Pierre pointed me at I think maybe it is
best to update this to not use devm. Will provide slightly more
flexibility for the calling drivers, its fine for the class
driver as is but people are doing quite custom stuff outside of
that.
I will do a respin of the series later today.
Thanks,
Charles
next prev parent reply other threads:[~2026-07-21 10:31 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-16 14:26 [PATCH v3 0/4] Fix races on creation of SDCA jack detection Charles Keepax
2026-07-16 14:26 ` [PATCH v3 1/4] ASoC: Add a component fixup_controls callback Charles Keepax
2026-07-16 14:26 ` [PATCH v3 2/4] ASoC: SDCA: Populate IRQ data earlier Charles Keepax
2026-07-17 20:42 ` Pierre-Louis Bossart
2026-07-20 14:37 ` Charles Keepax
2026-07-20 14:44 ` Pierre-Louis Bossart
2026-07-20 15:02 ` Charles Keepax
2026-07-19 13:24 ` Mark Brown
2026-07-20 14:31 ` Charles Keepax
2026-07-21 10:30 ` Charles Keepax [this message]
2026-07-16 14:26 ` [PATCH v3 3/4] ASoC: SDCA: Add sdca_irq_cleanup_late() Charles Keepax
2026-07-16 14:26 ` [PATCH v3 4/4] ASoC: SDCA: Switch to fixup_controls callback for IRQ registration Charles Keepax
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=al9KXWTZAVG5A5NI@opensource.cirrus.com \
--to=ckeepax@opensource.cirrus.com \
--cc=broonie@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=patches@opensource.cirrus.com \
--cc=pierre-louis.bossart@linux.dev \
--cc=yung-chuan.liao@linux.intel.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