From: Takashi Iwai Date: Mon, 12 Jul 2021 09:36:41 +0000 (+0200) Subject: ALSA: intel8x0: Skip ac97 clock measurement on VM X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=27757876d1738a2dd528986c8143192f84eaa58a;p=linux.git ALSA: intel8x0: Skip ac97 clock measurement on VM The intel8x0 driver tries to measure the AC97 bus clock at the probe time because there have been machines that are driven in different rate (44.1kHz vs 48kHz). This was the past and currently most of usages of this driver are on VM, and those are certainly fixed with 48k clock, hence it's useless and waste of time to measure. This patch is an optimization, setting the fixed 48k rate if it's detected to be running on a VM. Link: https://lore.kernel.org/r/20210712093641.29079-1-tiwai@suse.de Signed-off-by: Takashi Iwai --- diff --git a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c index df3ba5c70de9a..6a436a2ce26a1 100644 --- a/sound/pci/intel8x0.c +++ b/sound/pci/intel8x0.c @@ -2656,6 +2656,8 @@ static void intel8x0_measure_ac97_clock(struct intel8x0 *chip) if (chip->ac97_bus->clock != 48000) return; /* specified in module option */ + if (chip->inside_vm && !ac97_clock) + return; /* no measurement on VM */ __again: subs = chip->pcm[0]->streams[0].substream;