Re: [PATCH v2 4/4] ASoC: cs42l43: Cache shutter IRQ control pointers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



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@xxxxxxxx>
> Signed-off-by: Charles Keepax <ckeepax@xxxxxxxxxxxxxxxxxxxxx>
> ---
>  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




[Index of Archives]     [Pulseaudio]     [Linux Audio Users]     [ALSA Devel]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux