Skip to contentSkip to conversation

ALSA: intel8x0: Improve comments for VM optimization

PATCH Takashi Iwai 1 participant 1 message Nov 8, 2011 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

At Mon, 7 Nov 2011 20:33:25 +0400,

Quoted 9 lines · Denis V. Lunev

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.

Applied now. Thanks.

Takashi

Quoted 25 lines
---
 sound/pci/intel8x0.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
sound/pci/intel8x0.c +7 -0
index 29e3125..c3b9bd0 100644
@@ -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))
Signature · 1 line
1.7.4.4