From: Charles Keepax <ckeepax@opensource.cirrus.com>
To: <broonie@kernel.org>, <perex@perex.cz>, <tiwai@suse.com>
Cc: <lgirdwood@gmail.com>, <linux-sound@vger.kernel.org>,
<patches@opensource.cirrus.com>
Subject: Re: [PATCH v2 4/4] ASoC: cs42l43: Cache shutter IRQ control pointers
Date: Wed, 31 Jul 2024 14:51:24 +0100 [thread overview]
Message-ID: <ZqpBXGH2+PZG2W95@opensource.cirrus.com> (raw)
In-Reply-To: <20240731133905.1254796-4-ckeepax@opensource.cirrus.com>
On Wed, Jul 31, 2024 at 02:39:05PM +0100, Charles Keepax wrote:
> The microphone/speaker privacy shutter ALSA control handlers need to
> call pm_runtime_resume, since the hardware needs to be powered up to
> check the hardware state of the shutter. The IRQ handler for the
> shutters also needs to notify the ALSA control to inform user-space
> the shutters updated. However this leads to a mutex inversion,
> between the sdw_dev_lock and the controls_rwsem.
>
> To avoid this mutex inversion cache the kctl pointers before the IRQ
> handler, which avoids the need to lookup the control and take the
> controls_rwsem.
>
> Suggested-by: Jaroslav Kysela <perex@perex.cz>
> Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
> ---
> static const struct snd_soc_dai_ops cs42l43_sdw_ops = {
> + .probe = cs42l43_dai_probe,
> + .remove = cs42l43_dai_remove,
> .startup = cs42l43_startup,
> .set_stream = cs42l43_sdw_set_stream,
> .hw_params = cs42l43_sdw_hw_params,
Actually probably makes slightly more sense to use the ASP ops
for the caching the control names, I will leave the patches
overnight for any other comments then send a v3 tomorrow.
Thanks,
Charles
prev parent reply other threads:[~2024-07-31 13:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-31 13:39 [PATCH v2 1/4] ASoC: cs42l43: Remove redundant semi-colon at end of function Charles Keepax
2024-07-31 13:39 ` [PATCH v2 2/4] ASoC: soc-component: Add new snd_soc_component_get_kcontrol() helper Charles Keepax
2024-07-31 13:39 ` [PATCH v2 3/4] ASoC: cs35l45: Use " Charles Keepax
2024-07-31 13:39 ` [PATCH v2 4/4] ASoC: cs42l43: Cache shutter IRQ control pointers Charles Keepax
2024-07-31 13:51 ` Charles Keepax [this message]
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=ZqpBXGH2+PZG2W95@opensource.cirrus.com \
--to=ckeepax@opensource.cirrus.com \
--cc=broonie@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-sound@vger.kernel.org \
--cc=patches@opensource.cirrus.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;
as well as URLs for NNTP newsgroup(s).