Commit 483adc64 authored by Takashi Iwai's avatar Takashi Iwai Committed by Wen Zhiwei
Browse files

ALSA: timer: Relax start tick time check for slave timer elements

stable inclusion
from stable-v6.6.48
commit bb121128fd586f548ff0cb4845e2adcf9c41826c
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/IAWEBV

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=bb121128fd586f548ff0cb4845e2adcf9c41826c

--------------------------------

commit ccbfcac05866ebe6eb3bc6d07b51d4ed4fcde436 upstream.

The recent addition of a sanity check for a too low start tick time
seems breaking some applications that uses aloop with a certain slave
timer setup.  They may have the initial resolution 0, hence it's
treated as if it were a too low value.

Relax and skip the check for the slave timer instance for addressing
the regression.

Fixes: 4a63bd179fa8 ("ALSA: timer: Set lower bound of start tick time")
Cc: <stable@vger.kernel.org>
Link: https://github.com/raspberrypi/linux/issues/6294
Link: https://patch.msgid.link/20240810084833.10939-1-tiwai@suse.de


Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarWen Zhiwei <wenzhiwei@kylinos.cn>
parent 82ab1212
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -556,7 +556,7 @@ static int snd_timer_start1(struct snd_timer_instance *timeri,
	/* check the actual time for the start tick;
	 * bail out as error if it's way too low (< 100us)
	 */
	if (start) {
	if (start && !(timer->hw.flags & SNDRV_TIMER_HW_SLAVE)) {
		if ((u64)snd_timer_hw_resolution(timer) * ticks < 100000) {
			result = -EINVAL;
			goto unlock;