[alsa-devel] [PATCH for-5.6] ALSA: hda: Manage concurrent reg access more properly

Takashi Iwai tiwai at suse.de
Mon Jan 13 13:42:11 CET 2020


On Mon, 13 Jan 2020 13:33:10 +0100,
Kai Vehmanen wrote:
> 
> Hi,
> 
> On Thu, 9 Jan 2020, Takashi Iwai wrote:
> 
> > In the commit 8e85def5723e ("ALSA: hda: enable regmap internal
> > locking"), we re-enabled the regmap lock due to the reported
> > regression that showed the possible concurrent accesses.  It was a
> > temporary workaround, and there are still a few opened races even
> > after the revert.  In this patch, we cover those still opened windows
> > with a proper mutex lock and disable the regmap internal lock again.
> 
> I've been running tests on multiple HDA machines plus submitted the patch 
> through the GFX CI (that found the original problem) and no issues have 
> been found. So with that:
> 
> Tested-by: Kai Vehmanen <kai.vehmanen at linux.intel.com>

Thanks, now the patch is queued into for-next branch.

> One minor nit from checkpatch:
> 
> > +/* a helper macro to call @func_call; retry with power-up if failed */
> > +#define CALL_RAW_FUNC(codec, func_call)				\
> > +	({							\
> > +		int _err = func_call;				\
> > +		if (_err == -EAGAIN) {				\
> > +			_err = snd_hdac_power_up_pm(codec);	\
> > +			if (_err >= 0)				\
> > +				_err = func_call;		\
> > +			snd_hdac_power_down_pm(codec);		\
> > +		}						\
> > +		_err;})
> 
> Checkpatch --strict doesn't like this:
> 
> ERROR: space required after that ';' (ctx:VxV)
> #121: FILE: sound/hda/hdac_regmap.c:450:
> +               _err;})
>                     ^

It's in a hackish macro code, and checkpatch is no bible, so some
errors or warnings can be ignored if you know that it's OK :)


thanks,

Takashi


More information about the Alsa-devel mailing list