From: Denis V. Lunev Date: Mon, 7 Nov 2011 16:33:25 +0000 (+0400) Subject: ALSA: intel8x0: Improve comments for VM optimization X-Git-Tag: v3.2-rc2~23^2~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5a9a51799b23142d2fc3ef94894d3b5ac00d05a5;p=profile%2Fivi%2Fkernel-adaptation-intel-automotive.git ALSA: intel8x0: Improve comments for VM optimization The recently merged 228cf79376f1 looks a bit hackish while it is not. The change was quite simple. In a virtualized environment the patch unhacks old kludge introduced for old broken AC97 hardware. This patch adds proper comment to "unkludge" code. Signed-off-by: Denis V. Lunev Signed-off-by: Konstantin Ozerkov Signed-off-by: Takashi Iwai --- diff --git a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c index 29e3125..c3b9bd0 100644 --- a/sound/pci/intel8x0.c +++ b/sound/pci/intel8x0.c @@ -1077,6 +1077,13 @@ static snd_pcm_uframes_t snd_intel8x0_pcm_pointer(struct snd_pcm_substream *subs } if (civ != igetbyte(chip, ichdev->reg_offset + ICH_REG_OFF_CIV)) continue; + + /* IO read operation is very expensive inside virtual machine + * as it is emulated. The probability that subsequent PICB read + * will return different result is high enough to loop till + * timeout here. + * Same CIV is strict enough condition to be sure that PICB + * is valid inside VM on emulated card. */ if (chip->inside_vm) break; if (ptr1 == igetword(chip, ichdev->reg_offset + ichdev->roff_picb))