[alsa-devel] [PATCH 5/5] ALSA: usb-audio: fix msleep timeout due to minimum resolution of task scheduling
Takashi Iwai
tiwai at suse.de
Mon Feb 20 21:51:13 CET 2017
On Mon, 20 Feb 2017 21:09:21 +0100,
Takashi Sakamoto wrote:
>
> Depending on tick-related kernel configuration; e.g. HZ, task scheduler
> necessarily has no guarantee for its minimum resolution against ~20 msec
> msleep timeout.
>
> This commit expands msleep timeout up to 20 msec with an optimistic view
> to packet handling capability of the target device. 'checkpatch.pl'
> generated below warning.
Well, it doesn't matter even if you set to 20. When you use msleep(),
there is no guarantee of the minimum at all.
Takashi
>
> WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt
> + msleep(15);
>
> Fixes: d2bb390a2081 ("ALSA: usb-audio: Tascam US-16x08 DSP mixer quirk")
> Signed-off-by: Takashi Sakamoto <o-takashi at sakamocchi.jp>
> ---
> sound/usb/mixer_us16x08.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/sound/usb/mixer_us16x08.c b/sound/usb/mixer_us16x08.c
> index d34dd1c..1c2d167 100644
> --- a/sound/usb/mixer_us16x08.c
> +++ b/sound/usb/mixer_us16x08.c
> @@ -548,7 +548,7 @@ static int snd_us16x08_eqswitch_put(struct snd_kcontrol *kcontrol,
> if (err < 0)
> break;
> store->val[b_idx][3][index] = val;
> - msleep(15);
> + msleep(20);
> }
>
> if (err > 0) {
> --
> 2.9.3
>
More information about the Alsa-devel
mailing list