Skip to content

Commit 2c32c36

Browse files
committed
Revert "Revert "ALSA: timer: Set lower bound of start tick time""
This reverts commit 9e5b75d.
1 parent 1abf21e commit 2c32c36

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

sound/core/timer.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,16 @@ static int snd_timer_start1(struct snd_timer_instance *timeri,
553553
goto unlock;
554554
}
555555

556+
/* check the actual time for the start tick;
557+
* bail out as error if it's way too low (< 100us)
558+
*/
559+
if (start) {
560+
if ((u64)snd_timer_hw_resolution(timer) * ticks < 100000) {
561+
result = -EINVAL;
562+
goto unlock;
563+
}
564+
}
565+
556566
if (start)
557567
timeri->ticks = timeri->cticks = ticks;
558568
else if (!timeri->cticks)

0 commit comments

Comments
 (0)